Conversation
4f6ccba to
0242c14
Compare
| let bind (mapping: 'a -> CancellationToken -> asyncaval<'b>) (value: asyncaval<'a>) = | ||
| let mutable cache: option<_> = None | ||
| let mutable innerCache: option<_> = None | ||
| let mutable outerDataCache: option<_> = None |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
42c2357 to
bcaabe9
Compare
e0dbfbf to
8226064
Compare
| val defaultLanguageVersion: Lazy<LanguageVersionShim> | ||
|
|
||
|
|
||
| val fromOtherOptions: options: seq<string> -> LanguageVersionShim |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
|
|
||
| member RemoveFileFromCache: file: string<LocalPath> -> unit | ||
|
|
||
| member ClearCache: snap: seq<FSharpProjectSnapshot> -> unit |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
3a5d660 to
b0c079d
Compare
381198b to
acbfe87
Compare
| real.ContinueWith(fun (task: Task<_>) -> | ||
| match task.Status with | ||
| | TaskStatus.RanToCompletion -> tcs.TrySetResult task.Result |> ignore<bool> | ||
| | TaskStatus.Canceled -> | ||
| tcs.TrySetCanceled(TaskCanceledException(task).CancellationToken) | ||
| |> ignore<bool> | ||
| | TaskStatus.Faulted -> tcs.TrySetException(task.Exception.InnerExceptions) |> ignore<bool> | ||
|
|
||
| | _ -> ()) | ||
| |> ignore<Task> |
There was a problem hiding this comment.
Changed back to ContinueWith style as getting stack traces weren't working properly. Wish I had a good idea how to make a test for that.
| match! inMemorySourceFiles |> AMap.tryFind sourcePath with | ||
| | Some volatileFile -> return! volatileFile |> AVal.map createFSharpFileSnapshotInMemory | ||
| | None -> return! createFSharpFileSnapshotOnDisk sourceTextFactory sourcePath |
There was a problem hiding this comment.
Changes to source files, either in memory or on disk will cause snapshots to be recreated.
| >> Log.addContextDestructured "projectFileName" p.ProjectFileName | ||
| ) | ||
|
|
||
| snapshot |
There was a problem hiding this comment.
Finding an already created snapshot keeps memory use down.
| let! projectFileName = projectFileName | ||
| and! projectId = projectId | ||
| and! sourceFiles = sourceFiles | ||
| and! referencePaths = referencePaths | ||
| and! otherOptions = otherOptions | ||
| and! referencedProjects = referencedProjects | ||
| and! isIncompleteTypeCheckEnvironment = isIncompleteTypeCheckEnvironment | ||
| and! useScriptResolutionRules = useScriptResolutionRules | ||
| and! loadTime = loadTime | ||
| and! unresolvedReferences = unresolvedReferences | ||
| and! originalLoadReferences = originalLoadReferences |
There was a problem hiding this comment.
Note, any changes to any of these could recreate a snapshot. In practice only a few of these change
| referencePath.Substring(3) // remove "-r:" | ||
| |> createReferenceOnDisk) | ||
|
|
||
| let referencedProjects = mapReferences p |
There was a problem hiding this comment.
This is where it creates/finds referenced snapshots, and when those change it will recreate the current snapshot.
| file: string<LocalPath> -> | ||
| options: seq<string * FSharpProjectOptions> -> | ||
| (FSharpProjectOptions * FSharpProjectOptions list) option | ||
| snapshots: seq<string * CompilerProjectOption> -> |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
| options: seq<string * FSharpProjectOptions> -> | ||
| (FSharpProjectOptions * FSharpProjectOptions list) option | ||
| snapshots: seq<string * CompilerProjectOption> -> | ||
| option<CompilerProjectOption * list<CompilerProjectOption>> |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
| options: seq<string * FSharpProjectOptions> -> | ||
| (FSharpProjectOptions * FSharpProjectOptions list) option | ||
| snapshots: seq<string * CompilerProjectOption> -> | ||
| option<CompilerProjectOption * list<CompilerProjectOption>> |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
| member GetProjectOptionsFromScript: | ||
| file: string<LocalPath> * source: ISourceText * tfm: FSIRefs.TFM -> | ||
| Async<FSharpProjectOptions * FSharpDiagnostic list> | ||
| Async<FSharpProjectOptions * list<FSharp.Compiler.Diagnostics.FSharpDiagnostic>> |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
| file: string<LocalPath> * snapshot: FSharpProjectSnapshot -> ParseAndCheckResults option | ||
|
|
||
| member TryGetRecentCheckResultsForFile: | ||
| file: string<LocalPath> * options: FSharpProjectOptions * source: ISourceText -> option<ParseAndCheckResults> |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
|
|
||
| member FindReferencesForSymbolInFile: | ||
| file: string * project: FSharpProjectOptions * symbol: FSharpSymbol -> Async<seq<range>> | ||
| file: string<LocalPath> * project: FSharpProjectSnapshot * symbol: FSharpSymbol -> Async<seq<range>> |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
| file: string<LocalPath> * project: FSharpProjectSnapshot * symbol: FSharpSymbol -> Async<seq<range>> | ||
|
|
||
| member FindReferencesForSymbolInFile: | ||
| file: string<LocalPath> * project: FSharpProjectOptions * symbol: FSharpSymbol -> Async<seq<range>> |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
| and set (value) = disableInMemoryProjectReferences <- value | ||
|
|
||
| static member GetDependingProjects (file: string<LocalPath>) (options: seq<string * FSharpProjectOptions>) = | ||
| static member GetDependingProjects (file: string<LocalPath>) (snapshots: seq<string * CompilerProjectOption>) = |
Check notice
Code scanning / Ionide.Analyzers.Cli
Detect if generic type should be in the postfix position.
| type SymbolDeclarationLocation = | ||
| | CurrentDocument | ||
| | Projects of FSharpProjectOptions list * isLocalForProject: bool | ||
| | Projects of CompilerProjectOption list * isLocalForProject: bool |
Check notice
Code scanning / Ionide.Analyzers.Cli
Verifies each field in a union case is named.
43076cc to
ae52948
Compare
|
Ok I think this is finally ready. This can now be turned on/off so we can merge safely without fear of being able to use the old stuff since transparent compiler may still have issues that we have no control of directly. |
8e6b98e to
8696c11
Compare
|
Ok, I'd be a fan of merging this into the nightly branch and playing with it for a while. |
Unfortunately there isn't a way to add generic parameters via Ionide. (means that should get added at some point). I do have a PR available in Ionide to add it but you'll have to build a run a custom version of Ionide to access the setting.
Are you sure that actually works? I'm only using |
|
|
baronfel
left a comment
There was a problem hiding this comment.
Left a few notes and a couple questions as I was reading through this.
I'm surprised by how understandable this was, despite the large amount of changes. I think this says a lot about the comments you left and the places you unified previous logic.
| let! ct = CancellableTask.getCancellationToken () | ||
| let inner = mapping i ct | ||
| return inner | ||
| RefCountingTaskCreator(fun ct -> |
There was a problem hiding this comment.
is this the same throughout this file? moving from cancellableTask to task for better stack traces?
There was a problem hiding this comment.
Yeah I need to rundown why I was still getting weird stacktraces but I'll do that later.
| /// <summary> | ||
| /// An awaitable wrapper around a task whose result is disposable. The wrapper is not disposable, so this prevents usage errors like "use _lock = myAsync()" when the appropriate usage should be "use! _lock = myAsync())". | ||
| /// </summary> | ||
| [<Struct>] |
There was a problem hiding this comment.
beautiful type - thanks for this
|
|
||
| let runAnalyzers (config: FSharpConfig) (parseAndCheck: ParseAndCheckResults) (volatileFile: VolatileFile) = | ||
| async { | ||
| asyncEx { |
There was a problem hiding this comment.
should the direct use of async be a code smell for us now?
There was a problem hiding this comment.
Probably, though we can make additional PRs to hit all those places.
|
|
||
|
|
||
| let compilers = | ||
| match getEnvVarAsStr "USE_TRANSPARENT_COMPILER" with |
There was a problem hiding this comment.
@TheAngryByrd, hmm, ok now I'm doubting whether that did work or not.
It might not have and I was seeing things
There was a problem hiding this comment.
So, I hardcoded the useTransparentCompiler to true locally and I remain with my past statements: all goes well for me, ship it.
Co-authored-by: Chet Husk <baronfel@users.noreply.github.com>
Co-authored-by: Chet Husk <baronfel@users.noreply.github.com>

Adds support for Transparent Compiler in FSAC.