[Geany] How to define autocomplete trigger and question about calltip appearance

Lex Trotman elextr at xxxxx
Mon Feb 27 07:34:34 UTC 2012


On 27 February 2012 17:59, klo uo <klonuo at gmail.com> wrote:
> I would appreciate assistance by some Geany developer here. I wasn't
> able to resolve this, and as mentioned I don't know C/C++
>
>
> 1. Is this Geany bug?
>
>  - I set word characters in filetypes definition file to include .
> (dot) as word character, and at the same time
>  - I removed . (dot) from whitespace characters, and at the same time
>  - I disabled "preferences > various: use_gtk_word_boundaries" setting
>
> Resulting in no change.
>
>  - None of Geany 'tags' files contain . (dot)
>

Whese settings won't affect tag parsing AFAIK, as I said before I
think tag parsers are mostly hard coded.  The use of the dot is
usually part of the language syntax and not considered part of an
identifier.  What language are you making tags for?

>
> 2. Word characters in Geany are defined in 'editor.h:30':
>
> ++++++++++++++++++++++++++++++++++++++++
> /** Default character set to define which characters should be treated
> as part of a word. */
> #define GEANY_WORDCHARS                                 "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
> #define GEANY_MAX_WORD_LENGTH                   192
> ========================================
>
> This is obviously far from smart way to change word definition


This is just the default, it can be overridden by various settings, eg
in filetypes files, but you did set that anyway.

>
>
> 3. In SciTE calltips word definition is defined in 'SciTEProps.cxx:1015':
>
> ++++++++++++++++++++++++++++++++++++++++
> calltipWordCharacters = FindLanguageProperty("calltip.*.word.characters",
>    "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
> ========================================
>
> How they communicate to Scintilla, I'm unable to find, but I guess
> it's call to ScintillaBase.cxx
>
> In SciTE calltips word characters can be defined in properties file
> separately then common word character definitions
>

Scintilla settings don't affect the tag parsers anyway, unless Geany
happens to send the same setting to both which is rare.

>
> 4. Most obvious place where this can be set in Geany seems to me 'editor.c' file
>
>
> So I would like to ask my main question - what do I need to change in
> 'editor.c' (presumably) so that Geany treats .(dot) as word character
> only for calltips?
>

I doubt it is that simple, as I said above most tag parsers don't
consider dot to be an identifier character so you won't get tags with
dots in them.  The changes you have made to date should let Geany
decide that the thing it wants to autocomplete has a dot in it, but
that doesn't matter if the tag parser doesn't consider a dot to be a
word character.  It won't output tags with dots in them and so looking
up tags with dots will never find anything.

As I said before the "right" way might be to figure out how to use the
scope feature of tag files.  But there are bugs in the scope lookup
anyway and I don't think it works well outside of the C filetype for
which it was invented.

Cheers
Lex



More information about the Users mailing list