Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (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 13:17 Go to next message
No real name is currently offline No real nameFriend
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] Wed, 04 August 2010 01:38 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4434
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 Web Tools Platform
Previous Topic:How to set up a virtual host website with Tomcat6
Next Topic:Could not publish server configuration: null
Goto Forum:
  


Current Time: Sat Apr 20 03:13:57 GMT 2024

Powered by FUDForum. Page generated in 0.02808 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top