Missing information in JavaScript Code Assist [message #207784] |
Wed, 30 January 2008 14:23 |
Eclipse User |
|
|
|
Originally posted by: michael.zend.com
Hi!
I'm trying to use code assist on "foo|". I have function foo(arg)
declared in another JavaScript file. What I see in proposals list is
just "foo" without argument: "arg". This is since binding mechanism
doesn't look outside of the current file. Even if I have <script
language="text/javascript" src="test2.js"> where test2.js is a file that
declares foo(arg) - I don't see whole function signature in completion
proposal, since it seems like test2.js is still not included in
CompilationUnitScope.imports.
My question is how can I make binding mechanism aware of JavaScript
"imports", like:
<script language="text/javascript" src="..."/>
Thanks!
|
|
|
|
Re: Missing information in JavaScript Code Assist [message #207955 is a reply to message #207799] |
Sun, 03 February 2008 09:59 |
Eclipse User |
|
|
|
Originally posted by: michael.zend.com
Hi Bradley,
Can you please point me to the place where included source files are
stored in the model and where import statements are parsed?
Thanks!
Bradley Childs wrote:
> Hi Michael,
>
> Your source file is being included, that's why foo() is showing up in
> content completion. The issue is that content completion doesn't [always]
> show function arguments.
>
>
> -brad
> "Michael Spector" <michael@zend.com> wrote in message
> news:fnq18m$br2$1@build.eclipse.org...
>> Hi!
>>
>> I'm trying to use code assist on "foo|". I have function foo(arg) declared
>> in another JavaScript file. What I see in proposals list is just "foo"
>> without argument: "arg". This is since binding mechanism doesn't look
>> outside of the current file. Even if I have <script
>> language="text/javascript" src="test2.js"> where test2.js is a file that
>> declares foo(arg) - I don't see whole function signature in completion
>> proposal, since it seems like test2.js is still not included in
>> CompilationUnitScope.imports.
>>
>> My question is how can I make binding mechanism aware of JavaScript
>> "imports", like:
>>
>> <script language="text/javascript" src="..."/>
>>
>> Thanks!
>
>
|
|
|
Re: Missing information in JavaScript Code Assist [message #208147 is a reply to message #207955] |
Mon, 04 February 2008 19:28 |
Bradley Childs Messages: 14 Registered: July 2009 |
Junior Member |
|
|
Hi Michael,
Unlike Java, the JavaScript imports aren't stored in the model. JSDT uses
the classpath mechanism from the JDT to represent JavaScript's Global Scope.
Imports are added / removed from the Global Scope.
Have a look at the JSPTranslation.java class in the
org.eclipse.wst.jsdt.web.core plugin. The imports are parsed in the
translator, stored in the translation, then passed to the
DocumentContextFragmentRoot (o.e.w.jsdt.core) for inclusion in the Global
Scope.
-Brad
"Michael Spector" <michael@zend.com> wrote in message
news:fo4398$b1p$1@build.eclipse.org...
>
> Hi Bradley,
>
> Can you please point me to the place where included source files are
> stored in the model and where import statements are parsed?
>
> Thanks!
>
> Bradley Childs wrote:
>> Hi Michael,
>>
>> Your source file is being included, that's why foo() is showing up in
>> content completion. The issue is that content completion doesn't
>> [always] show function arguments.
>>
>>
>> -brad
>> "Michael Spector" <michael@zend.com> wrote in message
>> news:fnq18m$br2$1@build.eclipse.org...
>>> Hi!
>>>
>>> I'm trying to use code assist on "foo|". I have function foo(arg)
>>> declared in another JavaScript file. What I see in proposals list is
>>> just "foo" without argument: "arg". This is since binding mechanism
>>> doesn't look outside of the current file. Even if I have <script
>>> language="text/javascript" src="test2.js"> where test2.js is a file that
>>> declares foo(arg) - I don't see whole function signature in completion
>>> proposal, since it seems like test2.js is still not included in
>>> CompilationUnitScope.imports.
>>>
>>> My question is how can I make binding mechanism aware of JavaScript
>>> "imports", like:
>>>
>>> <script language="text/javascript" src="..."/>
>>>
>>> Thanks!
>>
|
|
|
Powered by
FUDForum. Page generated in 1.33335 seconds