OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.7k stars 169 forks source link

Update buffer on change #738

Closed nickspoons closed 2 years ago

nickspoons commented 2 years ago

This branch should hopefully provide performance improvements, while also fixing issues raised in #736

Currently, almost all requests to the server contain the full buffer contents, keeping the server synchronised with the editor. However in very large buffers, this can cause understandably slow server interactions.

We recently stopped sending the buffer contents along with highlighting requests, and this PR also drops the buffer contents from diagnostic requests. Instead, autocmds are used to explicitly update the server buffer contents after the buffer has been edited.

The highlighting autocmds are also moved from plugin/OmniSharp.vim to ftplugin/cs/OmniSharp.vim, which gives 2 benefits:

  1. Vim initialisation is improved - there is no need to create highlighting autocmds for sessions that do not include .cs files
  2. It is possible to change g:OmniSharp_highlighting during a session, meaning highlighting can be enabled/disabled or made more or less agressive (by increasing or lowering the g:OmniSharp_highlighting value) while editing
nickspoons commented 2 years ago

Hi @DasOhmoff, I'm just moving our conversation from #736 in here.

I couldn't exactly reproduce the issue you were describing here but I think that this last commit might sort it out. Would you mind giving it a go please?

DasOhmoff commented 2 years ago

Hey, I tested it out. I think it is working fine! I could not find any problems until now.

nickspoons commented 2 years ago

Rebased on to master. I'll run this branch locally for another day or 2 before merging, to make sure everything is working smoothly