| Summary: | Nativation not working for Brackets source code for EventDispatcher.makeEventDispatcher | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Steve Northover <steve_northover> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | curtis.windatt.public, kuschel, Michael_Rennie |
| Version: | 12.0 | ||
| Target Milestone: | 14.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Steve Northover
1) Follow the steps in comment #0 Result: The declaration is found in EventDispatcher.js marked with ? 2) Run open decl / open impl from CommandManager.js Result: The correct decl/impl in EventDispatcher.js is opened 3) Run find references again Result: The declaration is found in EventDispatcher.js marked with a check This behaviour appears correct for me. We always find the declaration, but on the initial pass find references isn't 100% certain that they are referencing the same function. Once you run open declaration Tern is certain that EventDispatcher is the correct declaration. I'm closing this as WORKSFORME. Reopen if you think I missed something. cc'ing Mike in case I'm wrong about when find refs should be 100% confident about the declaration. Step 4 is wrong. It should say "4) Tools->Open Declaration" I get "No implementation was found" If you run Reference->Project and then Tools->Open Declaration you get different behavior. You get a bogus potential mat. Potential matches: EventDispatcher.js - src/utils/EventDispatcher.js (start: 13552, end: 13571) To be 100% clear, "2) Run open decl / open impl from CommandManager.js Result: The correct decl/impl in EventDispatcher.js is opened" is not working for me. I am doing this on orion.eclipse.org. Closed accidently This still fails. There is only one declaration of this method in the project. Why can't we find it?
var EventDispatcher = require("utils/EventDispatcher");
EventDispatcher.makeEventDispatcher(Command.prototype);
Works in Sublime, fails in VS code, fails in Atom ... Works in Sublime, fails in VS code, fails in Atom ... (In reply to Steve Northover from comment #8) > Works in Sublime, fails in VS code, fails in Atom ... The problem in our case is that the commonjs plugin is not loaded / not being called, so none of the type information is being propagated correctly (why we can't find the decl). I also noticed that our linting rule does not nag about the plugin not being loaded (when it should be) Adding this simple .tern-project file makes it all work as expected:
{
"plugins": {
"commonjs": {}
},
"libs": ["ecma5", "ecma6"],
"ecmaVersion": 6,
"loadEagerly": []
}
I pushed a fix in bug 511235 that prevents core rules from being turned off. So without the above mentioned .tern-project file, you get alerted that the plugin is not running.
(In reply to Michael Rennie from comment #10) > I pushed a fix in bug 511235 that prevents core rules from being turned off. > So without the above mentioned .tern-project file, you get alerted that the > plugin is not running. I'm going to close this one worksforme, since it was a configuration issue, that is now properly reported via the fix to bug 511235. |