| Summary: | [tern] Weird ordering problem for plugins and content assist | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public |
| Version: | 12.0 | ||
| Target Milestone: | 13.0 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
Looks like the problem is in tern.js while trying to gather proposals. line 791 in tern.js has the following: for (var prop in srv.cx.props) gather(prop, srv.cx.props[prop][0], 0); since props are inferred and added as an array (srv.cx.props[prop] can be an array of undetermined length), we should be gathering all of the props from that contest, not just the first one. Fix + test updates in: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=38c49518f78e318c776916f64ed9ab36c58b71d9 Upstream Tern bug and pull request: https://github.com/ternjs/tern/issues/797 This causes a test failure for me locally Tern Content Assist Tests MySQl Index Tests test mysql index 4 ‣ AssertionError: Invalid proposal description: expected 'node' to equal 'mysql' The returned proposals are in a different order than expected. This works in the editor because we run our own sorting function, but the tests are looking at what Tern is returning. |
Have a .tern-project file with the following contents: { "plugins": { "node": {}, "mysql": {} }, "libs": ["ecma5", "ecma6"] } then make a source file with the following: /*eslint-env mysql*/ require('mysql').createQuery(null,null,null).star Invoking assist will give you two proposals, one from node (from EventEmitter) and one from ecma6. But the one from mysql is not given. If you swap the order of the node and mysql plugins in the .tern-project file, you get the mysql proposal and not the node one??