Code Completion, ExtJS and functions

Bug Reports and Fixes
Post Reply
Gary
Posts: 18
Joined: Fri May 30, 2008 5:57 pm

Code Completion, ExtJS and functions

Post by Gary » Sun Jun 01, 2008 9:12 pm

I'm using ExtJS to load my own js files into a project. I'm not sure if this is a bug or a "feature" but for some reason, code completion is not working on functions that return an existing object. Here is a very simple example of an external file...

Code: Select all

/**
 * @type {A}
 */
A = {
   gotA : true
};
/**
 * @type {B}
 */
B = {
   gotB : true
};
/**
 * @return {C}
 */
C = function ( ) {
   this.gotC = true;
};


myTest = {
	/**
	 * @type {A}
	 */
	a : A,
	/**
	 * @return {B}
	 */
	b : function( ) {
		return B;
	},
	/**
	 * @return {C}
	 */
	c : function( ) {
		return new C();
	}
}
And here is what happens on project files...

Code: Select all

myTest.a.| //cursor... works
myTest.b( ).| //cursor... doesn't work
myTest.c( ).| //cursor... works
If I import the file directly into another js page with @include rather than rely on ExtJS, then code completion works as expected. The only problem seems to be when going through ExtJS. Again, not sure if this is a feature or a bug but thought I'd throw it out here.

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Post by eric_suen » Mon Jun 02, 2008 1:56 am

I think this issue is same as this one: viewtopic.php?t=504

Gary
Posts: 18
Joined: Fri May 30, 2008 5:57 pm

Post by Gary » Mon Jun 02, 2008 4:31 pm

Eric, it may very well be the same base issue as the other reported bug but the symptoms are different. In the other case it seems that a method parsed through JQuery was showing the wrong return type. In my case, the return type is correct but code completion/suggestion fails...

Code: Select all

myTest.|
with the cursor after the "." shows a list of available objects. Scrolling though the list everything shows as it should. Highlighting the "a" property of myTest shows @tpye{A}, highlighting the b function shows b() Returns {B} and highlighting the c function shows c() Returns {C}. It is only after selecting b() that code completion fails and nothing is suggested.

Again, may be the same underlying issue but the presentation is different.

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Post by eric_suen » Tue Jun 03, 2008 2:52 pm

This is a small issue of the code assist, I will fix it in next version.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests