Walter Cruz wrote:
As I can't find, I think that write one myself would be a good idea.
Yes, excellent idea :-)
And these are the relevant lines on my config file:
file.patterns.js=*.js
api.$(file.patterns.js).=/home/walter.cruz/.scite/javascript.api
calltip.$(file.patterns.js).end.definition=)
As scite use the cpp lexer to analize the js, I'm using this to make the
autocomplete (althoug I think that I will get this off)
autocomplete.cpp.start.characters=$(chars.alpha)
But, I'm with a doubt. By example, the getElementById is a static method
from the document object.So, the better way to do this on the api file
would be:
document.getElementById("id") Returns a reference to the first
object with the specified ID
But when I put the . (dot) in the after document, the calltip is not
displayed anymore.I've tried to put a line like this:
calltip.$(file.patterns.js).word.characters=.$(chars.alpha)
But doen't work too. How can I do that (i've seen that the lua api files
has functions with a dot inside).
As you have noticed, these functions are in whole in the api file, ie.
you have math.mod, not mod alone.
BTW, on my Lua API file, I had some commented constants, like _G,
_VERSION, math.pi and three io.stdxxx. I had to remove their comments
because SciTE, seeing no opening brace, continue to add the words from
the comment to the api list...
I tried to improve your experiments. Here are my settings:
# JavaScript and EcmaScript
file.patterns.js=*.js;*.es
filter.js=JavaScript (js es)|$(file.patterns.js)|
lexer.$(file.patterns.js)=cpp
api.$(file.patterns.js)=$(SciteDefaultHome)/JavaScript.api
calltip.cpp.word.characters=$(word.chars.cxx)
Note that I think you cannot write
calltip.$(file.patterns.js).word.characters because you have to put a
/lexer/ name, not a filepattern (see SciTEDoc).
I excluded . from the word.characters because you have to either put the
full form in the API (Math.floor) and then accept the dot (like in Lua),
or put the short form (floor), exclude the dot, but make it work for the
syntax anyIdentifier.toLowerCase().
Reformatted partially your beginning of API file to my tastes, and for
consistency:
alert([string message])
charCodeAt(int index)
concat(array1, array2[, array...]) Joins several arrays and returns a
new array
deleteRow([int rowIndex])
fromCharCode(num1[, num...]) Returns a character from the Unicode value
getDate()
getElementById(string id) Returns a reference to the first object with
the specified ID
getElementsByTagName(string tag) Returns a collection of objects with
the specified TAGNAME
floor(float x) Rounds down the float value to an integer
go(vLocation)
innerHTML(string)
join(separator) Puts all the elements of an array into a string, divided
by a specified separator
match(search) Similar to indexOf() and lastIndexOf(), but this method
returns the specified string, or null, instead of a numeric value
parseFloat(string strFloat) Converts an string to a floating point number
parseInt(string strInt, int numberBase) Converts a string argument to a
number in a specified number base (2, 8, 10, 16...)
pop() Removes and returns the last element of an array
shift() Removes and returns the first element of an array
slice(begin, end) Creates a new array from a selected section of an
existing array
sort([function]) Sorts the elements of an array, optionnally using the
provided function capable of comparing such elements
splice(index, howmany, element1[, element...]) Adds and removes elements
of an array
substr(start, howmany) Returns the specified characters. 14,7 returns 7
characters, from the 14th character (starts at 0)
toLowerCase() Converts a string to lower case
toString() Converts a boolean value to a string
toUpperCase() Converts a string to upper case
reverse() Reverses the order of the elements in an array
Beware of wrapping!
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
_______________________________________________
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest