On 10 Jul 2016, at 13:53, Louis Abraham wrote:
If I type : (define ab-cd€ 23) ab And press [esc], then the whole name appears. Nevertheless, if I try with ab-, then the completion doesn't trigger. So far I experienced, I works only after alphanumeric characters.
Thus, there are two strange behaviours :
- The entity scopes don't seem to affect autocompletion. Then, what
is the recommended manner to solve my main issue ? Can I capture the function name in both selectors (entity and variable) ?
What you can do is set a characterClass for the entity scope.
For example in the bundle editor create a new settings item and make the scope selector be `entity.name.function.scheme` and the actual value something like: `{ characterClass = 'variable'; }`.
Now TextMate will treat all contiguous characters matched as `entity.name.function.scheme` as a single word for the purpose of word selection, completion, etc.
- Why can't the autocompletion be triggered after a non alphanumeric
character ?
This is because TextMate only completes “words”, however, as you can define what constitute a word, you can include the dash.
For example if you do the above setting then escape will complete _if_ the dash is used in a place where it is matched as `entity.name.function.scheme`.
There is also the ability to simply make the dash a word character for the `source.scheme` scope, this would also be done by a bundle setting but one that is scoped to `source.scheme` and contains `{ wordCharacters = '-'; }`.