Add scope completion for namespaces
commit77f6e98de8e50d0b9e270c113c8ba3b2828bbe19
authorJiří Techet <techet@gmail.com>
Sat, 16 Jan 2016 13:25:01 +0000 (16 14:25 +0100)
committerJiří Techet <techet@gmail.com>
Fri, 26 Feb 2016 00:09:59 +0000 (26 01:09 +0100)
treec175f90f142eb2c19cb70d426489b281b9ec9fa1
parent725083ffe702aa644790af11721d8845dfd2d741
Add scope completion for namespaces

Pop up scope completion dialog for namespaces too; e.g. for

boost::

show all symbols defined in the namespace. Determine whether the namespace
scope completion should be used based on whether user typed a scope
separator. If so, perform completion for namespaces before normal scope
completion - this seems to work better e.g. for Scintilla where

Scintilla::

would otherwise pop up the varible sci instead of showing everything
in the namespace (might be more questionable for languages where
the scope separator is identical to the dereference operator like
Java's "." but we have to make some choice anyway).

The performance seems to be reasonable - for the completion all tags
have to be walked but after testing with big C++ projects like
boost and Mozilla, the completion takes only something like 0.2s
which is acceptable as the delay happens only on typing the scope
completion separator and feels kind of expected.

Also tested with linux kernel sources which normally lack any scope
information by hacking TM a bit and injecting 10-character scope for
each tag - then the completion takes something over 0.5s.
src/editor.c
tagmanager/src/tm_workspace.c
tagmanager/src/tm_workspace.h