Problem with auto completion of my code

Get help with Spket IDE.
Post Reply
Scoox
Posts: 4
Joined: Tue Aug 18, 2009 7:00 am

Problem with auto completion of my code

Post by Scoox » Tue Aug 18, 2009 7:06 am

Hello everyone,
I just started using spket and really enjoy the program! However, I have some problems with the code completion.

I tried the following code:

Code: Select all

/**
 * Test test test
 * @class ABC
 * @extends Java.Object
 */
ABC={};
/**
 * @param {Number} a
 * @return {Number}
 */
ABC.test=
function (a){
	return(a);
};
Which works very well for auto completion - when I type ABC. in the same file, it's all right.

However, if I add the file via Window->Preferences->Spket->JS Profiles, it does not work.

I am sure I added it correctly, because I have the Ext JSB in the same profile, and the profile is active. I also tried restarting Spket, but it still did not work.



Can you help me with this? What am I doing wrong?



Kind Regards
Scoox

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

Post by eric_suen » Tue Aug 18, 2009 8:00 am

I have tried, and it works fine, is there any error in log? what is the file "workspace\.metadata\.plugins\com.spket.js\profiles.xml" looks like?

Scoox
Posts: 4
Joined: Tue Aug 18, 2009 7:00 am

Post by Scoox » Tue Aug 18, 2009 8:42 am

Hi Eric,
thank you very much - profiles.xml lead me to the error. It included the line

use namespace ExtJS;

which probably was added by Spket when I created the Ext profile. I removed it, and with the Test script it worked fine :D. I guess that is a small bug in Spket.

However, I still have some issues with my "real" code - I tried making the example very simple so that it can be easily reproduced.

The problem is, that I actually use an Ext namespace. Here is the new example code:

Code: Select all

Ext.namespace("DP");

/**
 * Test test test
 * @class ABC
 * @extends Java.Object
 */
DP.ABC={};
/**
 * Test function for code auto completion
 * @param {Number} a
 * @return {Number}
 */
DP.ABC.test=
function (a){
	return(a);
};

Knowing about the structure of profiles.xml, I tried modifying it as follows:

Code: Select all

<profile id="ExtJS" name="ExtJS">
use namespace ExtJS("Ext Base","Everything");
include 'C:\\ext-2.3.0\\source\\ext.jsb';
//use namespace DP;
Ext.namespace("DP");
include 'C:\\xampp\\xampp\\htdocs\\js\\dp_cookies2.js';
</profile>

Then I tried toggling code completion by typing
Ext.namespace("DP");
DP.ABC.

unfortunately, it did not work again. Do you have a hint for me? Thanks a lot in advance!
[/code]

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

Post by eric_suen » Tue Aug 18, 2009 11:13 am

The profile.xml has no problem, it is not javascript, you should not modify it manually.

Is your Spket IDE a standalone or plugins, maybe you should install a fresh version and try again. The code assist works fine for me.

Scoox
Posts: 4
Joined: Tue Aug 18, 2009 7:00 am

Post by Scoox » Tue Aug 18, 2009 11:45 am

Hi Eric,
I just installed the newest version yesterday and did hardly make any changes to its original configuration (I have the standalone version).

I will try to do it in Eclipse. I believe it's making problems, because I use both Ext and individual "DP" namespaces. Did you try that too, when replaying the problem?


Thanks so far



Update: In Eclipse it didn't work either. But now I added the whole folder, and some of the namespaces work. I will try to find out why some do and some don't.

Scoox
Posts: 4
Joined: Tue Aug 18, 2009 7:00 am

Post by Scoox » Tue Aug 18, 2009 12:28 pm

I found the reason :D and :shock::

I had a comment in the source code, which included a Ñ character. It turns out this Ñ disturbs Spket - if I remove it, everything's fine.

The whole comment was
// Cookies are Saved as SettingID1|value1Ñvalue2Ñvalue3|SettingID2|value1Ñvalue2 (...)


Man, that took me quite some time to figure out. Maybe you can fix that bug whenever you have time. Thanks for your answer, I really like the program :D

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

Post by eric_suen » Tue Aug 18, 2009 6:31 pm

That maybe a bug, what is your system encoding and file encoding? you can get system encoding using menu "About Spket IDE", in dialog, click "Configuration Details" button, then search for "file.encoding". and for file encoding, In "Project Explorer", select that file, open Properties page via "Atl+Enter", then choose Resource category, you can find the file encoding...

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests