Skip to content
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

Added parallelization options to VS #14022

Merged
merged 3 commits into from
Oct 4, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,39 @@ type internal FSharpWorkspaceServiceFactory
match checkerSingleton with
| Some _ -> ()
| _ ->
let checker =
let checker =
lazy
let checker =
let editorOptions =
let editorOptions = workspace.Services.GetService<EditorOptions>()

match box editorOptions with
vzarytovskii marked this conversation as resolved.
Show resolved Hide resolved
| null -> None
| _ -> Some editorOptions

let enableParallelCheckingWithSignatureFiles =
editorOptions
|> Option.map (fun options -> options.LanguageServicePerformance.EnableParallelCheckingWithSignatureFiles)
|> Option.defaultValue false

let enableParallelReferenceResolution =
editorOptions
|> Option.map (fun options -> options.LanguageServicePerformance.EnableParallelReferenceResolution)
|> Option.defaultValue false

let checker =
FSharpChecker.Create(
projectCacheSize = 5000, // We do not care how big the cache is. VS will actually tell FCS to clear caches, so this is fine.
projectCacheSize = 5000, // We do not care how big the cache is. VS will actually tell FCS to clear caches, so this is fine.
keepAllBackgroundResolutions = false,
legacyReferenceResolver=LegacyMSBuildReferenceResolver.getResolver(),
tryGetMetadataSnapshot = tryGetMetadataSnapshot,
keepAllBackgroundSymbolUses = false,
enableBackgroundItemKeyStoreAndSemanticClassification = true,
enablePartialTypeChecking = true)
checker
checkerSingleton <- Some checker
)
enablePartialTypeChecking = true,
enableParallelCheckingWithSignatureFiles = enableParallelCheckingWithSignatureFiles,
parallelReferenceResolution = enableParallelReferenceResolution)
checker
checkerSingleton <- Some checker
)

let optionsManager =
lazy
Expand Down
8 changes: 6 additions & 2 deletions vsintegration/src/FSharp.Editor/Options/EditorOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@ type LanguageServicePerformanceOptions =
{ EnableInMemoryCrossProjectReferences: bool
AllowStaleCompletionResults: bool
TimeUntilStaleCompletion: int
ProjectCheckCacheSize: int }
ProjectCheckCacheSize: int
EnableParallelCheckingWithSignatureFiles: bool
EnableParallelReferenceResolution: bool }
static member Default =
{ EnableInMemoryCrossProjectReferences = true
AllowStaleCompletionResults = true
TimeUntilStaleCompletion = 2000 // In ms, so this is 2 seconds
ProjectCheckCacheSize = 200 }
ProjectCheckCacheSize = 200
EnableParallelCheckingWithSignatureFiles = false
EnableParallelReferenceResolution = false }

[<CLIMutable>]
type CodeLensOptions =
Expand Down
15 changes: 15 additions & 0 deletions vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,19 @@
<InternalsVisibleTo Include="VisualFSharp.UnitTests" />
</ItemGroup>

