Skip to content

Commit 31c9282

Browse files
committed
Remove unnecessary code
Since the misc files project is not a real project, no razor file will actually be a child of it. It's not even a real path that exists on disk
1 parent 8a31344 commit 31c9282

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/RazorProjectService.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,8 @@ private async Task AddDocumentToMiscProjectNeedsLocksAsync(string filePath, Canc
6767
return;
6868
}
6969

70-
var targetFilePath = textDocumentPath;
71-
var projectDirectory = FilePathNormalizer.GetNormalizedDirectoryName(miscFilesProject.FilePath);
72-
if (targetFilePath.StartsWith(projectDirectory, FilePathComparison.Instance))
73-
{
74-
// Make relative
75-
targetFilePath = textDocumentPath[projectDirectory.Length..];
76-
}
77-
7870
// Representing all of our host documents with a re-normalized target path to workaround GetRelatedDocument limitations.
79-
var normalizedTargetFilePath = targetFilePath.Replace('/', '\\').TrimStart('\\');
71+
var normalizedTargetFilePath = textDocumentPath.Replace('/', '\\').TrimStart('\\');
8072

8173
var hostDocument = new HostDocument(textDocumentPath, normalizedTargetFilePath);
8274
var textLoader = _remoteTextLoaderFactory.Create(textDocumentPath);

0 commit comments

Comments
 (0)