[Geany-Devel] [FT-plugins] Proposed "Features"

Thomas Martitz kugel at xxxxx
Thu Sep 1 08:55:57 UTC 2016

Am 01.09.2016 um 07:47 schrieb Matthew Brush:
> On 2016-08-31 10:08 PM, Thomas Martitz wrote:
>> Am 31.08.2016 um 17:26 schrieb Lex Trotman:
>>>> I think we all agree that help of language-specific plugins is
>>>> desired/required. No need to restate "we need language specific
>>>> support" all
>>>> the time.
>>>> We just disagree on how the language-specific knowledge is
>>>> transported to
>>>> Geany, other plugins and the user.
>>> Well, I read your previous comments such as "But *just* the data,
>>> don't offload very specific use cases onto them" (and to some extent
>>> this one too) as saying that all the plugin has to do is return some
>>> data (tags) and Geany will take it from there and all I was doing was
>>> making sure it was clear that its unlikely that Geany will be able to
>>> "take it from there" in any meaningful way, based purely on data,
>>> without filetype specific knowledge inside Geany.
>> Here we disagree. I think it is possible to extent TM/Geany sufficiently
>> to encode this information in generic ways. As an example, template
>> instantiation yields different types. TM could tread them as different
>> types. Any variable will be of one of the types, so calltips would just
>> work.
> Let's use the simplest C example:
>     gint x = g_...
> Please describe the algorithm (just in prose) that would give only the 
> valid completions (ie. would compile in a C compiler) for `g_...` 
> without providing any impossible completions, and without knowing 
> anything about C/C++/Obj-C.

Do you suggest the completion list would only contain function that 
return gint?

This is not what I would want. I can remember function names but not 
necessarily their exact return value. It's possible (even likely) that I 
got gint wrong and correct it to glong after auto completion, when the 
call tip for the completed function tells me that glong. It'd be 
annoying if auto-completion can't find the function I want just because 
I misremembered the return type and the thing tries to be too smart.

So, as for the algorithm, I'd really stick to prefix matching, as done 
currently. Everything else assumes that I coded everything correctly 
which is not always the case. I don't want to be auto completion to be 
too smart and hide wanted functions.

As Colomban and Jiri also mentioned it: auto-completion is also a useful 
tool for correcting typos and other programming errors.

>>> [...]
>> My TM query interface wants to return all matching tags, including those
>> found by ft-plugins. Can this be done?
> There's no reason an API couldn't be provided to query such 
> information even from ft-plugins, for ex.
>    void query_symbols(criteria, out_tags_list);
> Geany doesn't have to know every tag in order to call into ft-plugins 
> for such query results, and can even fallback to TM/ctags if no 
> plugins support this feature. 

Okay. Might as well pass the tags to Geany in the first place but it's 
important to make them available at all.

Best regards.

More information about the Devel mailing list