Closed Wordluc closed 4 months ago
it seems that lsp dosnet support file operations, for this i use "didChangeWatchedFiles"
Hey @Wordluc which OS is this?
Windows 10
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
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.
@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?
the problem is that i use visual studio to build and debug the solution since visual studio open .sln to load the solution
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.
ps:i use didChangeWatchedFiles to notify the server when i delete a file