You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Completion on symbols that include colons (such as eq:strong-convergence) can lead to incorrect substitutions. I've originally reported this for vim-lsp (prabirshrestha/vim-lsp#420), but it turns out the issue occurs in VS Code as well (slightly differently).
The language server then correctly suggests sec:foo_bar, but when I select it, it inserts it after the initial sec:, i.e., I get sec:sec:foo_bar. (vim-lsp turns that into \ref{sec:barsec:foo_bar} instead.)
The relevant part of the log is
Thu 27 Jun 2019 15:19:36 CEST:["--->",1,"texlab",{"method":"textDocument/completion","on_notification":"---funcref---","params":{"textDocument":{"uri":"file:///home/thomas/test.tex"},"position":{"character":12,"line":5}}}]
Thu 27 Jun 2019 15:19:36 CEST:["<---",1,"texlab",{"response":{"id":41,"jsonrpc":"2.0","result":{"isIncomplete":true,"items":[{"label":"sec:foo_bar","data":"Label","kind":5}]}},"request":{"id":41,"jsonrpc":"2.0","method":"textDocument/completion","params":{"textDocument":{"uri":"file:///home/thomas/test.tex"},"position":{"character":12,"line":5}}}}]
i.e., texlab gives the wrong position. (A related issue is with renaming: if I rename sec:foo_bar, the prefilled text is just foo_bar, but the whole label (including sec:) is replaced with what I write. This is much less critical, of course.)
@thomasfaingnaert suggests not using labels for completions but rather text-edits, which is a newer part of the LSP protocol.
The text was updated successfully, but these errors were encountered:
@thomasfaingnaert suggests not using labels for completions but rather text-edits, which is a newer part of the LSP protocol.
The server now uses the textEdit field in CompletionItem.
In your example, the completion now works correctly.
(A related issue is with renaming: if I rename sec:foo_bar, the prefilled text is just foo_bar, but the whole label (including sec:) is replaced with what I write. This is much less critical, of course.)
The server now implements the textEdit/prepareRename request so this issue should be fixed as well.
Completion on symbols that include colons (such as
eq:strong-convergence
) can lead to incorrect substitutions. I've originally reported this for vim-lsp (prabirshrestha/vim-lsp#420), but it turns out the issue occurs in VS Code as well (slightly differently).Here's a minimal example from @thomasfaingnaert:
The language server then correctly suggests
sec:foo_bar
, but when I select it, it inserts it after the initialsec:
, i.e., I getsec:sec:foo_bar
. (vim-lsp turns that into\ref{sec:barsec:foo_bar}
instead.)The relevant part of the log is
i.e., texlab gives the wrong position. (A related issue is with renaming: if I rename
sec:foo_bar
, the prefilled text is justfoo_bar
, but the whole label (includingsec:
) is replaced with what I write. This is much less critical, of course.)@thomasfaingnaert suggests not using labels for completions but rather text-edits, which is a newer part of the LSP protocol.
The text was updated successfully, but these errors were encountered: