Skip to content

Commit

Permalink
Merge pull request #6168 from davidwengier/FixUriCreation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwengier authored Aug 18, 2023
2 parents 190e7d3 + 059c9a0 commit 675d74e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/razor/src/document/razorDocumentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class RazorDocumentManager implements IRazorDocumentManager {
// vscode.workspace.openTextDocument may send a textDocument/didOpen
// request to the C# language server. We need to keep track of
// this to make sure we don't send a duplicate request later on.
const razorUri = vscode.Uri.parse('file:' + document.path, true);
const razorUri = vscode.Uri.file(document.path);
if (!this.isRazorDocumentOpenInCSharpWorkspace(razorUri)) {
this.didOpenRazorCSharpDocument(razorUri);

Expand Down
10 changes: 5 additions & 5 deletions src/razor/src/dynamicFile/dynamicFileInfoHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ export class DynamicFileInfoHandler {
const uris = request.razorFiles;
const virtualUris = new Array<DocumentUri | null>();
try {
for (const razorDocumentUri of uris) {
const vscodeUri = vscode.Uri.parse('file:' + razorDocumentUri, true);
for (const razorDocumentPath of uris) {
const vscodeUri = vscode.Uri.file(razorDocumentPath);
const razorDocument = await this.documentManager.getDocument(vscodeUri);
if (razorDocument === undefined) {
virtualUris.push(null);
this.logger.logWarning(
`Could not find Razor document ${razorDocumentUri}; adding null as a placeholder in URI array.`
`Could not find Razor document ${razorDocumentPath}; adding null as a placeholder in URI array.`
);
} else {
// Retrieve generated doc URIs for each Razor URI we are given
Expand All @@ -70,8 +70,8 @@ export class DynamicFileInfoHandler {
private async removeDynamicFileInfo(request: RemoveDynamicFileParams) {
try {
const uris = request.razorFiles;
for (const razorDocumentUri of uris) {
const vscodeUri = vscode.Uri.parse('file:' + razorDocumentUri, true);
for (const razorDocumentPath of uris) {
const vscodeUri = vscode.Uri.file(razorDocumentPath);
if (this.documentManager.isRazorDocumentOpenInCSharpWorkspace(vscodeUri)) {
this.documentManager.didCloseRazorCSharpDocument(vscodeUri);
}
Expand Down

0 comments on commit 675d74e

Please sign in to comment.