-
Notifications
You must be signed in to change notification settings - Fork 167
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
Syntax highlighting with text properties is slow and highlighting incorrectly #485
Comments
Highlighting, as all OmniSharp-vim actions, need the server to be loaded before they work. After the server is loaded they will work, but the first command can still take time as some parts of the server are lazy loaded as far as I can tell. So if you just open a .cs file and don't do anything else, it won't be highlighted, as the highlighting request is made before the server is loaded. I am currently working on a feature to replay requests made before the server is loaded but it currently blocked since the is no reliable way of detecting when OmniSharp-roslyn is completely loaded. See https://github.com/nickspoons/omnisharp-vim/tree/feature-replay-requests-on-load and OmniSharp/omnisharp-roslyn#1521 Once the server is loaded, highlighting is updated after certain events, such as exiting insert mode. After the first request this is very fast (in my experience), a fraction of a second. |
I'm not sure about the inconsistent highlighting, I've seen it before too, it seems to sometimes happen with early highlighting requests. Subsequent requests always seem to be correct. There's not much we can do about it here, all we can do is apply the highlights that OmniSharp-roslyn returns. |
@nickspoons Hm, the thing is, syntax highlighting seems to be loading long after the server is loaded. Autocompletion and all that start to work after a few seconds, but syntax highlighting can take minutes unless I trigger it manually. Well, damn. |
Is it really taking minutes, or is it just not being requested? There's no difference between you triggering it manually, and one of the other events which trigger it, i.e. Also make sure you have |
@PaddiM8 the replay-requests-on-load has been merged now so if you have As for the inconsistent highlighting, there is definitely something wrong with the results we get back from OmniSharp-roslyn, I have opened issue OmniSharp/omnisharp-roslyn#1576 over there. |
"I'm not sure about the inconsistent highlighting, I've seen it before too, it seems to sometimes happen with early highlighting requests. Subsequent requests always seem to be correct". How can I make subsequent requests? My highlighting is always not 100% corrent, even on subsequent requests (if OmniSharp makes them automatically). How can I fix this? |
@DasOhmoff you're quoting an old comment. As later comments say, and the O#roslyn issue you've already commented on, the results we get back from O#roslyn are inconsistent, we can't do more about it on this side. |
Ah I see, ok thank you |
Thanks for getting the highlighting fixed in OmniSharp-roslyn, @DasOhmoff, much appreciated! |
@nickspoons, I think you mistook me for someone else :D . |
Ah ha, so I did! I'll go and thank @DasCleverle over in the other repo! |
I'm on Vim 8.1 and enabled highlighting using text properties.
![](https://camo.githubusercontent.com/369d5e543acfae18ebb50bc594267312d04c46bd6937f02b1da631a2fa7bddfc/68747470733a2f2f692e696d6775722e636f6d2f4e5056564a4d722e706e67)
This is the default configuration with
extension method name
andmethod name
disabled. With them enabled, the now white parts are blue. I've tried various configurations and I always notice inconsistencies! Often identical lines of code are highlighted differently. I also noticed it's quite slow, it takes a few minutes before it highlights it if I don't do :OmniSharpHighlightTypes (then it takes a few seconds). I know this is a fairly new feature, so it's not too unexpected.The text was updated successfully, but these errors were encountered: