csharp-language-server
csharp-language-server copied to clipboard
file operation: like move,rename or delete seems not supported
When I move a file from a/pippo.cs to a/b/pippo.cs and then move it back to a/pippo.cs, the LSP gives me this error: 'Ambiguity between 'method' and 'method', as if the file wasn't deleted during the first move.", this happend also if i create a file in a/pippo2.cs with inside 'method'
hi @Wordluc do you move the file inside the editor or manually from the shell/finder/explorer? and which editor is it?
hi, inside the editor, i use neovim
anyway i think the problem is that the file aren't written (or deleted) inside csproj(no sdk)
I'm having a similar issue in Neovim, but the ambiguity error occurs anytime I save a file. When I do, all my class-scoped members get flagged as ambiguous. What's odd is that the ambiguity is flagged reflexively — e.g.,
class Foo
{
private int bar;
private void useBar()
{
for (var i = 0; i <= bar; bar++) // <- error occurs: "Ambiguity between 'foo.bar' and 'foo.bar'
{
Console.WriteLine($"{bar}"); // <- error occurs: "Ambiguity between 'foo.bar' and 'foo.bar'
}
}
}
Closing and reopening the buffer, or restarting the LSP via :LspRestart, removes the error temporarily, but saving the buffer, even if no changes were made, causes the error to return.
Update: explicitly calling csharp.solution = some_solution_name.sln seemingly resolves this issue. For those who used mason to install csharp-lsp, I was able to do so under nvim-lspconfig.opts.servers.csharp_ls.solution. For me, this is not an issue, as I rarely code in C#. However, it may be an issue for those who utilize it on a daily basis.