Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 518330

Summary: [parser] Parser does not recover correctly based on whitespace
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 13.0   
Target Milestone: 16.0   
Hardware: PC   
OS: Mac OS X   
See Also: https://github.com/eclipse/orion.client/pull/92
Whiteboard:

Description Michael Rennie CLA 2017-06-15 16:59:12 EDT
consider the following snippet:

define([
'b'
], function(b) {
	b. 
});

Assuming that b.js exists and exports a single property 'one', you will get no completions on 'b.'. 

The reason for this is that during the parse when we try to recover from the incomplete statement 'b.', the ArrayExpression argument for the define call ends up having no entries - so the inferencing engine does not know to look up and map b.js

If you modify the snippet slightly to be:

define(['b'
], function(b) {
	b.
});

it works as expected.
Comment 1 Michael Rennie CLA 2017-06-27 13:25:27 EDT
This is working as designed as per https://github.com/ternjs/acorn/issues/199, but now that we have our own parser plugin, we can try to do better (and perhaps push back any fix we come up with back to Acorn as a PR).
Comment 2 Eclipse Genie CLA 2017-06-27 16:50:03 EDT
GitHub Pull Request 92 created by [mrennie]
https://github.com/eclipse/orion.client/pull/92
Comment 3 Michael Rennie CLA 2017-07-06 15:07:23 EDT
Code is merged.