Uh oh!
There was an error while loading. Please reload this page.
[Experimental] Sources supplied by VS instead of file system - #14076
Conversation
auduchinok
commented
Oct 12, 2022
@0101 What do you think about having some public API that is similar to |
0101
commented
Oct 12, 2022
@auduchinok yeah I think that could make sense. At the moment it's checking the timestamps a lot. (Not really sure how expensive that is yet.) But I was thinking for it to be pull based, where you can supply a At the same time if a file is changed, you're going to want to have it parsed/checked, so we will know anyway at that point. So the notification API would be more useful non-F#-source dependencies. But I suppose another way could be that you would create an |
auduchinok
commented
Oct 12, 2022
Yes, this is something I had in mind when writing that comment. 🙂 |
Uh oh!
There was an error while loading. Please reload this page.
Option to turn on live buffers via VS F# advanced options
0101
commented
Dec 12, 2022
I'm restarting this effort. Even though it's not really in line with our ultimate goal (immutable snapshot compilations), it can be achieved pretty easily and get functional improvements right away. Renaming especially is quite broken now if you forget to save your files. |
0101
commented
Dec 14, 2022
The included benchmark shows that at least on the FCS level the performance wasn't affected by these changes. (Unfortunately I don't know how to do VS benchmarks yet.) BenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19045.2311)
AMD Ryzen 9 5900X, 1 CPU, 24 logical and 12 physical cores
.NET SDK=7.0.100
[Host] : .NET 7.0.0 (7.0.22.51805), X64 RyuJIT AVX2 DEBUG
Job-GXZWPY : .NET 7.0.0 (7.0.22.51805), X64 RyuJIT AVX2
InvocationCount=1 IterationCount=8 UnrollFactor=1
WarmupCount=1
|
vzarytovskii
commented
Dec 15, 2022
@0101 if the api is experimental/temporary, please mark it with ExperimentalAttribute. |
0101
commented
Dec 15, 2022
That's what I did! |
vzarytovskii
commented
Dec 15, 2022
Oh, my bad - I, as usual, looked only on the implementation file and ignored the signature. |
Uh oh!
There was an error while loading. Please reload this page.
auduchinok
commented
Dec 19, 2022
Could we also notify FCS about referenced assemblies timestamp changes? |
0101
commented
Dec 19, 2022
I'm actually not sure if we could use that to any benefit. Since that info needs to be passed via |
auduchinok
commented
Dec 19, 2022
Assembly timestamps are often checked the same way as sources IIRC, at least it's how it used to be and I don't remember any changes here. Not having to check hundreds of referenced assemblies could be good here. |
0101
commented
Dec 20, 2022
I'd probably try to look at that separately. The goal of this is to make it possible to work with unsaved files in the editor. I don't think there are even any noticeable performance benefits. The filesystem is still pretty fast compared to parsing / checking. |
T-Gro
commented
Dec 28, 2022
Looks good to me. |
Uh oh!
There was an error while loading. Please reload this page.
Added experimental FSharpChecker APIs:
New parameters to
FSharpChecker.CreategetSourcefunctionfilename: string -> ISourceText optionuseChangeNotifications: boolswitchtrue(default isfalse) thenFSharpCheckerwill not be looking at the file system to check file timestamps. Instead it will expectNotifyFileChangedmethod to be called whenever a source file is changed. Or alternatively requesting parsing/checking of a changed file right away.New method
NotifyFileChangeduseChangeNotifications = trueto notify about file updatesNew VS option to use these new APIs
When you opt-in, VS will use Roslyn Document API to supply the source text. Which means it will be coming from live buffers in case of open documents. And it will use the
workspaceChangedevent to notify about file changes, which covers even changes that happen outside VS in the file system, as it already has a watcher for that.Changes to other dependencies that F# source files are handled the same way as before.