-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding '.' character to prefix matching for completers Ref- 'ace/autocomplete/util' #1670
Comments
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 Line 220 in badade8
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) |
@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. |
@AntonPOD Thank you for your response. Maybe @nightwing can share an update on the support for this feature. |
@nightwing any updates on this? |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Now as a solution for this issue custom |
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$-.]/;
The text was updated successfully, but these errors were encountered: