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

Use the fsPath instead of path in the virtual document tracker #2465

Merged
merged 5 commits into from
Aug 17, 2018

Conversation

akshita31
Copy link
Contributor

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)).

@rchande
Copy link

rchande commented Aug 17, 2018

cc @NTaylorMullen

@@ -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 };
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!

@codecov
Copy link

codecov bot commented Aug 17, 2018

Codecov Report

Merging #2465 into master will increase coverage by 0.53%.
The diff coverage is 25%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#integration 53% <25%> (+0.55%) ⬆️
#unit 84.52% <ø> (ø) ⬆️
Impacted Files Coverage Δ
src/features/virtualDocumentTracker.ts 60.86% <25%> (-6.64%) ⬇️
src/omnisharp/delayTracker.ts 68.42% <0%> (-5.27%) ⬇️
src/features/diagnosticsProvider.ts 70.28% <0%> (-4.35%) ⬇️
src/omnisharp/server.ts 72.43% <0%> (+0.7%) ⬆️
src/omnisharp/utils.ts 73.68% <0%> (+1.75%) ⬆️
src/features/codeLensProvider.ts 48.54% <0%> (+1.94%) ⬆️
src/features/documentation.ts 38.09% <0%> (+2.38%) ⬆️
src/features/completionItemProvider.ts 77.77% <0%> (+17.46%) ⬆️
src/features/codeActionProvider.ts 66.12% <0%> (+25.8%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9fbb4e1...cfba76e. Read the comment docs.

@akshita31 akshita31 merged commit c7b1d88 into dotnet:master Aug 17, 2018
@akshita31 akshita31 deleted the fs_path branch August 17, 2018 20:46
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

Successfully merging this pull request may close these issues.

3 participants