-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize format string parsing #5121
Optimize format string parsing #5121
Conversation
…tring parsing once per file
I'm sceptical.. :) This code will re-allcoate an unevaluated However I do agree that we should do the lines computation only once. FWIW I don't like having
and put the on-demand computation on the implementing side. |
@dsyme wow, thanks, I’m stupid :( I’ll store the lazy in a field. |
The property syntax in F# is too similar to let val declaration, with totally different semantics :( |
The above gif is a very happy case. There are ones when completion after |
Yes, it's a big horrible file. When #4579 gets fixed we should be able to ship the TPSDK as a DLL (and split that thing into multiple files). |
src/fsharp/NameResolution.fs
Outdated
@@ -1521,6 +1525,19 @@ type TcResultsSinkImpl(g, ?source: string) = | |||
let capturedOpenDeclarations = ResizeArray<OpenDeclaration>() | |||
let allowedRange (m:range) = not m.IsSynthetic | |||
|
|||
let formatStringCheckContext = | |||
lazy ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit: no parens needed (though they don't hurt)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this.
This reduces completion time from 6 to 3 seconds on
ProvidedTypes.fs
in https://github.com/fsprojects/FSharp.TypeProviders.SDK/tree/master/tests project.Before
After