-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tern no longer finds node_modules #9
Comments
Did you add the following to your workspace configuration?
The plugin no longer includes all the tern plugins by default. You are now required to configure the plugin to your current JS environment. A browser environment is the default. Including all the plugins by default was causing tern to do wonky things, so I'm trying to move more to something like the .tern-project file for now. In the future I'd like to try and guess at your environment and configure it for you, but I haven't had time to work on it lately. |
Haven't actually done any per-workspace configuration yet. I found the appropriate ltcache/workspace/.clj file. should I add that into the :ws-behaviors string? Or as an object? |
As an object broke the behavior and as a string doesn't seem to have the intended effect. |
Adding them to my user.behaviors seems to work, but breaks the tern plugin when first attempting to doc or goto anything (presumably as it initializes): TypeError: Cannot set property 'isOptional' of undefined at jsdocInterpretComments (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/plugin/doc_comment.js:234:46) at interpretComments (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/plugin/doc_comment.js:72:5) at walk.simple.FunctionDeclaration (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/plugin/doc_comment.js:49:11) at c (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/node_modules/acorn/util/walk.js:30:18) at Object.skipThrough (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/node_modules/acorn/util/walk.js:146:39) at c (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/node_modules/acorn/util/walk.js:29:17) at Object.base.Program.base.BlockStatement (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/node_modules/acorn/util/walk.js:154:7) at c (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/node_modules/acorn/util/walk.js:29:17) at Object.exports.simple (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/node_modules/acorn/util/walk.js:32:5) at postInfer (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/plugin/doc_comment.js:41:10) at runPasses (/Users/jcole/Library/Application Support/LightTable/plugins/TernJS/node_modules/tern/lib/infer.js:1107:58) |
You can get to your workspace behaviors by typing Hmmm, I'll have to check into this when I get home tonight. I'm pretty sure JavaScript docs were working before I published the plugin. If you are feeling adventurous, you can turn on logging and throw in a few log statements to ensure that the |
Ah, thanks for the info. I may find some time to take a look this evening, On Thu, Apr 3, 2014 at 12:27 PM, Eric Pritchett notifications@github.comwrote:
Screw the environment. Please print this email immediately. And then burn |
Haha true that. I really appreciate the feedback btw. I had planned to dog food myself with the plugin, but then I got put on the backend team writing C# so I haven't really been able to put this project through it's paces like I want to. |
It looks a lot like this Tern issue has been fixed on the tip of development. I am currently using the latest Tern node package, but I should probably look into living on the edge and including the project as a git submodule. The 0.5.0 package was release like 5 months ago and there are several other fixes I'd like included as well. |
That makes the most sense to me. I'll be keeping an eye out for updates. :) On Sat, Apr 12, 2014 at 4:55 PM, Eric Pritchett notifications@github.comwrote:
Screw the environment. Please print this email immediately. And then burn |
Interesting, I apparently merged that subtree commit twice somehow. Anyway, try it out now. I've update Tern to the version used by the Adobe Brackets team. |
It's working a lot better now! It works as expected on projects which are entirely CommonJS. It still dies on the mixed CommonJS / AMD project (backend in node, frontend in requireJS) regardless of whether I'm querying node things or AMD things. It doesn't block user input, freeze LT, or try incessantly to reconnect, so it's not a huge problem (at least I can use it on the pure node projects). The stack trace doesn't look too helpful, but here it is. in the mixed project: cljserror: channel closed at ChildProcess.target.send (child_process.js:402:26) at eval (/Users/jcole/Library/Application%20Support/LightTable/plugins/TernJS/ternjs_compiled.js:402:16) at eval (/Users/jcole/Library/Application%20Support/LightTable/plugins/TernJS/ternjs_compiled.js:260:506) at eval (/Users/jcole/Library/Application%20Support/LightTable/plugins/TernJS/ternjs_compiled.js:199:14) at eval (/Users/jcole/Library/Application%20Support/LightTable/plugins/TernJS/ternjs_compiled.js:84:18) at eval (/Users/jcole/Library/Application%20Support/LightTable/plugins/TernJS/ternjs_compiled.js:84:18) at eval (/Users/jcole/Library/Application%20Support/LightTable/plugins/TernJS/ternjs_compiled.js:84:18) at eval (/Users/jcole/Library/Application%20Support/LightTable/plugins/TernJS/ternjs_compiled.js:84:18) at eval (/Users/jcole/Library/Application%20Support/LightTable/plugins/TernJS/ternjs_compiled.js:100:18) at Object.eval as oncomplete |
Looks like something is crashing the node process. I'll make a new issue for it and see if I can hunt down the problem. |
Sounds great, if there's anything I can do to help let me know. I should
|
Hey there. Finally got some time to experiment with this again at work. The good news is that it no longer hangs on the large node client/server stack that was previously causing it trouble. It throws up its hands and gives up on AMD, but that's par for the course even with humans sometimes. 📦
Unfortunately, it no longer seems capable of finding definitions within the node_modules directory, which is 80% of it's use case for me. When I want documentation on a function or need to jump to its definition, it's almost never in the same app as I'm currently in (as we try to avoid giant monolithic apps). While I agree it shouldn't eagerly parse each module, it would be nice if it could recognize that I asked for information on a node module and parse it then.
Cheers,
Josh
The text was updated successfully, but these errors were encountered: