-
Notifications
You must be signed in to change notification settings - Fork 305
Completion for symbols including colons (":") #420
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
Comments
@clason augroup latex_iskeyword
autocmd!
autocmd FileType tex setlocal iskeyword+=:
augroup end This will also change the meaning of a |
@thomasfaingnaert That should already be set by vimtex (https://github.com/lervag/vimtex/blob/8b8684da10c17af4ab449e1e7435d3f9c2459bf8/autoload/vimtex.vim#L386). Is this being overwritten by vim-lsp? EDIT: It also doesn't fix the issue, I'm afraid. |
@clason I'm not sure, what does |
|
@clason \documentclass{article}
\begin{document}
\section{Foo bar}%
\label{sec:foo_bar}
\ref{sec:bar
\end{document} Invoking C-x C-o at
So |
VS Code behaves slightly differently since it only provides autocomplete, but also incorrectly (completing to For reference, what should have been the correct response in this case? Just a different position? |
@clason Returning labels on completion items is still a remnant from the old LSP protocol, and it doesn't work that great in all cases. The problem is that this label can be interpreted differently depending on the lsp client. E.g. suppose I type You may want to ask the author of texlab to look into text-edits, which solve these problems nicely. |
I have one remaining issue with this that is due to vim-lsp (it doesn't occur on VS Code with the language server nor with default omnicomplete): The character range information seems to be thrown off by non-English characters. If I modify your minimal example to \documentclass{article}
\begin{document}
\section{Foo bar}%
\label{sec:foo_bar}
ö \ref{sec:foo
\end{document} and select the completion, I get
In comparison, without the
This looks like a deep bug, since I can trace at least some intermittent issues I've been having with vim-lsp not showing all the expected completions and hover not working on part of the symbol to the presence of such characters. |
@clason |
@thomasfaingnaert Hmm, this doesn't make a difference for me (to get a minimal log, I opened the minimal example as a previously saved |
@clason |
Could you check in VScode if o \ref{sec:foo and ö \ref{sec:foo send different completion request positions? It seems that Vim counts |
Might be related to #282. |
It's a bit difficult, since vs code only triggers completion after typing a character, while omnicomplete doesn't require that. With that in mind,
|
@thomasfaingnaert Yes, that sounds related; although the PR #284 doesn't fix this, unfortunately. |
I'm afraid I'll not be of much help on this issue. Maybe @mattn can help diagnose the problem? |
That would be much appreciated. Possibly the progress in neovim/neovim#10222 can be of help, too. |
Maybe I should open a new issue for that -- this is easy enough to reproduce in Python? |
Done: #425 |
Uh oh!
There was an error while loading. Please reload this page.
I'm using (omni)completion on symbols that include colons (such as
eq:strong-convergence
), which seems to trip up the logic introduced here in the following situation:\eqref{
eq:conv
<c-x c-o>
or an autocomplete plugin like ncm2-vim-lsp); the candidate
eq:strong-convergence` is shown in the pum.<c-n>
Instead of replacing the full text, only the text after the colon is replaced. (It works correctly if I type a full initial match after the colon like
eq:str
or omit the colon likeconv
.)(This is with texlab language server for LaTeX, but I don't think this is important here.)
EDIT: This seems to be a general issue with symbol parsing -- I have the same issue with renaming. It seems that the colon is hard-coded as a symbol separator, but this is not necessarily a correct assumption for all languages (in this case, it's definitely wrong for TeX).
The text was updated successfully, but these errors were encountered: