Open jchannon opened 7 years ago
Thanks for the report @jchannon
I can imagine why this would fail. Essentially, the service in omnisharp-roslyn gathers up all of the text changes and sends them back to the editor host (in this case, C# for VS Code) to apply. However, in this case, there aren't any text changes, just a file rename. This is something we'll need to handle in omnisharp-roslyn.
This should be fixed as of https://github.com/OmniSharp/omnisharp-vscode/pull/1805
Unless we've added code to tell VS Code to apply a file rename, I wouldn't expect this to be fixed.
@rchande : Please check the repro. This is about the Rename File code fix, which still does not work.
@DustinCampbell You're right, this is a different bug. Thanks for noticing :)
The error message it gives me in a toaster is
Unable to open 'INewName.cs': Unable to read file 'c:\Users\...\INewName.cs'
(Error: Unable to resolve non-existing file 'c:\Users\...\INewName.cs').
It's a pretty weird error, since the INewName.cs
indeed is supposed not to exist. It's the one that should be written.
The error message it gives me in a toaster is
Unable to open 'INewName.cs': Unable to read file 'c:\Users\...\INewName.cs' (Error: Unable to resolve non-existing file 'c:\Users\...\INewName.cs').
It's a pretty weird error, since the
INewName.cs
indeed is supposed not to exist. It's the one that should be written.
I am having this exact same issue.
This is very strange. I decided I wanted to fix this issue, I started by reproducing with the current release version which I was able to do easily. Next I got the code running on my machine, however when I try to reproduce the bug it doesn't happen even if I do a prod build with the current release version v1.24.4 checked out. I'm not really sure how to properly debug the production version of the extension so idk what's going on.
I did see this error in the dev tools console.
rejected promise not handled within 1 second: "System.ArgumentException: 'A.cs' is not open.
at Microsoft.CodeAnalysis.Workspace.CheckDocumentIsOpen(DocumentId documentId)
at Microsoft.CodeAnalysis.Workspace.OnDocumentClosed(DocumentId documentId, TextLoader reloader, Boolean updateActiveContext)
at OmniSharp.OmniSharpWorkspace.CloseDocument(DocumentId documentId) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn\\OmniSharpWorkspace.cs:line 102
at OmniSharp.Roslyn.CSharp.Services.Files.FileCloseService.Handle(FileCloseRequest request) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\Files\\FileCloseService.cs:line 23
at OmniSharp.Endpoint.EndpointHandler`2.<AggregateResponsesFromLanguageHandlers>d__18.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 164
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Endpoint.EndpointHandler`2.<HandleRequestForLanguage>d__20.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 227
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Endpoint.EndpointHandler`2.<Process>d__16.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 131
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Stdio.Host.<HandleRequest>d__14.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Stdio\\Host.cs:line 218"
this shows up a few seconds after vscode tries to open the file C.cs
which is what the new file would have been called.
Environment data
dotnet --info
output:VS Code version:1.9.0 C# Extension version:1.7.0-beta4
Steps to reproduce
Have a file called Foo.cs and a class declaration inside called Bar. In the context menu choose
Rename file to Bar.cs
Expected behavior
The file is renamed
Actual behavior
Nothing happens. Omnisharp logs contains the below but no file is renamed.