Re: [code] Getting more juice out of ctags

From: Mitchell <m.att.foicica.com>
Date: Wed, 30 Apr 2014 22:16:36 -0400 (EDT)

Hi Carlos,

On Tue, 29 Apr 2014, Carlos Pita wrote:

> 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.

I like this idea and would accept a patch.

> 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
> complete().

I'd prefer this to be an option, like `sense.always_show_globals` for
consistency. I would likely accept a patch for that; I think it's a very
reasonable suggestion. Do you have a particular preference for an optional
argument though?

Cheers,
Mitchell

-- 
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 Wed 30 Apr 2014 - 22:16:36 EDT

This archive was generated by hypermail 2.2.0 : Thu 01 May 2014 - 06:44:16 EDT