[Geany-devel] question about templates

Enrico Tröger enrico.troeger at xxxxx
Wed Jul 8 22:45:46 UTC 2009


On Sun, 5 Jul 2009 21:00:57 +0200, Andreas wrote:

>On Sun, 5 Jul 2009 19:17:10 +0200
>Enrico Tröger <enrico.troeger at uvena.de> wrote:
>> So, fixing this means to fix the code which determines the current
>> scope which is not completely trivial but surely possible.
>> Have a look at symbols_get_current_function(), the code uses
>> information from Scintilla and from tagmanager to determine the
>> scope.
>
>I see. Functions in haxe always start with:
>
>function name_of_function(function_params) {
>
>So it shouldn't be too difficult to track them.
>
>I think the parse_cpp_function_at_line-function which is probably used
>for haxe doesn't work because the styles in haxe appear a bit strange.
>"function" is listed in keywords under primary and I'd expect
>SCE_C_IDENTIFIER for it (which should make the parse_cpp-function work)

Nah, "function" is a keyword, not an identifier. The function name
instead is indeed an identifier (and without having checked it, I
guess the lexer defines the function name also as identifier).


>but its style is SCE_C_WORD.
>Any normal text is styled as SCE_C_IDENTIFIER on the other hand.
>The keywords in secondary are styled as SCE_C_WORD2.

"secondary keywords" (=2) is styled with the keyword style 2
(SCE_C_WORD2), so yes, this is intentional even though defined by
Scintlla, see below.


>Is this intentional? And where is this set?
>I had a look at highlighting.c but I don't understand where you set
>which keywords get which style ... 

This is all done and defined by the Scintilla lexer in use, in this
case LexCPP.cxx.


That all being said, it might still be that the code in
parse_cpp_function_at_line() might need some tweaking for Haxe or maybe
other places in Geany. I didn't really have a look yet.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20090709/b651bfb8/attachment.pgp>


More information about the Devel mailing list