Comments (8)
I confirmed it, tern-closure cannot work with tern 0.11.
from tern-closure.
Tern's plugin interface has been changed sine 0.11.
We can do some patch to compatible new interface.
//from complete_strings.js
function complete(file, query) {
var pos = tern.resolvePos(file, query.end);
var lit = infer.findExpressionAround(file.ast, null, pos, file.scope, "Literal");
if (!lit || typeof lit.node.value != "string") return;
var before = lit.node.value.slice(0, pos - lit.node.start - 1);
var matches = [], seen = infer.cx().parent._completeStrings.seen;
for (var str in seen) if (str.length > before.length && str.indexOf(before) == 0) {
if (query.types || query.docs || query.urls || query.origins) {
var rec = {name: JSON.stringify(str), displayName: str};
matches.push(rec);
if (query.types) rec.type = "string";
if (query.origins) rec.origin = seen[str];
} else {
matches.push(JSON.stringify(str));
}
}
if (matches.length) return {
start: tern.outputPos(query, file, lit.node.start),
end: tern.outputPos(query, file, pos + (file.text.charAt(pos) == file.text.charAt(lit.node.start) ? 1 : 0)),
isProperty: false,
completions: matches
};
}
from tern-closure.
See #39, it seems working for me.
from tern-closure.
Yep, I believe this - I've been out of the game for a while (apologies). I now have some good reasons to get going again, so expect more regular updates.
from tern-closure.
Merged the above pull request, and updated the Closure side so the tests were passing.
I am going to manually test a bit more thoroughly before closing this issue.
from tern-closure.
If installing from github it now works. npm however still downloads the tagged older version with tern requirement set to 0.7.0
from tern-closure.
+1 Need to tag and push new npm version
Edit: Also, this isn't working for tern 0.15.0... I'll try to look into it later, but currently have to npm i [email protected]
to make it work.
from tern-closure.
+1; would appreciate it if the current version of tern-closure in npm works with the current version of tern.
from tern-closure.
Related Issues (20)
- Function type expression support
- Expose type nullability information
- Support union types HOT 2
- Support optional argument types
- Support varargs
- Interface multiple inheritance
- Minimal requirements loading HOT 1
- Include condensed type definition file of Closure library HOT 2
- Support generics
- Issues with JSDoc types missing braces.
- Support autocompletion of names in comments
- Support go-to-definition for type strings in JSDoc and goog.require
- Go-to-overriden-method
- Completion for object litteral HOT 2
- Document installation with tern.java HOT 3
- Include Closure base.js definitions
- TypeError: Cannot read property 'name' of null HOT 2
- Add support for goog.module HOT 1
- tern-closure and atom-tern HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tern-closure.