Using JSM and code completion

Get help with Spket IDE.
Post Reply
pennywise
Posts: 22
Joined: Thu Sep 11, 2008 2:18 pm

Using JSM and code completion

Post by pennywise » Fri Nov 28, 2008 10:35 am

In my firefox-addon I'm using JSMs (search for "Using JavaScript code modules" on developer mozilla org). I'm importing it with the line:

Component.utils.import("resource_jslibs/somefile.js");

(btw. the "import" gives me a syntaxerror in spket)
So, how do I give spket the "hint" that it has to search for codecompletion within those files?

Basically it's like a "include" or "require" in PHP.

PS: had to edit all URLs because of forum restrictions

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

Post by eric_suen » Fri Nov 28, 2008 12:54 pm

It is the limitation of the current parser that the "import" will give you a syntax error, I'm working on a new parser will support javascript 1.8.

currently Spket does not support: Component.utils.import("resource_jslibs/somefile.js"); it does not support "Component.utils.import" and it does not support "resources://" protocol, the solution is using "@include" tag in javascript comment, like

Code: Select all

/*
 * @include "somefile.js"
 */
the "@include" tag must in your first javascript comment.

pennywise
Posts: 22
Joined: Thu Sep 11, 2008 2:18 pm

Post by pennywise » Fri Nov 28, 2008 12:56 pm

that works like a charm, thx a lot

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest