Hey
I hope I'm not getting on everyone's nerves with another feature question -- can I make it work? -- or feature request -- if answer to previous is negative, can you make it work? :)
My question: can I change the order of autocomplete suggestions, between 'user defined' and 'default/document harvested'?
I have a pretty large list of my own completions, some global. Internal order of these completions seems to obey the order in which they appear on the list. Yay!
But: the document harvested completions always seem to be suggested before any of my own completions.
I know, I can entirely disable these default completions, but I use them as well, just that mostly, my own completions should take precedence.
[wishful thinking on] Any way to change the order between user completions and default/document harvested completions?
If someone can think of a way that requires messing around with some default bundle scripts: I'll happily try it, did so before. Just suggestions requiring to build my own are problematic: tried it a few times, never got it to work 100% cleanly.
Thanks for lending me your time, reading the above.
On 8 Oct 2016, at 20:36, Bert wrote:
My question: can I change the order of autocomplete suggestions, between 'user defined' and 'default/document harvested'? […] If someone can think of a way that requires messing around with some default bundle scripts: I'll happily try it, did so before. Just suggestions requiring to build my own are problematic: tried it a few times, never got it to work 100% cleanly.
It’s not possible to change the priority.
I’m not too fond of the way this completion system works (i.e. it’s not using the general TextMate customization infrastructure but instead has 3 “special” settings when it probably should just have been a regular command with “completion list” as output type, and maybe receiving the default completions on stdin), so I’m more likely to completely change the system than add new settings to tweak priorities.
Allan Odgaard-4 wrote
It’s not possible to change the priority.
I’m not too fond of the way this completion system works (i.e. it’s not using the general TextMate customization infrastructure but instead has 3 “special” settings when it probably should just have been a regular command with “completion list” as output type, and maybe receiving the default completions on stdin), so I’m more likely to completely change the system than add new settings to tweak priorities.
Makes sense. The completions are sometimes a bit odd anyway, but not sure what could be done about it.
For example, for my current (Python) file, after writing:
print(some_function(some_argument),
where my default completion list includes the following to be added (for debug prints):
"\n")
the first completion suggested in my current file instead is:
:])):
Not technically /wrong/ I guess, the combination does appear somewhere in my code, but not really the thing I'd typically want to use completion for.
But that's a result of the regex harvesting the completions, right? So only indirectly related, I guess.
-- View this message in context: http://textmate.1073791.n5.nabble.com/Order-of-suggestion-of-autocomplete-it... Sent from the textmate users mailing list archive at Nabble.com.
On 10 Oct 2016, at 18:46, Bert Zangle wrote:
[…] For example, for my current (Python) file, after writing:
print(some_function(some_argument),
where my default completion list includes the following to be added (for debug prints):
"\n")
the first completion suggested in my current file instead is:
:])):
Not technically /wrong/ I guess, the combination does appear somewhere in my code, but not really the thing I'd typically want to use completion for.
But that's a result of the regex harvesting the completions, right? So only indirectly related, I guess.
Yes, although it’s not a regexp but based on the current word prefix/suffix and everything in the document considered a “unit” with the same prefix and/or suffix.
If you can provide a simple example where it inserts non-word characters as completion candidates, feel free to share it, as this behavior does sound like something worth looking into.
Allan Odgaard-4 wrote
If you can provide a simple example where it inserts non-word characters as completion candidates, feel free to share it, as this behavior does sound like something worth looking into.
Sure. Here's two examples in Python (with lots of numpy code):
Example 1.
Autocomplete for: , suggests: ,:, (probably) from the following (commented out) line: # for j in range(len(dV1[0,:,0])):
Example 2.
Autocomplete for same character, same file: , suggests: ,:])): (probably) from the following code line: for j in range(len(m_v[0,:])):
Does that help/narrow down the problem?
To anticipate the question "Why would you ever autocomplete on comma to begin with?", the answer is, because I'd like to autocomplete: print(something, with: print(something, "\n") or maybe even: print(something, "\n", sep='') ...if I'm feeling fancy when debugging.
That's why I added: , "\n" and: , sep='' ... to my user completion list.
Not exactly a common use case I guess, and not high priority either, but, since you asked, that's the context where autocomplete suggests the non-letter completions above.
-- View this message in context: http://textmate.1073791.n5.nabble.com/Order-of-suggestion-of-autocomplete-it... Sent from the textmate users mailing list archive at Nabble.com.