[Geany-devel] Scope (struct/class) completion broken

Colomban Wendling lists.ban at xxxxx
Tue Apr 19 18:54:19 UTC 2011


Le 18/04/2011 19:12, Colomban Wendling a écrit :
> Le 18/04/2011 15:38, Thomas Martitz a écrit :
> [...]
>> Anyway, I tried it with something global and it doesn't work too. In
>> editor.c, no list at all with editor_prefs, and a wrong list with
>> editor_info.
> Hum, true. I'm investigating this, but first things I found:

Well, well, well... I still haven't found enough courage to try fixing
the tagmanager implementation (tm_workspace_find_scope_members()), but
I've finished writing another finder, which seem to work, so proving the
needed tags are here and usable.

I attach it here if anybody wants to try it, maybe it'd be helpful to
correctly fix tm_workspace_find_scope_members() -- or just replace it :D

> 1) scope completion of anonymous structs/unions got "broken" since
> r5563, because it made these anonymous have a non-unique name in the
> whole workspace (and since scope completion is based upon var type, it
> gets the completion for all who shares a name). This prehaps may be
> fixable in scope completion itself to chose only one -- and the right
> one :D -- parent.
> However a quick & dirty "fix" is to revert r5563, but it was meant to
> stop reparsing to lead to infinite increasing of the anonymous suffix.

This one should be addressed in my test attempt, by always searching the
type/typedef first in the file that holds the variable/typedef referring
to it.

> 2) if there is more than one possible candidate in the whole project for
> scope completion, the first match is taken without further care (AFAICT).

Same for this one, and I doubt we could do better... if there are name
clashes, there is a limit to the magic we can do I guess.


Note for myself: it seems that the TM is broken if we have infinite
typedef recursion (e.g. typedef a b; typedef b a;), need to fix this too.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0000-Scope-completion-fixes-WIP0.patch
Type: text/x-patch
Size: 5524 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20110419/151f0195/attachment.bin>

More information about the Devel mailing list