[TxMt] Re: Help funding my TextMate 2 code sprint
Jacob Carlborg
doob at me.com
Mon Mar 25 19:30:41 UTC 2013
On 2013-03-25 19:00, Peter Geil wrote:
> What do you mean exactly? Offering an API so that Dialog2 can be used from other applications, too?
No, I mean that currently TextMate uses its own lexer and parser to do
syntax highlight, autocompletion and similar features. For example, the
autocompletion is very simple, it just cycles through all symbols in the
current file matching what the user has already typed.
Instead we could create an API which allows TextMate to call external
libraries, think libclang, to get autocompletion and the syntax
highlight. This would allow for a accurate autocompletion based on the
current symbol. This would be implemented as a plugin for TextMate using
a common API making it possible to add this for any language.
Example:
struct FooBar
{
int bar
char* foo;
};
FooBar f;
int i = f.|
"|" would be the position of the cursor. When performing autocompletion
here TextMate would call libclang, via some API, to the get
autocompletion. The result would not contain all symbols in the file,
instead it would only contain symbols that would be legal according to
the current language and context. In this case "bar" and "foo". Or
possibly only "bar" since "i" is declared as "int".
Other features that could take advantage of this is:
* Go to definition
* Outline "view"
* Show generate documentation
--
/Jacob Carlborg
More information about the textmate
mailing list