@@ -43,13 +43,13 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
43
43
projectFileTypeCoordinator) as this =
44
44
45
45
/// 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>()
47
47
48
48
/// 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>()
50
50
51
51
/// References to assemblies and other source files for each known script path.
52
- let scriptsReferences = Dictionary< FileSystemPath , ScriptReferences>()
52
+ let scriptsReferences = Dictionary< VirtualFileSystemPath , ScriptReferences>()
53
53
54
54
let psiModules = List< IPsiModule>()
55
55
let mutable psiModulesCollection = HybridCollection.Empty
@@ -67,21 +67,21 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
67
67
let platformInfo = platformInfos |> Seq.maxBy ( fun info -> info.TargetFrameworkId.Version)
68
68
platformInfo.TargetFrameworkId
69
69
70
- let getScriptOptions ( path : FileSystemPath ) ( document : IDocument ) =
70
+ let getScriptOptions ( path : VirtualFileSystemPath ) ( document : IDocument ) =
71
71
scriptOptionsProvider.GetScriptOptions( path, document.GetText())
72
72
|> Option.orElseWith ( fun _ -> failwithf " Could not get script options for: %O " path)
73
73
|> Option.get
74
74
75
- let getScriptReferences scriptPath scriptOptions =
76
- let assembliesPaths = HashSet< FileSystemPath >()
75
+ let getScriptReferences ( scriptPath : VirtualFileSystemPath ) scriptOptions =
76
+ let assembliesPaths = HashSet< VirtualFileSystemPath >()
77
77
for o in scriptOptions.OtherOptions do
78
78
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 )
80
80
if not path.IsEmpty then assembliesPaths.Add( path) |> ignore
81
81
82
- let filesPaths = HashSet< FileSystemPath >()
82
+ let filesPaths = HashSet< VirtualFileSystemPath >()
83
83
for file in scriptOptions.SourceFiles do
84
- let path = FileSystemPath .TryParse( file)
84
+ let path = VirtualFileSystemPath .TryParse( file, InteractionContext.SolutionContext )
85
85
if not path.IsEmpty && not ( path.Equals( scriptPath)) then
86
86
filesPaths.Add( path) |> ignore
87
87
@@ -136,7 +136,7 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
136
136
137
137
psiModule
138
138
139
- and createPsiModuleForPath ( path : FileSystemPath ) changeBuilder =
139
+ and createPsiModuleForPath ( path : VirtualFileSystemPath ) changeBuilder =
140
140
let modulesForPath = getPsiModulesForPath path
141
141
if modulesForPath.IsEmpty() then
142
142
let fileDocument = documentManager.GetOrCreateDocument( path)
@@ -147,7 +147,7 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
147
147
scriptsFromPaths.[ path] <- psiModule
148
148
addPsiModule psiModule
149
149
150
- let rec updateReferences ( path : FileSystemPath ) ( document : IDocument ) =
150
+ let rec updateReferences ( path : VirtualFileSystemPath ) ( document : IDocument ) =
151
151
locks.QueueReadLock( lifetime, " Request new F# script references" , fun _ ->
152
152
let mutable oldReferences = Unchecked.defaultof< ScriptReferences>
153
153
match scriptsReferences.TryGetValue( path, & oldReferences) with
@@ -238,7 +238,7 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
238
238
resultModule <- psiModule
239
239
true
240
240
241
- member x.CreatePsiModuleForPath ( path : FileSystemPath , changeBuilder : PsiModuleChangeBuilder ) =
241
+ member x.CreatePsiModuleForPath ( path : VirtualFileSystemPath , changeBuilder : PsiModuleChangeBuilder ) =
242
242
locks.AssertWriteAccessAllowed()
243
243
createPsiModuleForPath path changeBuilder
244
244
@@ -314,7 +314,7 @@ type FSharpScriptPsiModuleHandler(lifetime, solution, handler, modulesProvider,
314
314
inherit DelegatingProjectPsiModuleHandler( handler)
315
315
316
316
let locks = solution.Locks
317
- let sourceFiles = Dictionary< FileSystemPath , IPsiSourceFile>()
317
+ let sourceFiles = Dictionary< VirtualFileSystemPath , IPsiSourceFile>()
318
318
319
319
do
320
320
lifetime.OnTermination( fun _ ->
@@ -378,7 +378,7 @@ type FSharpScriptPsiModule(lifetime, path, solution, sourceFileCtor, moduleId, a
378
378
// We create at most one psi module for each project file and update list of handlers pointing to it.
379
379
let projectHandlers = List< IProjectPsiModuleHandler>()
380
380
381
- let assemblyCookies = DictionaryEvents< FileSystemPath , IAssemblyCookie>( lifetime, moduleId)
381
+ let assemblyCookies = DictionaryEvents< VirtualFileSystemPath , IAssemblyCookie>( lifetime, moduleId)
382
382
383
383
do
384
384
assemblyCookies.AddRemove.Advise_ Remove( lifetime, fun ( AddRemoveArgs ( KeyValue ( _ , assemblyCookie ))) ->
@@ -400,12 +400,12 @@ type FSharpScriptPsiModule(lifetime, path, solution, sourceFileCtor, moduleId, a
400
400
401
401
member x.IsValid = psiServices.Modules.HasModule( this)
402
402
403
- member x.AddReference ( path : FileSystemPath ) =
403
+ member x.AddReference ( path : VirtualFileSystemPath ) =
404
404
solution.Locks.AssertWriteAccessAllowed()
405
405
if not ( assemblyCookies.ContainsKey( path)) then
406
406
assemblyCookies.Add( path, assemblyFactory.AddRef( AssemblyLocation( path), moduleId, this.ResolveContext))
407
407
408
- member x.RemoveReference ( path : FileSystemPath ) =
408
+ member x.RemoveReference ( path : VirtualFileSystemPath ) =
409
409
solution.Locks.AssertWriteAccessAllowed()
410
410
if assemblyCookies.ContainsKey( path) then
411
411
assemblyCookies.Remove( path) |> ignore
@@ -459,11 +459,11 @@ type IFSharpFileService =
459
459
abstract member IsScriptLike: IPsiSourceFile -> bool
460
460
461
461
/// True when file is an IntelliJ scratch file.
462
- abstract member IsScratchFile: FileSystemPath -> bool
462
+ abstract member IsScratchFile: VirtualFileSystemPath -> bool
463
463
464
464
465
465
/// Holder for psi module resolve context.
466
- type FSharpScriptModule ( path : FileSystemPath , solution : ISolution ) =
466
+ type FSharpScriptModule ( path : VirtualFileSystemPath , solution : ISolution ) =
467
467
inherit UserDataHolder()
468
468
469
469
static let scratchesPath = RelativePath.TryParse( " Scratches" )
@@ -507,8 +507,8 @@ type ScriptFileProperties() =
507
507
508
508
509
509
type ScriptReferences =
510
- { Assemblies: ISet < FileSystemPath >
511
- Files: ISet < FileSystemPath > }
510
+ { Assemblies: ISet < VirtualFileSystemPath >
511
+ Files: ISet < VirtualFileSystemPath > }
512
512
513
513
514
514
[<SolutionFeaturePart>]
0 commit comments