For consideration,
The module, 'ace/autocomplete/util', in file ext-language_Tools.js, defines a regEx that is used to determine prefix matches for defined completers.
var ID_REGEX = /[a-zA-Z_0-9$-]/;
used in , exports.retrievePrecedingIdentifier
As we defined a custom completer to support our object structures (Person.Name.First etc...) this caused a problem in that ID_REGEX will not match on the dot character. This can be overridden in our custom completer but it causes the completers defined in ace/ext/language_tools to pollute our matches with the entire scope of the document.
The modification seems trivial ...
var ID_REGEX = /[a-zA-Z_0-9$-.]/;
Or rather, could the ID_REGEX be made an option for the ace/autocomplete/util mdoule?
yes, making it an option is better
I am hitting the same issue. I tried to find a neat way to customize the prefix matching but did not find something viable. Is there a solution available?
I assumed that the Tokenizer of the current mode would be used to determine the current prefix...which would allow dynamic prefix-finding rules...neat? or am I missing something? This way I could create my own mode (maybe not as trivial as I am hoping, but it would fit...right?)
Experimental support for this was added some time ago https://github.com/ajaxorg/ace/blob/badade8f4e9d10194b1f802c57cc368e5fe90688/lib/ace/autocomplete.js#L220 but i am not sure if it works well, and still might change.
Using tokenizer would work if tokenizer is written with that in mind, but many modes won't work since they assign text class to everything that isn't highlighted.
This will be helpful, can't believe auto complete works without this.
@nightwing it works (using the first item in the results array to pass the regex)
@antonpod Can you describe what you did to make it work? I opened this issue a couple of months ago.
@rsmith31415 in my case I didn't need to know the prefix before sending the Ajax request. I just needed to adjust the regex to also match dots, after the keywords were fetched.
Anyway, it doesn't work as expected, getting some weird matches which look absolutely random.
@antonpod Thank you for your response. Maybe @nightwing can share an update on the support for this feature.
@nightwing any updates on this?
Most helpful comment
@nightwing any updates on this?