Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331502 - [content assist] Code assist not adding function arguments when the function is declared in another file
Summary: [content assist] Code assist not adding function arguments when the function ...
Status: REOPENED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows Vista
: P3 normal with 1 vote (vote)
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-01 02:01 EST by Mauro Molinari CLA
Modified: 2013-07-11 02:54 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Molinari CLA 2010-12-01 02:01:07 EST
STEPS TO REPRO
1. create a JavaScript project with two source folders, src1 and src2
2. in src1 create test1.js and type in the following:

function test(arg) {
}

tes| <= invoke code assist here

3. in src2 create test2.js and type in the following:

tes| <= invoke code assist here

EXPECTED BEHAVIOUR
In both cases (2. and 3.) the code assist should propose to call the "test" function defined in sr1/test1.js with an argument:

test(arg)

OBSERVED BEHAVIOUR
In case 2. things work well. In case 3. (that is, when I try to call the "test" function from another file) the code assist proposes to call that correct function, but without any arguments!

test()

I consider this a major loss of functionality.
Comment 1 Mauro Molinari CLA 2010-12-01 02:04:01 EST
I don't know if this is related in some way to Bug #324690.
Comment 2 Chris Jaun CLA 2010-12-02 14:08:41 EST
Changing the severity back to normal, as it does not meet the definition of critical (crashes, loss of data, severe memory leak.)

This is probably a duplicate of an existing bug. We'll take a look.
Comment 3 Mauro Molinari CLA 2010-12-05 06:13:21 EST
Increasing to major, at least... code assist not working is a major issue for me, especially in such common scenarios...
Comment 4 Nitin Dahyabhai CLA 2011-04-27 23:28:35 EDT
For step 3, was test1.js also open in an editor?
Comment 5 Mauro Molinari CLA 2011-05-03 06:41:57 EDT
(In reply to comment #4)
> For step 3, was test1.js also open in an editor?

It doesn't matter if test1.js is open or not in an editor, the result is the same.
Comment 6 Mauro Molinari CLA 2011-05-03 06:43:26 EDT
I removed the needinfo keyword, let me know if I shouldn't do.
Comment 7 Chris Jaun CLA 2013-07-10 11:42:08 EDT
This is working correctly now in WTP 3.5. The args show up in both cases.
Comment 8 Mauro Molinari CLA 2013-07-11 02:54:34 EDT
I don't think the current behaviour is right.

What I see now is the following. If I invoke code assist from test1.js, these are the suggestions I get:

- test(arg) void - /MyProject/src1/test.js
- test(arg) void - /MyProject/src1/test.js

(that is, two identical proposals... why?)

If I invoke code assist from test2.js, these are the suggestions I get:

- test(String string) Boolean - RegExp
- test(String string) Boolean - RegExp
- test(String string) Boolean - RegExp

(that is, three identical proposals; the first two have a green circle, as for public methods in Java editor, the last one has a blue triangle, as for package-friendly methods in Java editor; the last proposal only appears if I leave a last line in test1.js with an incomplete "tes" invocation)

Apart from the multiplication of proposals, I don't think the proposals I get in test2.js are related to what I have defined in test1.js!