Custom autocompleter and periods (.)

后端 未结 3 764
天命终不由人
天命终不由人 2021-01-02 18:10

I can\'t seem to make getCompletions function to trigger in my custom completer when using custom prefix extraction regex identifierRegexps

Basica

相关标签:
3条回答
  • 2021-01-02 18:31

    Modifying the language_tools.js file is not a good solution, you can adjust the regex pattern by calling the method getCompletionRegex:

    editor.getCompletionRegex = () => /[a-zA-Z_0-9.\$\-\u00A2-\uFFFF]/;
    
    0 讨论(0)
  • 2021-01-02 18:36

    In the ext-language-tools.js file,

    Replace var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/;

    to

    var ID_REGEX = /[a-zA-Z_0-9\.\$\-\u00A2-\uFFFF]/;
    

    With the above ID_REGEX the autocomplete will now trigger on periods (.)

    0 讨论(0)
  • 2021-01-02 18:50

    Managed to solve it by modifying the ID_REGEX var in language_tools.js.

    0 讨论(0)
提交回复
热议问题