csharp-language-server icon indicating copy to clipboard operation
csharp-language-server copied to clipboard

Very slow on large amount of projects / Large codebases

Open dakamakat opened this issue 1 year ago • 12 comments

Dont really know why but LSP is getting very slow ( unable to get any diagnostic in file or react on code changes in even 1 min ) on repos with large amount of projects ( smth like 80+ ) i use space station 14 repo to check this

NVIM 0.10.0 Release csharp_ls installed version 0.14.0

or maybe it's related to my completition plugin but it's now wery likely bc everything same when i disable it ( i use nvim-cmp )

is there anyone who experianced same issue or know workaround for this ( i was expiriencing smth similar with omnisharp as well )

dakamakat avatar Jul 01 '24 10:07 dakamakat

i've been experiencing the same for a while now, i have not found anything to solve this. It takes about 5 minutes

Wordluc avatar Jul 01 '24 13:07 Wordluc

I have just implemented pull diagnostics which should help here:

  • https://github.com/razzmatazz/csharp-language-server/pull/174

Would you have chance to test it if it helps in your case?

razzmatazz avatar Jul 03 '24 07:07 razzmatazz

i am using Manson to manage lsp so i can't do a manual pull, it works base on version

Wordluc avatar Jul 03 '24 08:07 Wordluc

i am using Manson to manage lsp so i can't do a manual pull, it works base on version

You can pass custom config to Mason. Something like this:

local config = {
	cmd = { "/path/to/local/csharp-ls" },
}

mason_lspconfig.setup_handlers({
	function(server_name)
		if server_name == "csharp_ls" then
			lspconfig["csharp_ls"].setup(config)
		end
	end,
})

ichirou2910 avatar Jul 11 '24 13:07 ichirou2910

Tested it with latest master ( #174 implemented ) on large repo but seems situation does not changed ( at least for me ) still ~5 mins to load solution ( around 85 projects ) and ~5 min to even start to respond on changes

dakamakat avatar Jul 15 '24 10:07 dakamakat

same thing of @dakamakat

Wordluc avatar Jul 15 '24 10:07 Wordluc

What interaction you mean by he word "responding"? Is it diagnostics that show up late, or completion item do not appear fast enough? I am inclined to emit requests stats to stderr periodically in debug mode to find things like these, but it would be nice to know if you have noted a particular functionality that is laggy or just the "entire experience"

razzmatazz avatar Jul 16 '24 07:07 razzmatazz

It takes about 5 minutes to initialize(for large project), and during this time, the LSP doesn't respond, neovim acts like a normal editor without lsp.

Wordluc avatar Jul 16 '24 07:07 Wordluc

would be possible to start loading the initial project (where you are currently working) and then extend the loading process to the inner project, enabling the LSP to begin working with it, even if temporarily not with full functionality?.

Wordluc avatar Jul 16 '24 08:07 Wordluc

Is there a solution that is being loaded or just multiple projects, sequentially? I have noticed that having a solution file that references the projects significantly reduces load time. (Presumably Roslyn loads those in parallel)

razzmatazz avatar Jul 16 '24 08:07 razzmatazz

it's a solution with different projects

Wordluc avatar Jul 16 '24 08:07 Wordluc

Downgrading down to 0.11.0 drastically improves the initial loading time for me.

Doctor-Cpu avatar Sep 09 '24 01:09 Doctor-Cpu