Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Compiler/Service/BackgroundCompiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ type internal IBackgroundCompiler =

abstract member InvalidateConfiguration: options: FSharpProjectOptions * userOpName: string -> unit

abstract InvalidateConfiguration: projectSnapshot: FSharpProjectSnapshot * userOpName: string -> unit

abstract member NotifyFileChanged: fileName: string * options: FSharpProjectOptions * userOpName: string -> NodeCode<unit>

abstract member NotifyProjectCleaned: options: FSharpProjectOptions * userOpName: string -> Async<unit>
Expand Down Expand Up @@ -1612,6 +1614,10 @@ type internal BackgroundCompiler
member _.InvalidateConfiguration(options: FSharpProjectOptions, userOpName: string) : unit =
self.InvalidateConfiguration(options, userOpName)

member this.InvalidateConfiguration(projectSnapshot: FSharpProjectSnapshot, userOpName: string) : unit =
let options = projectSnapshot.ToOptions()
self.InvalidateConfiguration(options, userOpName)

member _.NotifyFileChanged(fileName: string, options: FSharpProjectOptions, userOpName: string) : NodeCode<unit> =
self.NotifyFileChanged(fileName, options, userOpName)

Expand Down
2 changes: 2 additions & 0 deletions src/Compiler/Service/BackgroundCompiler.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ type internal IBackgroundCompiler =

abstract InvalidateConfiguration: options: FSharpProjectOptions * userOpName: string -> unit

abstract InvalidateConfiguration: projectSnapshot: FSharpProjectSnapshot * userOpName: string -> unit

abstract NotifyFileChanged: fileName: string * options: FSharpProjectOptions * userOpName: string -> NodeCode<unit>

abstract NotifyProjectCleaned: options: FSharpProjectOptions * userOpName: string -> Async<unit>
Expand Down
6 changes: 6 additions & 0 deletions src/Compiler/Service/TransparentCompiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2136,6 +2136,12 @@ type internal TransparentCompiler
member this.InvalidateConfiguration(options: FSharpProjectOptions, userOpName: string) : unit =
backgroundCompiler.InvalidateConfiguration(options, userOpName)

member this.InvalidateConfiguration(projectSnapshot: FSharpProjectSnapshot, _userOpName: string) : unit =
let (FSharpProjectIdentifier(projectFileName, outputFileName)) =
projectSnapshot.Identifier

this.Caches.Clear(Set.singleton (ProjectIdentifier(projectFileName, outputFileName)))

member this.NotifyFileChanged(fileName: string, options: FSharpProjectOptions, userOpName: string) : NodeCode<unit> =
backgroundCompiler.NotifyFileChanged(fileName, options, userOpName)

Expand Down
4 changes: 4 additions & 0 deletions src/Compiler/Service/service.fs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ type FSharpChecker
let userOpName = defaultArg userOpName "Unknown"
backgroundCompiler.InvalidateConfiguration(options, userOpName)

member _.InvalidateConfiguration(projectSnapshot: FSharpProjectSnapshot, ?userOpName: string) =
let userOpName = defaultArg userOpName "Unknown"
backgroundCompiler.InvalidateConfiguration(projectSnapshot, userOpName)

/// Clear the internal cache of the given projects.
member _.ClearCache(options: seq<FSharpProjectOptions>, ?userOpName: string) =
let userOpName = defaultArg userOpName "Unknown"
Expand Down
7 changes: 7 additions & 0 deletions src/Compiler/Service/service.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,13 @@ type public FSharpChecker =
/// <param name="userOpName">An optional string used for tracing compiler operations associated with this request.</param>
member InvalidateConfiguration: options: FSharpProjectOptions * ?userOpName: string -> unit

/// <summary>
/// This function is called when the configuration is known to have changed for reasons not encoded in the projectSnapshot.
/// For example, dependent references may have been deleted or created.
/// </summary>
[<Experimental("This FCS API is experimental and subject to change.")>]
member InvalidateConfiguration: projectSnapshot: FSharpProjectSnapshot * ?userOpName: string -> unit

/// <summary>Clear the internal cache of the given projects.</summary>
/// <param name="options">The given project options.</param>
/// <param name="userOpName">An optional string used for tracing compiler operations associated with this request.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,7 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Void ClearCache(System.Collections.G
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateAll()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateConfiguration(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateConfiguration(FSharpProjectSnapshot, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsBindingALambdaAtPosition(FSharp.Compiler.Text.Position)
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsPosContainedInApplication(FSharp.Compiler.Text.Position)
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsPositionContainedInACurriedParameter(FSharp.Compiler.Text.Position)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,7 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Void ClearCache(System.Collections.G
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateAll()
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateConfiguration(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpChecker: Void InvalidateConfiguration(FSharpProjectSnapshot, Microsoft.FSharp.Core.FSharpOption`1[System.String])
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsBindingALambdaAtPosition(FSharp.Compiler.Text.Position)
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsPosContainedInApplication(FSharp.Compiler.Text.Position)
FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Boolean IsPositionContainedInACurriedParameter(FSharp.Compiler.Text.Position)
Expand Down