File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 99using Microsoft . CodeAnalysis . Razor . Logging ;
1010using Microsoft . CodeAnalysis . Razor . ProjectSystem ;
1111using Microsoft . CodeAnalysis . Razor . Serialization ;
12+ using Microsoft . CodeAnalysis . Razor . Utilities ;
1213using Moq ;
1314
1415namespace Microsoft . AspNetCore . Razor . LanguageServer . ProjectSystem ;
@@ -37,13 +38,19 @@ private static IRazorProjectInfoDriver CreateProjectInfoDriver()
3738 return mock . Object ;
3839 }
3940
40- public async Task AddDocumentToPotentialProjectsAsync ( string textDocumentPath , CancellationToken cancellationToken )
41+ public async Task AddDocumentToPotentialProjectsAsync ( string filePath , CancellationToken cancellationToken )
4142 {
42- var document = new DocumentSnapshotHandle (
43- textDocumentPath , textDocumentPath , FileKinds . GetFileKindFromFilePath ( textDocumentPath ) ) ;
44-
45- foreach ( var projectSnapshot in _projectManager . FindPotentialProjects ( textDocumentPath ) )
43+ foreach ( var projectSnapshot in _projectManager . FindPotentialProjects ( filePath ) )
4644 {
45+ var projectDirectory = FilePathNormalizer . GetNormalizedDirectoryName ( projectSnapshot . FilePath ) ;
46+ var normalizedFilePath = FilePathNormalizer . Normalize ( filePath ) ;
47+
48+ var targetPath = normalizedFilePath . StartsWith ( projectDirectory )
49+ ? normalizedFilePath [ projectDirectory . Length ..]
50+ : normalizedFilePath ;
51+
52+ var document = new DocumentSnapshotHandle ( filePath , targetPath , FileKinds . GetFileKindFromFilePath ( filePath ) ) ;
53+
4754 var projectInfo = projectSnapshot . ToRazorProjectInfo ( ) ;
4855
4956 projectInfo = projectInfo with
You can’t perform that action at this time.
0 commit comments