[Geany-devel] Scope completion fix/reimplementation

Colomban Wendling lists.ban at xxxxx
Sat Mar 24 01:09:32 UTC 2012

Hi guys,

I re-implemented scope completion some time ago and it seems to work
quite OK, at least far better than the current TM stuff that seem to
provide random results -- when it provides some.

I already posted the patch in the "C++ Symbols problem", but it's here
again, since I want you to take a look at it.

So.  I'm wondering if you have some comments and/or options on the
patch, and if you think that I should commit it as at least an interim
solution until we get some working replacement for TM [1].

Known issues (they were already present in previous implementation BTW):

 * "::" triggers the same as "->" or ".", e.g. it fetches completions
for a variable name, not a class name.  This should be quite easy to fix
(if we can assume "::" always completes a type name).

 * Currently only a single word is used to get the scope.  E.g., if
typing "foo.bar.baz", only "baz" is used to find what the user wants to
complete.  This works completely fine if there is only possible
candidate for "baz", but if there are multiple candidates, using the
previous scoping could help to find out which one is the right one.
   Normally the attached implementation does a fair job at guessing what
is the right thing to complete, but it still can't read your mind --
that could even be blank, sigh.

 * We only parse global variables in many languages, so scope completion
for local variables will probably not work -- though it works for
sub-members, like "local.member.foo".

So.  I'm now waiting for your replies :)


[1] because I don't think anybody understands the TM code anymore, and
it has some flaws we can't fix -- this one for example
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-First-attempt-at-fixing-scope-completion.patch
Type: text/x-diff
Size: 6938 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20120324/118d7612/attachment.patch>

More information about the Devel mailing list