@@ -43,13 +43,13 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
4343 projectFileTypeCoordinator) as this =
4444
4545 /// There may be multiple project files for a path (i.e. linked in multiple projects) and we must distinguish them.
46- let scriptsFromProjectFiles = OneToListMap< FileSystemPath , FSharpScriptPsiModule>()
46+ let scriptsFromProjectFiles = OneToListMap< VirtualFileSystemPath , FSharpScriptPsiModule>()
4747
4848 /// Psi modules for files coming from #load directives and do not present in the project model.
49- let scriptsFromPaths = Dictionary< FileSystemPath , FSharpScriptPsiModule>()
49+ let scriptsFromPaths = Dictionary< VirtualFileSystemPath , FSharpScriptPsiModule>()
5050
5151 /// References to assemblies and other source files for each known script path.
52- let scriptsReferences = Dictionary< FileSystemPath , ScriptReferences>()
52+ let scriptsReferences = Dictionary< VirtualFileSystemPath , ScriptReferences>()
5353
5454 let psiModules = List< IPsiModule>()
5555 let mutable psiModulesCollection = HybridCollection.Empty
@@ -67,21 +67,21 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
6767 let platformInfo = platformInfos |> Seq.maxBy ( fun info -> info.TargetFrameworkId.Version)
6868 platformInfo.TargetFrameworkId
6969
70- let getScriptOptions ( path : FileSystemPath ) ( document : IDocument ) =
70+ let getScriptOptions ( path : VirtualFileSystemPath ) ( document : IDocument ) =
7171 scriptOptionsProvider.GetScriptOptions( path, document.GetText())
7272 |> Option.orElseWith ( fun _ -> failwithf " Could not get script options for: %O " path)
7373 |> Option.get
7474
75- let getScriptReferences scriptPath scriptOptions =
76- let assembliesPaths = HashSet< FileSystemPath >()
75+ let getScriptReferences ( scriptPath : VirtualFileSystemPath ) scriptOptions =
76+ let assembliesPaths = HashSet< VirtualFileSystemPath >()
7777 for o in scriptOptions.OtherOptions do
7878 if o.StartsWith( " -r:" , StringComparison.Ordinal) then
79- let path = FileSystemPath .TryParse( o.Substring( 3 ))
79+ let path = VirtualFileSystemPath .TryParse( o.Substring( 3 ), InteractionContext.SolutionContext )
8080 if not path.IsEmpty then assembliesPaths.Add( path) |> ignore
8181
82- let filesPaths = HashSet< FileSystemPath >()
82+ let filesPaths = HashSet< VirtualFileSystemPath >()
8383 for file in scriptOptions.SourceFiles do
84- let path = FileSystemPath .TryParse( file)
84+ let path = VirtualFileSystemPath .TryParse( file, InteractionContext.SolutionContext )
8585 if not path.IsEmpty && not ( path.Equals( scriptPath)) then
8686 filesPaths.Add( path) |> ignore
8787
@@ -136,7 +136,7 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
136136
137137 psiModule
138138
139- and createPsiModuleForPath ( path : FileSystemPath ) changeBuilder =
139+ and createPsiModuleForPath ( path : VirtualFileSystemPath ) changeBuilder =
140140 let modulesForPath = getPsiModulesForPath path
141141 if modulesForPath.IsEmpty() then
142142 let fileDocument = documentManager.GetOrCreateDocument( path)
@@ -147,7 +147,7 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
147147 scriptsFromPaths.[ path] <- psiModule
148148 addPsiModule psiModule
149149
150- let rec updateReferences ( path : FileSystemPath ) ( document : IDocument ) =
150+ let rec updateReferences ( path : VirtualFileSystemPath ) ( document : IDocument ) =
151151 locks.QueueReadLock( lifetime, " Request new F# script references" , fun _ ->
152152 let mutable oldReferences = Unchecked.defaultof< ScriptReferences>
153153 match scriptsReferences.TryGetValue( path, & oldReferences) with
@@ -238,7 +238,7 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
238238 resultModule <- psiModule
239239 true
240240
241- member x.CreatePsiModuleForPath ( path : FileSystemPath , changeBuilder : PsiModuleChangeBuilder ) =
241+ member x.CreatePsiModuleForPath ( path : VirtualFileSystemPath , changeBuilder : PsiModuleChangeBuilder ) =
242242 locks.AssertWriteAccessAllowed()
243243 createPsiModuleForPath path changeBuilder
244244
@@ -314,7 +314,7 @@ type FSharpScriptPsiModuleHandler(lifetime, solution, handler, modulesProvider,
314314 inherit DelegatingProjectPsiModuleHandler( handler)
315315
316316 let locks = solution.Locks
317- let sourceFiles = Dictionary< FileSystemPath , IPsiSourceFile>()
317+ let sourceFiles = Dictionary< VirtualFileSystemPath , IPsiSourceFile>()
318318
319319 do
320320 lifetime.OnTermination( fun _ ->
@@ -378,7 +378,7 @@ type FSharpScriptPsiModule(lifetime, path, solution, sourceFileCtor, moduleId, a
378378 // We create at most one psi module for each project file and update list of handlers pointing to it.
379379 let projectHandlers = List< IProjectPsiModuleHandler>()
380380
381- let assemblyCookies = DictionaryEvents< FileSystemPath , IAssemblyCookie>( lifetime, moduleId)
381+ let assemblyCookies = DictionaryEvents< VirtualFileSystemPath , IAssemblyCookie>( lifetime, moduleId)
382382
383383 do
384384 assemblyCookies.AddRemove.Advise_ Remove( lifetime, fun ( AddRemoveArgs ( KeyValue ( _ , assemblyCookie ))) ->
@@ -400,12 +400,12 @@ type FSharpScriptPsiModule(lifetime, path, solution, sourceFileCtor, moduleId, a
400400
401401 member x.IsValid = psiServices.Modules.HasModule( this)
402402
403- member x.AddReference ( path : FileSystemPath ) =
403+ member x.AddReference ( path : VirtualFileSystemPath ) =
404404 solution.Locks.AssertWriteAccessAllowed()
405405 if not ( assemblyCookies.ContainsKey( path)) then
406406 assemblyCookies.Add( path, assemblyFactory.AddRef( AssemblyLocation( path), moduleId, this.ResolveContext))
407407
408- member x.RemoveReference ( path : FileSystemPath ) =
408+ member x.RemoveReference ( path : VirtualFileSystemPath ) =
409409 solution.Locks.AssertWriteAccessAllowed()
410410 if assemblyCookies.ContainsKey( path) then
411411 assemblyCookies.Remove( path) |> ignore
@@ -459,11 +459,11 @@ type IFSharpFileService =
459459 abstract member IsScriptLike: IPsiSourceFile -> bool
460460
461461 /// True when file is an IntelliJ scratch file.
462- abstract member IsScratchFile: FileSystemPath -> bool
462+ abstract member IsScratchFile: VirtualFileSystemPath -> bool
463463
464464
465465/// Holder for psi module resolve context.
466- type FSharpScriptModule ( path : FileSystemPath , solution : ISolution ) =
466+ type FSharpScriptModule ( path : VirtualFileSystemPath , solution : ISolution ) =
467467 inherit UserDataHolder()
468468
469469 static let scratchesPath = RelativePath.TryParse( " Scratches" )
@@ -507,8 +507,8 @@ type ScriptFileProperties() =
507507
508508
509509type ScriptReferences =
510- { Assemblies: ISet < FileSystemPath >
511- Files: ISet < FileSystemPath > }
510+ { Assemblies: ISet < VirtualFileSystemPath >
511+ Files: ISet < VirtualFileSystemPath > }
512512
513513
514514[<SolutionFeaturePart>]
0 commit comments