<ItemGroup>
<Compile Update="Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Header="{x:Static local:Strings.Parallelization}">
<StackPanel>
<CheckBox x:Name="enableParallelCheckingWithSignatureFiles"
IsChecked="{Binding EnableParallelCheckingWithSignatureFiles}"
Content="{x:Static local:Strings.Enable_Parallel_Checking_With_Signature_Files}"/>
<CheckBox x:Name="enableParallelReferenceResolution"
IsChecked="{Binding EnableParallelReferenceResolution}"
Content="{x:Static local:Strings.Enable_Parallel_Reference_Resolution}"/>
</StackPanel>
</GroupBox>
</StackPanel>
</ScrollViewer>
</Grid>
Expand Down
31 changes: 29 additions & 2 deletions vsintegration/src/FSharp.UIResources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions vsintegration/src/FSharp.UIResources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,13 @@
<data name="Diagnostics" xml:space="preserve">
<value>Diagnostics</value>
</data>
<data name="Parallelization" xml:space="preserve">
<value>Parallelization (requires restart)</value>
</data>
<data name="Enable_Parallel_Checking_With_Signature_Files" xml:space="preserve">
<value>Enable parallel type checking with signature files</value>
</data>
<data name="Enable_Parallel_Reference_Resolution" xml:space="preserve">
<value>Enable parallel reference resolution</value>
</data>
</root>
15 changes: 15 additions & 0 deletions vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
<target state="translated">Diagnostika</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Checking_With_Signature_Files">
<source>Enable parallel type checking with signature files</source>
<target state="new">Enable parallel type checking with signature files</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Reference_Resolution">
<source>Enable parallel reference resolution</source>
<target state="new">Enable parallel reference resolution</target>
<note />
</trans-unit>
<trans-unit id="Language_Service_Performance">
<source>Performance</source>
<target state="translated">Výkon</target>
Expand All @@ -67,6 +77,11 @@
<target state="translated">Navigační odkazy</target>
<note />
</trans-unit>
<trans-unit id="Parallelization">
<source>Parallelization (requires restart)</source>
<target state="new">Parallelization (requires restart)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">
<source>Show s_ymbols in unopened namespaces</source>
<target state="translated">Zobrazit s_ymboly v neotevřených oborech názvů</target>
Expand Down
15 changes: 15 additions & 0 deletions vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
<target state="translated">Diagnose</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Checking_With_Signature_Files">
<source>Enable parallel type checking with signature files</source>
<target state="new">Enable parallel type checking with signature files</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Reference_Resolution">
<source>Enable parallel reference resolution</source>
<target state="new">Enable parallel reference resolution</target>
<note />
</trans-unit>
<trans-unit id="Language_Service_Performance">
<source>Performance</source>
<target state="translated">Leistung</target>
Expand All @@ -67,6 +77,11 @@
<target state="translated">Navigationslinks</target>
<note />
</trans-unit>
<trans-unit id="Parallelization">
<source>Parallelization (requires restart)</source>
<target state="new">Parallelization (requires restart)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">
<source>Show s_ymbols in unopened namespaces</source>
<target state="translated">S_ymbole in nicht geöffneten Namespaces anzeigen</target>
Expand Down
15 changes: 15 additions & 0 deletions vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
<target state="translated">Diagnóstico</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Checking_With_Signature_Files">
<source>Enable parallel type checking with signature files</source>
<target state="new">Enable parallel type checking with signature files</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Reference_Resolution">
<source>Enable parallel reference resolution</source>
<target state="new">Enable parallel reference resolution</target>
<note />
</trans-unit>
<trans-unit id="Language_Service_Performance">
<source>Performance</source>
<target state="translated">Rendimiento</target>
Expand All @@ -67,6 +77,11 @@
<target state="translated">Vínculos de navegación</target>
<note />
</trans-unit>
<trans-unit id="Parallelization">
<source>Parallelization (requires restart)</source>
<target state="new">Parallelization (requires restart)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">
<source>Show s_ymbols in unopened namespaces</source>
<target state="translated">Mostrar sím_bolos en espacios de nombres sin abrir</target>
Expand Down
15 changes: 15 additions & 0 deletions vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
<target state="translated">Diagnostics</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Checking_With_Signature_Files">
<source>Enable parallel type checking with signature files</source>
<target state="new">Enable parallel type checking with signature files</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Reference_Resolution">
<source>Enable parallel reference resolution</source>
<target state="new">Enable parallel reference resolution</target>
<note />
</trans-unit>
<trans-unit id="Language_Service_Performance">
<source>Performance</source>
<target state="translated">Performances</target>
Expand All @@ -67,6 +77,11 @@
<target state="translated">Liens de navigation</target>
<note />
</trans-unit>
<trans-unit id="Parallelization">
<source>Parallelization (requires restart)</source>
<target state="new">Parallelization (requires restart)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">
<source>Show s_ymbols in unopened namespaces</source>
<target state="translated">Afficher les sym_boles dans les espaces de noms non ouverts</target>
Expand Down
15 changes: 15 additions & 0 deletions vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
<target state="translated">Diagnostica</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Checking_With_Signature_Files">
<source>Enable parallel type checking with signature files</source>
<target state="new">Enable parallel type checking with signature files</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Reference_Resolution">
<source>Enable parallel reference resolution</source>
<target state="new">Enable parallel reference resolution</target>
<note />
</trans-unit>
<trans-unit id="Language_Service_Performance">
<source>Performance</source>
<target state="translated">Prestazioni</target>
Expand All @@ -67,6 +77,11 @@
<target state="translated">Collegamenti di navigazione</target>
<note />
</trans-unit>
<trans-unit id="Parallelization">
<source>Parallelization (requires restart)</source>
<target state="new">Parallelization (requires restart)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">
<source>Show s_ymbols in unopened namespaces</source>
<target state="translated">Mostra si_mboli in spazi dei nomi non aperti</target>
Expand Down
15 changes: 15 additions & 0 deletions vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
<target state="translated">診断</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Checking_With_Signature_Files">
<source>Enable parallel type checking with signature files</source>
<target state="new">Enable parallel type checking with signature files</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Reference_Resolution">
<source>Enable parallel reference resolution</source>
<target state="new">Enable parallel reference resolution</target>
<note />
</trans-unit>
<trans-unit id="Language_Service_Performance">
<source>Performance</source>
<target state="translated">パフォーマンス</target>
Expand All @@ -67,6 +77,11 @@
<target state="translated">ナビゲーション リンク</target>
<note />
</trans-unit>
<trans-unit id="Parallelization">
<source>Parallelization (requires restart)</source>
<target state="new">Parallelization (requires restart)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">
<source>Show s_ymbols in unopened namespaces</source>
<target state="translated">開かれていない名前空間の記号を表示する(_Y)</target>
Expand Down
15 changes: 15 additions & 0 deletions vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
<target state="translated">진단</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Checking_With_Signature_Files">
<source>Enable parallel type checking with signature files</source>
<target state="new">Enable parallel type checking with signature files</target>
<note />
</trans-unit>
<trans-unit id="Enable_Parallel_Reference_Resolution">
<source>Enable parallel reference resolution</source>
<target state="new">Enable parallel reference resolution</target>
<note />
</trans-unit>
<trans-unit id="Language_Service_Performance">
<source>Performance</source>
<target state="translated">성능</target>
Expand All @@ -67,6 +77,11 @@
<target state="translated">탐색 링크</target>
<note />
</trans-unit>
<trans-unit id="Parallelization">
<source>Parallelization (requires restart)</source>
<target state="new">Parallelization (requires restart)</target>
<note />
</trans-unit>
<trans-unit id="Show_all_symbols">
<source>Show s_ymbols in unopened namespaces</source>
<target state="translated">열려 있지 않은 네임스페이스에 기호 표시(_Y)</target>
Expand Down
Loading