Skip to content
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

Lsp keep reload the project #165

Closed
Wordluc opened this issue Jun 10, 2024 · 7 comments
Closed

Lsp keep reload the project #165

Wordluc opened this issue Jun 10, 2024 · 7 comments

Comments

@Wordluc
Copy link

Wordluc commented Jun 10, 2024

with this opt
local cap = vim.tbl_deep_extend("force", vim.lsp.protocol.make_client_capabilities(), require('cmp_nvim_lsp').default_capabilities() ) cap.workspace.didChangeWatchedFiles.dynamicRegistration = true

Lsp reload all the project(saying that is changed .sln) even thought i had not changed anything.

image

ps:i use didChangeWatchedFiles to notify the server when i delete a file

@Wordluc
Copy link
Author

Wordluc commented Jun 10, 2024

it seems that lsp dosnet support file operations, for this i use "didChangeWatchedFiles"

@razzmatazz
Copy link
Owner

Hey @Wordluc which OS is this?

@Wordluc
Copy link
Author

Wordluc commented Jun 12, 2024

Windows 10

@Wordluc
Copy link
Author

Wordluc commented Jun 12, 2024

for now i found this solutions:

cap.workspace.didChangeWatchedFiles.dynamicRegistration = true
local oldMath = require("vim.lsp._watchfiles")._match

require("vim.lsp._watchfiles")._match = function(a, b)
	if string.find(b, '.csproj') or string.find(b, '.sln') then
		return false
	end

	return oldMath(a, b)
end

@tcx4c70
Copy link
Contributor

tcx4c70 commented Jun 12, 2024

Hi @Wordluc , change to .csproj detected, will reload solution means the client tells the server that some csproj files are changed. Could you please share the trace log of which files are in the workspace/didChangeWatchedFiles? I guess there are some csproj files are in it.

From the workaround you shared, I think the client you are using sends unchanged files in workspace/didChangeWatchedFiles.

And from lsp spec, it's better to watch file changes in client side and client should send the changed files to server.

@Wordluc
Copy link
Author

Wordluc commented Jun 12, 2024

@tcx4c70 without the workaround are present diffent .csproj, the thing is that i don't change them, so like you said it's a problem of the client so nvim lsp?
or is there something that "change" or "save" some csproj?

@Wordluc
Copy link
Author

Wordluc commented Jul 4, 2024

the problem is that i use visual studio to build and debug the solution since visual studio open .sln to load the solution

@Wordluc Wordluc closed this as completed Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants