-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Highlighting sometimes disappears #18
Comments
So either we have a race condition in the plugin or nimsuggest just went dumb for a moment. This is gonna be hell to debug. I'm more convinced that it's the latter. Can you try to make a reproducible case? (ie. a file in a project experience this problem after a defined editing sequence) |
@alaviss This is happening to me constantly while I'm writing euwren, but it's seemingly random, so making a reproducible case will be difficult. This is the file where this occurs: https://github.com/liquid600pgm/euwren/blob/master/src/euwren.nim |
This plugin utilize nimsuggest to do the highlighting, so if your code is not accepted by the parser, nimsuggest might trip. Sometimes you can even crash nimsuggest. I guess this is even more likely as you're working with macros. Can you check if nimsuggest died during one of the "no highlighting" session? The plugin reports every terminations and you can see them with |
@alaviss nimsuggest does seem to throw errors sometimes and they appear on the status bar, but the highlighting doesn't disappear. nimsuggest continues functioning. The message that appears very often is
but it doesn't crash nimsuggest or stop the highlighting. I only see the error described in #16 when I exit nvim, but only that. Other than that, nimsuggest does not seem to crash when this occurs (or the plugin doesn't report it correctly). I have to admit though, there were a few times nimsuggest crashed completely and all the highlighting disappeared, but restarting nvim helped. |
The problem seems to occur reliably on this exact commit and these exact lines. |
I think I found the culprit. |
That message means that some suggestions wouldn't be classified correctly, but it does no harm. Fixed though, thanks for letting me know.
That's odd, the plugin should restarts nimsuggest and make everything work again (on the next input, file saving, etc.). I'll have to investigate that one.
How can I reproduce this? It seems like this is a nimsuggest bug though. |
@alaviss I'm unsure how to reproduce this, it happened once but I'm unable to reproduce either. It seems like nimsuggest doesn't really like macros in general. |
I also (presumably) had crashes of These problems happen rarely for me. I didn't notice any pattern, but I'll try to remember/reproduce it the next time it happens. (However, with my (neo)vim usage it's likely that I already pressed more keys by the time I notice the problem.) Apart from that, I really like the plugin. Thank you! :-) |
@sschwarzer @liquid600pgm :echo b:nimSugHighlight
:echo nim#suggest#FindInstance() It'd help me a lot in debugging, thanks :) |
I'll try to remember. :-) |
Found a weird instance of an Altering the file brings the highlighting back, this is only present right after the file is opened. Here's the file I was testing on. |
Reproduced. And this is definitely a nimsuggest bug. Here's how to instantly crash nimsuggest:
This will be a PITA to debug :( |
Ok, it happened. ;-) Here's the output of the two commands:
The latest commit of my clone is [83b5fd5]. |
AFAICT, not a bug in nim.nvim (whew). I guess |
This actually worked, thank you! :-) Could you possibly detect the failed |
That's really hard actually :( The best way I could think of to debug this is to enable logging in nimsuggest, then use that information to pin point why it fails... If you wanna help debugging this, add |
That's what I suspected. :-/
Ok, I activated the logging and made sure the log is written to after restarting nvim. |
Can you also add the |
Done :-) |
I had some missing syntax highlighting today. However, nimsuggest still seems to be running and generates new output in the log file. Here's the data I could gather:
Here's the section from the log when I save the buffer (paths partially replaced):
I'll also attach the Nim files. The highlighting is reduced in the editor starting in line 80 ( |
After stopping
The message |
please check if nim-lang/Nim#17590 helps with this issue, given this comment:
(it could very well be an unrelated issue though) |
Sometimes, when editing, the dynamic syntax highlighting stops working for a block of code. When this happens, the code only has some barebones highlighting for keywords and literals, and most of it remains gray.
Sometimes, the highlighting disappears in the middle of a procedure and not just a block:
The text was updated successfully, but these errors were encountered: