[code] Getting more juice out of ctags

From: Carlos Pita <carlosjosepita.att.gmail.com>
Date: Tue, 29 Apr 2014 10:10:21 -0300

Hi all,

after some thought I've come to two simple ideas about extending
adeptsense to cover a couple of popular uses of ctags. Here is the
(backwards compatible) proposal, please let me know what do you think
or whether there is already a textadept way to get the same.

1) Add an (optional) symbol parameter to goto_ctag, with the same
semantics than the symbol parameter of get_completions. If there
happens to be only one completion for the given symbol prefix, just
jump to its definition without showing the menu. Lastly, provide a
default key binding to call goto_ctag passing the symbol under cursor.
This way the simple goto_ctag will subsume a lot of vim ctags arcana
without the steep learning curve and drudgery.

2) Add an everything parameter (optional, defaulting to false) to
get_completions. If this parameter is true the completion won't be
contextual but return every tag that matches the symbol and the
fields/functions filters. This acknowledges a sad reality: often
(specially with duck typed languages) even the most sophisticated type
inference mechanism fails and a fuzzy completion list may be better
than nothing. Notice that this is different from the global
completions fallback textadept already implements because everything >
global. In order to map this functionality to a more "bindable"
facility you could go the autocomplete_words() way or the complete()
way. I think adding an include_tags parameter to autocomplete_words()
will keep a clear-cut distinction between a best-effort completion
(autocomplete_words()) and a stricter one (complete()). But, of
course, you can alternatively add the everything parameter to

I guess I'll able to write a patch for both extensions if you think
they're worth the effort.

Best regards

You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 29 Apr 2014 - 09:10:21 EDT

This archive was generated by hypermail 2.2.0 : Wed 30 Apr 2014 - 06:26:52 EDT