This means (IMHO):
*) Develop a plugin (maybe it's better to have another BaseCompleter-derived?)
*) Query Editra Plugins manager for the currently registered plugins
*) Query the Projects plugin (if available) and obtain current project base
directory
*) Launch ctags/global/whatever and save tags file in the project base directory
*) React to some keypress and search the tags file for the current symbol
Suggestions? I'd like to architect the whole stuff in "the right way".
--
Giuseppe "Cowo" Corbelli ~\/~ My software: http://cowo.yoda2000.net
-<! Non c'e' niente da dire in proposito. Tutto quello che uno deve fare e'
colpire i tasti giusti al momento giusto, e lo strumento suona da solo. !>-
J.S. Bach
On Mon, Feb 6, 2012 at 8:05 AM, Giuseppe Corbelli <cow...@gmail.com> wrote:
> Hi
> I'd like to develop an autocompleter based on
> http://ctags.sourceforge.net/
> and/or
> http://www.gnu.org/software/global/
>
> This means (IMHO):
>
> *) Develop a plugin (maybe it's better to have another BaseCompleter-derived?)
Plugin is more appropriate for this. You simply need to create a
plugin that implements the 'AutoCompI' interface (defined in
iface.py). That returns your custom class derived from
autocomp.BaseCompleter.
There may be some short comings to this interface as it expects to
register with given single filetype. May have to add a generic ANY
identifier if you want the plugin to be associated with multiple or
all filetypes. But to get started I would suggest just focusing on one
filetype and we can work to enhance the interface as its limitations
are found. Didn't have much time to look at the moment but may need
additional extensions to make things more flexible in regards to file
types.
> *) Query Editra Plugins manager for the currently registered plugins
What would this be needed for?
> *) Query the Projects plugin (if available) and obtain current project base
> directory
Some sort of generic (ed_msg) interface would have to be added to the
Projects plugin to support this. Could be done without much difficulty
but in all honesty I have been considering not maintaining that plugin
anymore and moving to a new platform based on project component I have
been working on for the PyStudio plugin.
> *) Launch ctags/global/whatever and save tags file in the project base directory
Would suggest that the plugin adds some configuration (through the
plugin configuration interface) to configure this and could also be
used as a way around having to use the Projects plugin since the user
could specify the project directory and where to output the tags
file(s) and also when to run the tag generation.
> *) React to some keypress and search the tags file for the current symbol
>
This should already be doable through the current BaseCompleter
interface. Your subclass can specify what characters are special
characters and there is also user definable shortcuts for showing
autocompletion hints (i.e Ctrl+Space).
> Suggestions? I'd like to architect the whole stuff in "the right way".
>
Think I covered it above but there are also a fair amount of
documentation about the interfaces available on the website. After the
next release there will be even more enhanced API documentation as I
have done more work on the api documentation since the last release of
Editra.
Cody
Already done this (since it's REALLY simple :-)
> There may be some short comings to this interface as it expects to
> register with given single filetype. May have to add a generic ANY
> identifier if you want the plugin to be associated with multiple or
> all filetypes. But to get started I would suggest just focusing on one
> filetype and we can work to enhance the interface as its limitations
> are found. Didn't have much time to look at the moment but may need
> additional extensions to make things more flexible in regards to file
> types.
Yeah, well, time may come for this.
>> *) Query Editra Plugins manager for the currently registered plugins
>
> What would this be needed for?
>
>> *) Query the Projects plugin (if available) and obtain current project base
>> directory
>
> Some sort of generic (ed_msg) interface would have to be added to the
> Projects plugin to support this. Could be done without much difficulty
> but in all honesty I have been considering not maintaining that plugin
> anymore and moving to a new platform based on project component I have
> been working on for the PyStudio plugin.
I've seen it in the SVN. But I don't want it to be limited to Python.
>> *) Launch ctags/global/whatever and save tags file in the project base directory
>
> Would suggest that the plugin adds some configuration (through the
> plugin configuration interface) to configure this and could also be
> used as a way around having to use the Projects plugin since the user
> could specify the project directory and where to output the tags
> file(s) and also when to run the tag generation.
In theory, yes. In practice I don't see the point. IMHO:
*) I just want this autocomp in "projects", not for single "orphan" files. For
orphan files I use scite, which has a faster startup.
*) Tag "databases" should be different for each project
*) I don't care where the databases are, just keep them in the project root
directory
>> *) React to some keypress and search the tags file for the current symbol
>>
>
> This should already be doable through the current BaseCompleter
> interface. Your subclass can specify what characters are special
> characters and there is also user definable shortcuts for showing
> autocompletion hints (i.e Ctrl+Space).
Confirmed. No need to change anything here.