Skip to content

Commit 675d74e

Browse files
authored
Merge pull request #6168 from davidwengier/FixUriCreation
2 parents 190e7d3 + 059c9a0 commit 675d74e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/razor/src/document/razorDocumentManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
302302
// vscode.workspace.openTextDocument may send a textDocument/didOpen
303303
// request to the C# language server. We need to keep track of
304304
// this to make sure we don't send a duplicate request later on.
305-
const razorUri = vscode.Uri.parse('file:' + document.path, true);
305+
const razorUri = vscode.Uri.file(document.path);
306306
if (!this.isRazorDocumentOpenInCSharpWorkspace(razorUri)) {
307307
this.didOpenRazorCSharpDocument(razorUri);
308308

src/razor/src/dynamicFile/dynamicFileInfoHandler.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ export class DynamicFileInfoHandler {
4040
const uris = request.razorFiles;
4141
const virtualUris = new Array<DocumentUri | null>();
4242
try {
43-
for (const razorDocumentUri of uris) {
44-
const vscodeUri = vscode.Uri.parse('file:' + razorDocumentUri, true);
43+
for (const razorDocumentPath of uris) {
44+
const vscodeUri = vscode.Uri.file(razorDocumentPath);
4545
const razorDocument = await this.documentManager.getDocument(vscodeUri);
4646
if (razorDocument === undefined) {
4747
virtualUris.push(null);
4848
this.logger.logWarning(
49-
`Could not find Razor document ${razorDocumentUri}; adding null as a placeholder in URI array.`
49+
`Could not find Razor document ${razorDocumentPath}; adding null as a placeholder in URI array.`
5050
);
5151
} else {
5252
// Retrieve generated doc URIs for each Razor URI we are given
@@ -70,8 +70,8 @@ export class DynamicFileInfoHandler {
7070
private async removeDynamicFileInfo(request: RemoveDynamicFileParams) {
7171
try {
7272
const uris = request.razorFiles;
73-
for (const razorDocumentUri of uris) {
74-
const vscodeUri = vscode.Uri.parse('file:' + razorDocumentUri, true);
73+
for (const razorDocumentPath of uris) {
74+
const vscodeUri = vscode.Uri.file(razorDocumentPath);
7575
if (this.documentManager.isRazorDocumentOpenInCSharpWorkspace(vscodeUri)) {
7676
this.documentManager.didCloseRazorCSharpDocument(vscodeUri);
7777
}

0 commit comments

Comments
 (0)