| Summary: | Tern index parser doesn't support return type signatures | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Michael_Rennie |
| Version: | 5.0 | ||
| Target Milestone: | 5.0 M2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Mark Macdonald
(In reply to Mark Macdonald from comment #0) I fixed the tests and added a couple more of them: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=2fc052c41613cda525074712e710451852166fe5 The index parser does seem to support the 'fn()' as a parameter, for example this signature is ok: "fn(callback: fn())" > i) When trying to hook up the postgres index to the JS content assist > engine, I ran into this error about the "!ret" property (used to indicate a > function's return type): I think this is related to the problem below. > > The problematic syntax was this type signature (note the arrow indicating > the return type). > > "exec": "fn(callback: fn()) -> fn(err: Error, replies: Object)" This failure seems to be caused by the parser failing to handle the return type. For example the mentioned signature parses to "fn())->fn(err:+Error" after one pass of the index parser (BAD) and each pass whittles it down to something worse until doctrine barfs and dies trying to parse a type object from ">fn(err:+Error". While working on this I discovvered that the index file was wrong at that location and the output with the -> fn(err:...) was actually wrong, the function actually returns a Boolean (from inspecting the source). Looking at the parser an related Tern / Doctrine info when a function returns a function it should be written as 'Function' or '+Function', so I don;t think case is even valid.' I'm going to close this as worksforme, I don't think we should bother trying to support expanded function return types (since we are planning to refactor all this code anyway). |