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

Bug 490543

Summary: No content assist for express
Product: [ECD] Orion Reporter: Steve Northover <steve_northover>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P2    
Version: 12.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Steve Northover CLA 2016-03-28 16:16:26 EDT
1) Drill into org.eclipse.orion.client/modules/orionode/server.js
2) Go to line 56
3) Insert a new line and type "app."
4) Invoke Content assist
5) BUG: I don't get code assist for express

If I type in app.use2(), with cross file linting on, we are smart enough to see that this in an error.  Therefore, I expect to get content assist.
Comment 1 Michael Rennie CLA 2016-03-28 16:31:53 EDT
You have to provide express in the eslint-env directive, like so:

/*eslint-env node, express*/
Comment 2 Steve Northover CLA 2016-03-28 16:35:19 EDT
Of course you are right but I had assumed that since cross file linting can see use() versus use2(), why can't this "just work"?
Comment 3 Michael Rennie CLA 2016-03-28 17:05:20 EDT
(In reply to Steve Northover from comment #2)
> Of course you are right but I had assumed that since cross file linting can
> see use() versus use2(), why can't this "just work"?

Because of the filtering in our content assist code, which originally was put in place to avoid showing you proposals from everything under the sun. For example, say you had 30 definitions loaded, but only used one of them in the current file, this filtering would help avoid showing you a bazillion proposals for stuff you were not using. 

In the very near future this will be fixed in bug 485219, where the proper loading of plugins (and a very slick "just works" way to make sure this happens) will be used and the filtering removed.
Comment 4 Steve Northover CLA 2016-03-28 17:07:45 EDT
Ok, so cross file linting is using the full list but code assist is not?  (again use() versus use2())
Comment 5 Michael Rennie CLA 2016-03-29 09:32:44 EDT
(In reply to Steve Northover from comment #4)
> Ok, so cross file linting is using the full list but code assist is not? 
> (again use() versus use2())

Unknown member linting (use() versus use2()) does not use the list at all, it checks type information directly held by the current context (the 'no-undef-expression' rule). 

'cross file linting', as it has all become termed, is really only talking about the fact that we can resolve types across compilation units - and we have some rules that now make use of this information.
Comment 6 Steve Northover CLA 2016-03-29 11:15:43 EDT
I am using the term "cross-file linting" to mean using whatever mechanisms we have at our disposal to resolve a symbol.