-
Notifications
You must be signed in to change notification settings - Fork 168
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
Poor syntax highlighting and server load time after a minimal NVIM setup #845
Comments
Try looking in the log, Do you have a solution or project? Omnisharp-vim is looking for a .sln or .csproj file. If one isn't found in the current directory or a parent/ancestor directory, it will start the server in the current dir, and if that is a big directory that can be slow. Also, if you are trying to code dotnet 5+ projects (not legacy .NET Framework projects) add |
@nickspoons I do have a CSPROJ file, and my project is very minimal, here's my folder structure:
As you can see I am using .NET 7. Seems weird to have to specify Here's the output of
|
Yeah it is weird. It's a result of how .NET has changed from Framework to dotnet, and how omnisharp-roslyn has changed from one build to another while still supporting both. At this stage it would be better to make dotnet the default, but that would be a breaking change for e.g. Unity developers so it's not simple to do.
I agree that sounds slow. It could be caused by lots of factors, I don't really know what your environment is - terminal neovim in powershell? It might start faster if you add a .sln, with a try, just to rule out other factors.
Do you mean after leaving insert mode? I thought the default was to only highlight after exiting insert, not while typing. I can't actually remember exactly, I'm currently on holiday and away from the computer for another few day. |
Already tried. Adding a solution has no impact on the syntax highlighting or on the server load time.
What other details about my environment would be helpful to better trouble shoot this?
Well neither works in my setup, so there's not much I can say about that... |
Is this running in a terminal emulator? Which one? Or gui (nvim-qt?)? How did you install it? Is there any extra layer like WSL involved? How do you start nvim? I will try to emulate the environment when I'm home. It would be interesting to know if e.g. gvim has the exact same behaviour. |
I'm on a Windows 10 machine and running this in a Powershell 7 terminal with Windows Terminal installed from the Microsoft Store. I am not interested in running nvim on any kind of GUI environment, just from the terminal. There is no extra layer like WSL, and I start Nvim by simply invoking Server loading in a regular Powershell 7 terminal (not with Windows Terminal) appears to go a bit faster, about 4 seconds, but that's still quite slow, considering tools like VS Code will highlight C# syntax instantaneously. However, the issues with weird syntax highlighting remain: |
You do What is your neovim |
Nevermind about the nvim version, I see it in your log. I have now tried a similar project in both nvim 0.7.2 and 0.9.1 in powershell in the Windows Terminal on Win10 with the latest omnisharp-roslyn and it's all working as expected so I am not sure what is going on here. The output of |
Just for comparison's sake, I'm running this in a Windows10 VM on my linux host, the VM is not particularly fast, it has a single core and a bit of memory, omnisharp-roslyn starts in 2.3 seconds. |
Neovim
Output of
I tried adding |
Yep, then open a .cs file, then share the log |
Here you go:
|
Thanks for that. I can compare it with the same log on my VM and it's very similar, but a fair bit slower. Are you on an old or low-specced machine? It had seemed to me that there was something wrong with the configuration to be causing such slow load times but everything looks fine so I think it's just slow. You have compared with VScode earlier. I would suggest watching carefully when vscode loads. You'll have some highlighting immediately (as there is vim syntax highlighting immediately) and then the semantic omnisharp-roslyn highlighting kicks in a bit later, but it's more of a subtle change than in vim. But essentially it's the same process and I would be surprised if the vscode version happened faster than in vim. As for the highlighting issue, I can reproduce it, there appears to have been a change in neovim at some point that affects when certain events are fired, and so omnisharp-vim is not being told to update the highlighting as often as it does in vim. I'm not a neovim user so I hadn't noticed it before, I'll try to find some time to look into it. |
@nickspoons You're welcome. I'm using an HP Zbook, intel Core i9 with excellent specs. It's a fairly modern machine. I'll stick with VS Code for now and try omnisharp-vim again when I have more time to look into why things don't work as expected. |
@nickspoons I'm back at this again and see that the highlighting issue still occurs. I was wondering if you had time to look into it? Should I open an issue at the NeoVim repo or is this really an |
Sorry no, I haven't had any time and I'm not going to in the near future. The issue is not an nvim issue but due to a change in how often nvim fires events. Any time your code is out of sync with the highlighting, try doing something like |
@nickspoons I see. This should probably be mentioned in the main documentation for I'll look into using |
It works fine. The highlighting is slightly out of sync when using neovim on Windows. |
@nickspoons quick update: I tried using |
I've recently added the plugin to my windows
nvim
installation. Here are the steps I followed:Installed vim-plug using
as shown here.
Added
Plug 'OmniSharp/omnisharp-vim'
to myinit.vim
fileRan
:PlugInstall
Ran
:OmniSharpInstall
Both
PlugInstall
andOmniSharpInstall
seem to have run without any issues. Myinit.vim
ended up looking like this:It appears to me that the installation went fine. However, there are two issues:
I'm hoping it's something wrong with my setup. Any pointers?
The text was updated successfully, but these errors were encountered: