Closed snoblenet closed 5 years ago
I am sorry, I don't really understand what this has to do with LSP. matchit is a simple plugin for finding matching parts in a file. So I suppose that means, it happens on Javascript files. So with a file like this:
const sum = (a + b);
and the cursor on any of the paranthesis, pressing %
will cause this error?
Unfortunately, I cannot reproduce the error. Have you tried with the latest version of this plugin?
Also, I see you are using several javascript plugins. Does any of those plugins define the b:match_words
variable, it looks like this might be the culprit.
Also please have a look at :h matchit-debug
and see if this gives more information on how to reproduce the issue.
I also got this error for certain file at certain time (javascript file in most cases), but after check the b:match_words content
as chrisbra suggested, I found that something unknown has changed the content, the content become complicated.
After that I try to reset the content by copying b:match_words content
in new window (opening the same file), and apply in the old window, then it is solved :)
For preventing such event in the future, I save the regex content for that file type, and re-assign it in the future when such error happen again.
So what plugins are you using? the same as @snoblenet ? It would be interesting to know, which plugins is responsible for changing it (so we can open an issue there).
No different, but for my case I think I've found problem root, after doing global search on ~/.vim/bundle
folder, ultisnips and vim-polyglot seems responsible for changing the variable. Especially vim-polyglot(language pack for vim), I am pretty sure of it.
Because when I tried to execute ft=javascript.jsx
multiple times, variable b:match_words
keeps getting appended.
Thanks.
Could that be the culprit? I'll have a closer look soon.
I also experience this issue. I don't have vim-polyglot
but I do have vim-jsx
which has the same code obviously https://github.com/mxw/vim-jsx/blob/master/after/ftplugin/jsx.vim
I'll try commenting out that part and see if it solves the problem (as it usually appears after few minutes editing a file)
Sounds like vim-jsx
is the culprit. Should one of us raise an issue there?
There is an open PR about it https://github.com/mxw/vim-jsx/pull/177
thanks for mentioning it.
I can confirm, that the mentioning jsx plugin adds to the b:match_words variable. However, this Per se, does not cause the error message. So if anybody can reproduce the mentioned error message, please let me know the value of b:match_words
.
Oh, wait, yes it does cause the issue, once too many items have been accumulated into b:match_words
.
Neovim v0.3.1 Mac OS X 10.14.1
I am regularly getting the error shown below when my cursor is on one parenthesis and I press
%
to go to the matching parenthesis.Note that this is despite the fact that the syntax highlighting plugin is correctly highlighting the matching parenthesis as jsFuncBraces.
I've found that the problem only affects one file at a time. But the affected file need not have any linting errors or unmatched braces for the problem to occur.
Quiting and restarting neovim temporarily solves the problem so the problem seems to be with the plugin not the inherit complexity of the file containing the parentheses.
Likewise, once the problem begins, it affects even minimal examples in the affected file, like jumping between braces in
const sum = (a + b);
.After a restart, the problem does not appear for a few hours. Then it starts again and stays until I quit and restart again. (Sorry this is the only way I know to reproduce the issue.)
Actual behaviour
Expected behaviour
Go to matching parenthesis every time.
Sidebar
Given the Language Server Protocol can return a 'range' (start and end column and row for each function), I'm wondering if this might be better than regex for syntax highlighting and for
%
and for custom objects likeinside function
andaround function
.Postscript
I hope that I've understood correctly that this issue should be filed on the plugin itself not on Neovim. Thank you.