fannheyward / coc-texlab

TexLab extension for coc.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for Unicode LSP identifiers

Andrew15-5 opened this issue · comments

As pfoerster said in latex-lsp/texlab#864 (comment) LSP client have to support identifiers to allow autocompletion to work without constantly pressing autocompletion trigger shortcut (<C-Space>).

As I explained here latex-lsp/texlab#864 (comment) when using coc-texlab with Latin/digit characters for macro names' autocompletion "automatic update of suggested items" (i.e., dropdown menu after pressing <C-Space>) does happen. In other words, when typing macros which start with \ + "Latin/English letter", then the list of the suggested items (i.e., words/macros) does update. But when using other characters after \, e.g., Russian letters or Japanese syllables/moras (Hiragana), the automatic update of suggested items doesn't happen.

This means that client, i.e., coc-texlab doesn't consider the majority of Unicode characters as "identifiers" (probably only ASCII characters are considered as "identifiers"). Which affects the UX when using words which consist of any Unicode character excluding ASCII charset. The main problem is that user always have to trigger autocompletion action whenever they are using non-ASCII words or macros.

This can be considered a bug because some characters for coc-texlab are "identifiers" and other characters are not.

I made a quick search through the code and nothing did catch my eye (except the TextDocumentIdentifier which is either an interface or a namespace). Because there isn't much code, I'm thinking maybe the problem is with coc.nvim itself? Maybe it chooses what is an identifier and what isn't. I never work on an LSP client/server, so I don't have much knowledge other than some TypeScript.

Answer is here neoclide/coc.nvim#4564 (comment).

Set suggest.asciiMatch to false and try again.