-
Notifications
You must be signed in to change notification settings - Fork 687
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
Use the fsPath instead of path in the virtual document tracker #2465
Conversation
@@ -63,7 +63,7 @@ function shouldIgnoreDocument(document: TextDocument, server: OmniSharpServer): | |||
} | |||
|
|||
async function openVirtualDocument(document: TextDocument, server: OmniSharpServer, eventStream: EventStream) { | |||
let req = { FileName: document.uri.path, changeType: FileChangeType.Create }; | |||
let req = { FileName: document.uri.fsPath, changeType: FileChangeType.Create }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to fallback to .path
. Aka,
let path = document.uri.fsPath;
if (!path) {
path = document.uri.path;
}
Same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks!
Codecov Report
@@ Coverage Diff @@
## master #2465 +/- ##
==========================================
+ Coverage 63.59% 64.13% +0.53%
==========================================
Files 90 90
Lines 4104 4110 +6
Branches 587 589 +2
==========================================
+ Hits 2610 2636 +26
+ Misses 1328 1296 -32
- Partials 166 178 +12
Continue to review full report at Codecov.
|
The virtual document tracker was sending a file change request with "path" instead of fsPath. The path was not a valid file system path and was causing omnisharp to crash when a deleted file was being opened in the git side-bar( OmniSharp/omnisharp-roslyn#1252 (comment)).