Currently in TextMate, it’s possible to implement completion using a bundle command. This can be invoked using a keyboard shortcut. Some IDE’s have implemented something like dot completion, that is, when a dot is typed the dot will be inserted in the text and a completion list will be shown. Some editors will even show this completion list for most characters that are typed.
In TextMate it’s possible to set the key equivalent of a bundle command to a dot, the problem is that the dot will then not be inserted in the text. It’s also possible to manually write out a dot in the bundle command. The problem with that is that the dot is not actually in the text buffer when accessing it in the bundle command. This will most likely not work because whatever is parsing the source code to generate the completion expects the dot to actually be there.
Is this something that can be implemented in TextMate, perhaps as a semantic class? Ideally it should be configurable to support any character, ideally more than one. Example, for many languages a dot is what’s needed, but for the C, C++ and Objective-C an arrow (->) would be necessary as well. Just to be clear, I’m only talking about a new way to trigger a bundle command, not implementing the actually completion.
On 24 Jan 2017, at 3:24, Jacob Carlborg wrote:
In TextMate it’s possible to set the key equivalent of a bundle command to a dot, the problem is that the dot will then not be inserted in the text. It’s also possible to manually write out a dot in the bundle command. The problem with that is that the dot is not actually in the text buffer when accessing it in the bundle command. This will most likely not work because whatever is parsing the source code to generate the completion expects the dot to actually be there.
One could do the completion command separately, then a macro that inserts a dot and run the completion command.
Is this something that can be implemented in TextMate, perhaps as a semantic class? Ideally it should be configurable to support any character, ideally more than one. Example, for many languages a dot is what’s needed, but for the C, C++ and Objective-C an arrow (->) would be necessary as well. Just to be clear, I’m only talking about a new way to trigger a bundle command, not implementing the actually completion.
I do have a note about supporting “trigger patterns” which would allow this, these would be basic regular expressions, so you could also have a command trigger on certain “behaviors”, but the use-case list I have for this feature is very limited (despite sounding powerful), which means it’s not that high on my list, but it is there.
On 3 feb 2017, at 11:27, Allan Odgaard mailinglist@textmate.org wrote:
I do have a note about supporting “trigger patterns” which would allow this, these would be basic regular expressions, so you could also have a command trigger on certain “behaviors”, but the use-case list I have for this feature is very limited (despite sounding powerful), which means it’s not that high on my list, but it is there.
Hmm, not sure I follow. Could you please expand on this and perhaps provide an example?