Closed joshuafcole closed 10 years ago
Did you add the following to your workspace configuration?
{:+ {:tern.config [(:lt.plugins.tern/libs :ecma5)
(:lt.plugins.tern/plugin :node true)]}
:- {:tern.config [:lt.plugins.tern/libs]}}
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/
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) [442] BEHerror bootstrap.js [6196] c bootstrap.js [6236] a bootstrap.js [20533] lt.object.raiseSTAR bootstrap.js [20566] a bootstrap.js [20570] b [416] anonymous events.js [98] EventEmitter.emit child_process.js [318] handleMessage child_process.js [345] channel.onread
You can get to your workspace behaviors by typing Settings: Workspace behaviors
to setup workspace local configuration for the plugin.
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 :doc_comments
plugin is correctly loaded.
Ah, thanks for the info. I may find some time to take a look this evening, but I should probably get back to work. Too much yak-shaving in one day makes schedules uncomfortably tight. :)
On Thu, Apr 3, 2014 at 12:27 PM, Eric Pritchett notifications@github.comwrote:
You can get to your workspace behaviors by typing Settings: Workspace behaviors to setup workspace local configuration for the plugin.
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 logginghttps://github.com/mortalapeman/LT-TernJS/blob/master/node/ternserver.js#L9and throw in a few log statements to ensure that the :doc_comments plugin is correctly loaded.
Reply to this email directly or view it on GitHubhttps://github.com/mortalapeman/LT-TernJS/issues/9#issuecomment-39494243 .
Screw the environment. Please print this email immediately. And then burn it.
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:
It looks a lot like this Tern issuehttps://github.com/marijnh/tern/issues/253has 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.
Reply to this email directly or view it on GitHubhttps://github.com/mortalapeman/LT-TernJS/issues/9#issuecomment-40294928 .
Screw the environment. Please print this email immediately. And then burn it.
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 have time to dive in a bit this weekend. On Apr 15, 2014 8:12 AM, "Eric Pritchett" notifications@github.com wrote:
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.
— Reply to this email directly or view it on GitHubhttps://github.com/mortalapeman/LT-TernJS/issues/9#issuecomment-40493628 .
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. :package:
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