[txmt-dev] Re: Integrate code completion

Simon Gregory simon at helvector.org
Mon Sep 16 12:15:45 UTC 2013


Hello Jacob,

A long time ago I got auto completion working for ActionScript 3 in TextMate. There's a short blog post about it here: http://blog.simongregory.com/09/as3-autocompletion-in-textmate/ and it shows that what you're after is possible. 

This http://git.io/PvPjSg command is where it all starts. You can get the current file and cursor position from TM env vars. However you may need to write something to find the include paths. If R has strong conventions then you can start with those. If not having the user specify them in a config file - i.e. the .tm_properties file would work.

Hope this helps.

Cheers,
Simon


On 15 Sep 2013, at 15:58, Jacob Carlborg <doob at me.com> wrote:

> Recently a tool which does code completion for the D programming language was released. I'm thinking about integrating that with TextMate. For that I have a couple of questions.
> 
> I'm trying to figure out if I should implement it as a bundle command or an plugin. I'm hoping a bundle command will be sufficient, at least as a first step.
> 
> The tool uses a client-server architecture. It needs three things to work:
> 
> * The the file in which the code completion is triggered
> * The position of the cursor, in UTF-8 code units (bytes).
> * A list of directors containing include paths
> 
> A. Is this information possibly to get from a bundle command?
> 
> B. I think the user need a way to specify include paths. This is for the standard library and possibly other projects. Can the .tm_properties file be used for this?
> 
> When it comes to presenting the result for the user I would like to show some kind of list (like a context menu) with the result. When the user picks a result from the list I would like it to insert the method name including the parameter names making it possible to tab between parameters. This is just like how snippets can work.
> 
> C. Is this possible?
> D. Can I include icons in the list, to indicate methods, variables and so on?
> 
> If necessary I can make changes both to the tool and TextMate. But I'm wondering what's possible without doing that first.
> 
> -- 
> /Jacob Carlborg
> 
> _______________________________________________
> textmate-dev mailing list
> textmate-dev at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate-dev



More information about the textmate-dev mailing list