Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Feature/Bug JS Code assist(JS code assist does not identify classes properly when they are defined and used in certain ways)
Feature/Bug JS Code assist [message #540842] Thu, 17 June 2010 09:17 Go to next message
No real name is currently offline No real name
Messages: 2
Registered: June 2010
Junior Member
Hi, I'm new to WTP so im unsure wether the behaviour I'm seeing is as intended and just not what i expected or as a result of a bug or poor setup on my part. Cosider the following exampleclass:

function Bob()
{
        this.Name = "Bob";
}


If in the same file i do one of var a = new Bob() or Bob.somefield = "some value"; The code assist identiies the class Bob and then using it from any file i get code assist help.

If however I move the new Bob or assign field statement to a different file Bob is no longer identified as a class in its file and i no longer get code assist in the new file.

Is there anyway to force code assist to identify the class without doing any of "change how the class is written in the firstplace", "create a new spurious field outside the constructor" or "create a spurious instance of the class in its file".

The background to this is I've just been handed a large standalone JS library to maintain at work. Code assist would be a huge help to save me constantly looking up variable and methods but i cant substantialy rewrite the library to achieve this. Although adding a tag to each class (for example) would be possible.

Thanks for your time and for any assistance,
Chris
Re: Feature/Bug JS Code assist [message #550641 is a reply to message #540842] Tue, 03 August 2010 21:38 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2235
Registered: July 2009
Senior Member
On 6/17/2010 9:17 AM, TMMlhVUtqv5sb7cn@dontgoto.onlatedotcom.info wrote:
> Hi, I'm new to WTP so im unsure wether the behaviour I'm seeing is as
> intended and just not what i expected or as a result of a bug or poor
> setup on my part. Cosider the following exampleclass:
>
>
> function Bob()
> {
> this.Name = "Bob";
> }
>
>
> If in the same file i do one of var a = new Bob() or Bob.somefield =
> "some value"; The code assist identiies the class Bob and then using it
> from any file i get code assist help.
>
> If however I move the new Bob or assign field statement to a different
> file Bob is no longer identified as a class in its file and i no longer
> get code assist in the new file.
>
> Is there anyway to force code assist to identify the class without doing
> any of "change how the class is written in the firstplace", "create a
> new spurious field outside the constructor" or "create a spurious
> instance of the class in its file".
>
> The background to this is I've just been handed a large standalone JS
> library to maintain at work. Code assist would be a huge help to save me
> constantly looking up variable and methods but i cant substantialy
> rewrite the library to achieve this. Although adding a tag to each class
> (for example) would be possible.
>
> Thanks for your time and for any assistance,
> Chris

Are you on the latest release and in a JavaScript project's Source folder?

--
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:How to set up a virtual host website with Tomcat6
Next Topic:Could not publish server configuration: null
Goto Forum:
  


Current Time: Fri Jul 25 23:15:01 EDT 2014

Powered by FUDForum. Page generated in 0.02218 seconds