Hi,
I'm using TextMate 2.0-beta.8 on OS X 10.11.1 with v3.2.1 of the Go bundle from: https://github.com/syscrusher/golang.tmbundle
When I type "fmt." and press Option+Escape for code completion, it uses TextMate::UI.complete with the :case_insensitive => false option.
That didn't seem ideal to me. All exported identifiers in Go begin with a capital letter, but in terms of filtering, I would expect lowercase "p" to filter to Print just as well as an uppercase "P".
So I modified the bundle, and then I saw why it is set the way it is.
In the completeAndInsertSnippet method of TMDIncrementalPopUpMenu.mm there is a line that inserts the text being used for filtering rather than the text from the choices.
insert_text([candidateMatch substringFromIndex:[[self filterString] length ]]);
The result is that fmt. [option+esc] [p] and pressing [Enter] gives me:
fmt.print
rather than the desired:
fmt.Print
I'm not really sure why it's done this way? Are there situations where people want their filtering keys over the text present in the menu?
While I'm talking about code completion, and to drive the point home, I noticed that TMDIncrementalPopUpMenu uses a BEGINSWITH predicate. Ideally it would use a fuzzy match with similar logic to Go To File... That would allow typing something like:
fmt. [option+esc] [p] [l]
to get Println from the list of candidates. In this case it becomes obvious that "pl" is only for filtering and should not be inserted.
Finally, it would be great if it was possible to set an (additional) Key Equivalent with a delay so that the popup menu came up when pressing ".", or perhaps something more sophisticated based on the language grammar. I realize that not everyone likes code completion popups automatically appearing, but it would be nice to at least have the option.
Thanks, Nathan.
On 21 Nov 2015, at 19:58, Nathan wrote:
[…] The result is that fmt. [option+esc] [p] and pressing [Enter] gives me:
fmt.print
rather than the desired:
fmt.Print
I'm not really sure why it's done this way? Are there situations where people want their filtering keys over the text present in the menu?
This is a technical limitation of the dialog plug-in.
Right now, it can only insert new text, not change existing text.
So whatever the user typed (which is used as filter string), it leaves in the document, which does make the case-insensitive mode a bit useless when it’s only meant for the filter string.
While I'm talking about code completion, and to drive the point home, I noticed that TMDIncrementalPopUpMenu uses a BEGINSWITH predicate. Ideally it would use a fuzzy match with similar logic to Go To File... That would allow typing something like:
This runs into the same limitation that the filter string is actually typed into the document and the dialog plug-in cannot change that.
In theory we could of course improve things, but it’s a non-trivial change.
Well alright. Thanks for the reply.
For now I just jump between different editors. TextMate is working well for my writing, where things like code completion isn't as valuable.
Nathan.
On 10 January 2016 at 15:51, Allan Odgaard mailinglist@textmate.org wrote:
On 21 Nov 2015, at 19:58, Nathan wrote:
[…] The result is that fmt. [option+esc] [p] and pressing [Enter] gives me:
fmt.print
rather than the desired:
fmt.Print
I'm not really sure why it's done this way? Are there situations where people want their filtering keys over the text present in the menu?
This is a technical limitation of the dialog plug-in.
Right now, it can only insert new text, not change existing text.
So whatever the user typed (which is used as filter string), it leaves in the document, which does make the case-insensitive mode a bit useless when it’s only meant for the filter string.
While I'm talking about code completion, and to drive the point home, I
noticed that TMDIncrementalPopUpMenu uses a BEGINSWITH predicate. Ideally it would use a fuzzy match with similar logic to Go To File... That would allow typing something like:
This runs into the same limitation that the filter string is actually typed into the document and the dialog plug-in cannot change that.
In theory we could of course improve things, but it’s a non-trivial change.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate