From f4829aaaf6ba1ce491502ea2a9b78858d8117295 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 19 Apr 2023 15:43:22 +0200 Subject: [PATCH 1/3] Make in-memory cross-project references the only option (by removing the switch) --- .../FSharpProjectOptionsManager.fs | 38 ++++++++----------- .../LanguageService/LanguageService.fs | 4 -- .../FSharp.Editor/Options/EditorOptions.fs | 5 --- ...nguageServicePerformanceOptionControl.xaml | 4 -- 4 files changed, 16 insertions(+), 35 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index a5b6f2a44c2..78075b7048b 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -85,13 +85,8 @@ module private FSharpProjectOptionsHelpers = let v2 = p2.GetDependentVersionAsync(ct).Result v1 <> v2)) - let isProjectInvalidated (oldProject: Project) (newProject: Project) ct = - let hasProjectVersionChanged = hasProjectVersionChanged oldProject newProject - - if newProject.AreFSharpInMemoryCrossProjectReferencesEnabled then - hasProjectVersionChanged || hasDependentVersionChanged oldProject newProject ct - else - hasProjectVersionChanged + let inline isProjectInvalidated (oldProject: Project) (newProject: Project) ct = + hasProjectVersionChanged oldProject newProject || hasDependentVersionChanged oldProject newProject ct [] type private FSharpProjectOptionsMessage = @@ -276,21 +271,20 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = let referencedProjects = ResizeArray() - if project.AreFSharpInMemoryCrossProjectReferencesEnabled then - for projectReference in project.ProjectReferences do - let referencedProject = project.Solution.GetProject(projectReference.ProjectId) - - if referencedProject.Language = FSharpConstants.FSharpLanguageName then - match! tryComputeOptions referencedProject ct with - | None -> canBail <- true - | Some (_, projectOptions) -> - referencedProjects.Add( - FSharpReferencedProject.CreateFSharp(referencedProject.OutputFilePath, projectOptions) - ) - elif referencedProject.SupportsCompilation then - let! comp = referencedProject.GetCompilationAsync(ct) |> Async.AwaitTask - let peRef = createPEReference referencedProject comp - referencedProjects.Add(peRef) + for projectReference in project.ProjectReferences do + let referencedProject = project.Solution.GetProject(projectReference.ProjectId) + + if referencedProject.Language = FSharpConstants.FSharpLanguageName then + match! tryComputeOptions referencedProject ct with + | None -> canBail <- true + | Some (_, projectOptions) -> + referencedProjects.Add( + FSharpReferencedProject.CreateFSharp(referencedProject.OutputFilePath, projectOptions) + ) + elif referencedProject.SupportsCompilation then + let! comp = referencedProject.GetCompilationAsync(ct) |> Async.AwaitTask + let peRef = createPEReference referencedProject comp + referencedProjects.Add(peRef) if canBail then return None diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 6f63b565f0e..be378e972e8 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -126,9 +126,6 @@ type internal FSharpWorkspaceServiceFactory [] type LanguageServicePerformanceOptions = { - EnableInMemoryCrossProjectReferences: bool AllowStaleCompletionResults: bool TimeUntilStaleCompletion: int EnableParallelReferenceResolution: bool @@ -89,7 +88,6 @@ type LanguageServicePerformanceOptions = static member Default = { - EnableInMemoryCrossProjectReferences = true AllowStaleCompletionResults = true TimeUntilStaleCompletion = 2000 // In ms, so this is 2 seconds EnableParallelReferenceResolution = false @@ -217,9 +215,6 @@ module EditorOptionsExtensions = member private this.EditorOptions = this.Solution.Workspace.Services.GetService() - member this.AreFSharpInMemoryCrossProjectReferencesEnabled = - this.EditorOptions.LanguageServicePerformance.EnableInMemoryCrossProjectReferences - member this.IsFSharpCodeFixesAlwaysPlaceOpensAtTopLevelEnabled = this.EditorOptions.CodeFixes.AlwaysPlaceOpensAtTopLevel diff --git a/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml b/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml index 64714ca418d..4642e2f9c10 100644 --- a/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml +++ b/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml @@ -19,10 +19,6 @@ - From d9628c275709ab675660d0068c109d8905ced090 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 19 Apr 2023 17:12:42 +0200 Subject: [PATCH 2/3] Cleanup translations --- .../src/FSharp.UIResources/Strings.Designer.cs | 18 ------------------ .../src/FSharp.UIResources/Strings.resx | 6 ------ .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 10 ---------- .../src/FSharp.UIResources/xlf/Strings.de.xlf | 10 ---------- .../src/FSharp.UIResources/xlf/Strings.es.xlf | 10 ---------- .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 10 ---------- .../src/FSharp.UIResources/xlf/Strings.it.xlf | 10 ---------- .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 10 ---------- .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 10 ---------- .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 10 ---------- .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 10 ---------- .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 10 ---------- .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 10 ---------- .../FSharp.UIResources/xlf/Strings.zh-Hans.xlf | 10 ---------- .../FSharp.UIResources/xlf/Strings.zh-Hant.xlf | 10 ---------- 15 files changed, 154 deletions(-) diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index 1cafe38a4f0..1708adc1c27 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -132,15 +132,6 @@ public static string Enable_Fast_Find_References { } } - /// - /// Looks up a localized string similar to _Enable in-memory cross project references. - /// - public static string Enable_in_memory_cross_project_references { - get { - return ResourceManager.GetString("Enable_in_memory_cross_project_references", resourceCulture); - } - } - /// /// Looks up a localized string similar to Use live (unsaved) buffers for checking (restart required). /// @@ -456,15 +447,6 @@ public static string Time_until_stale_completion { } } - /// - /// Looks up a localized string similar to In-memory cross-project references store project-level data in memory to allow IDE features to work across projects.. - /// - public static string Tooltip_in_memory_cross_project_references { - get { - return ResourceManager.GetString("Tooltip_in_memory_cross_project_references", resourceCulture); - } - } - /// /// Looks up a localized string similar to Format signature to the given width by adding line breaks conforming with F# syntax rules. . /// diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index 8036c30d271..f7f87534ac6 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -147,9 +147,6 @@ _Show completion list after a character is typed - - _Enable in-memory cross project references - S_how navigation links as @@ -195,9 +192,6 @@ Enable stale data for IntelliSense features - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - Always add new line on enter diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index c8518ec15ea..5035800a03b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -127,11 +127,6 @@ _Zobrazovat seznam dokončení po zadání znaku - - _Enable in-memory cross project references - _Povolit odkazy mezi projekty v paměti - - S_how navigation links as Zo_brazit navigační odkazy jako @@ -207,11 +202,6 @@ Povolit zastaralá data pro funkce IntelliSense - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - V odkazech v paměti pro různé projekty jsou uložená data na úrovni projektů, aby mohly mezi projekty fungovat funkce IDE. - - Always add new line on enter Při stisku Enter vždy přidat nový řádek diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index a5242f6b03c..0ca429bced4 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -127,11 +127,6 @@ _Vervoll­ständigungsliste nach Eingabe eines Zeichens anzeigen - - _Enable in-memory cross project references - Proj_ektübergreifende Verweise im Arbeitsspeicher aktivieren - - S_how navigation links as Navigationslink_s anzeigen als @@ -207,11 +202,6 @@ Veraltete Daten für IntelliSense-Features aktivieren - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - Bei projektübergreifenden In-Memory-Verweisen werden Daten auf Projektebene im Arbeitsspeicher abgelegt, damit IDE-Features projektübergreifend verwendet werden können. - - Always add new line on enter Nach Drücken der EINGABETASTE immer neue Zeile hinzufügen diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 907812312da..dea7e11508b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -127,11 +127,6 @@ _Mostrar lista de finalización después de escribir un carácter - - _Enable in-memory cross project references - _Habilitar referencias entre proyectos en memoria - - S_how navigation links as M_ostrar vínculos de navegación como @@ -207,11 +202,6 @@ Habilitar datos obsoletos para características de IntelliSense - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - Las referencias en memoria entre proyectos almacenan los datos de nivel de proyecto en memoria para permitir que las características del IDE funcionen de unos proyectos a otros. - - Always add new line on enter Siempre agregar una nueva línea al pulsar Intro diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 1947b681c18..056366ae465 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -127,11 +127,6 @@ _Afficher la liste de saisie semi-automatique après la saisie d'un caractère - - _Enable in-memory cross project references - _Activer les références de projet croisé en mémoire - - S_how navigation links as Affic_her les liens de navigation en tant que @@ -207,11 +202,6 @@ Activer les données périmées pour les fonctionnalités IntelliSense - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - Les références inter-projets en mémoire stockent les données de niveau projet dans la mémoire pour permettre aux fonctionnalités de l'IDE de fonctionner sur plusieurs projets. - - Always add new line on enter Toujours ajouter une nouvelle ligne en appuyant sur Entrée diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index b10835d5a01..34169833d7c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -127,11 +127,6 @@ Mo_stra elenco di completamento dopo la digitazione di un carattere - - _Enable in-memory cross project references - _Abilita i riferimenti tra progetti in memoria - - S_how navigation links as M_ostra collegamenti di navigazione come @@ -207,11 +202,6 @@ Abilita dati non aggiornati per le funzionalità IntelliSense - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - I riferimenti tra progetti in memoria consentono di archiviare in memoria i dati a livello di progetto per consentire l'uso di funzionalità IDE tra progetti. - - Always add new line on enter Aggiungi sempre una nuova riga dopo INVIO diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 01e908209eb..c2997864851 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -127,11 +127,6 @@ 文字が入力された後に入力候補一覧を表示する(_S) - - _Enable in-memory cross project references - メモリ内のプロジェクト間参照を有効にする(_E) - - S_how navigation links as 次としてナビゲーション リンクを表示する(_H) @@ -207,11 +202,6 @@ IntelliSense 機能に対して古いデータを有効にする - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - メモリ内のプロジェクト間参照に、プロジェクトをまたいで IDE 機能を動作可能にするプロジェクト レベルのデータが格納されます。 - - Always add new line on enter Enter を押すと常に新しい行を追加します diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 4f70ec137f6..16cce4abb6d 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -127,11 +127,6 @@ 문자를 입력하면 완성 목록 표시(_S) - - _Enable in-memory cross project references - 메모리 내 크로스 프로젝트 참조 사용(_E) - - S_how navigation links as 탐색 링크를 다음으로 표시(_H) @@ -207,11 +202,6 @@ IntelliSense 기능에 대해 부실 데이터 사용 - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - 메모리 내 크로스 프로젝트 참조가 메모리에 프로젝트 수준 데이터를 저장하여 IDE 기능이 프로젝트에서 작동하도록 합니다. - - Always add new line on enter 입력 시 새 줄 항상 추가 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 3a0047883c1..464a45a0790 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -127,11 +127,6 @@ _Pokaż listę uzupełniania po wpisaniu znaku - - _Enable in-memory cross project references - _Włącz odwołania między projektami w pamięci - - S_how navigation links as P_okaż linki nawigacyjne jako @@ -207,11 +202,6 @@ Włącz dane nieodświeżone na potrzeby funkcji IntelliSense - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - Odwołania między projektami w pamięci przechowują dane na poziomie projektu w pamięci, aby umożliwić funkcjom środowiska IDE działanie w wielu projektach. - - Always add new line on enter Zawsze dodawaj nowy wiersz po naciśnięciu klawisza Enter diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 0a9e4c48b66..1a70eb3c62f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -127,11 +127,6 @@ _Mostrar lista de conclusão depois que um caractere é digitado - - _Enable in-memory cross project references - _Habilitar referências de projeto cruzado na memória - - S_how navigation links as E_xibir link de navegação como @@ -207,11 +202,6 @@ Habilitar dados obsoletos para os recursos do IntelliSense - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - As referências entre projetos na memória armazenam os dados de nível de projeto na memória para permitir que os recursos do IDE funcionem nos projetos. - - Always add new line on enter Sempre adicionar uma nova linha ao pressionar enter diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 5df9fce3172..bfbddfc12e5 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -127,11 +127,6 @@ _Показывать список завершения после ввода знака - - _Enable in-memory cross project references - _Включить перекрестные ссылки между проектами в памяти - - S_how navigation links as П_оказать ссылки навигации как @@ -207,11 +202,6 @@ Включение устаревших данных для функций IntelliSense - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - Перекрестные ссылки между проектами в памяти хранят данные уровня проекта в памяти, поэтому функции и компоненты IDE могут работать в разных проектах. - - Always add new line on enter Всегда добавлять новую строку при нажатии клавиши ВВОД diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 5216125925c..6f590b99b0f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -127,11 +127,6 @@ Bir karakter yazıldıktan sonra tamamlanma listesini _göster - - _Enable in-memory cross project references - _Bellek içi çapraz proje başvurularını etkinleştir - - S_how navigation links as Gezinti bağlantılarını farklı _göster @@ -207,11 +202,6 @@ IntelliSense özellikleri için eski verileri etkinleştir - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - Bellek içi projeler arası başvurular, IDE özelliklerinin farklı projelerde çalışmasına imkan tanımak için bellekte proje düzeyi veriler depolar. - - Always add new line on enter Enter'a basıldığında her zaman yeni satır ekle diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index a344b87be1b..13caff6cc04 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -127,11 +127,6 @@ 键入字符后显示完成列表(_S) - - _Enable in-memory cross project references - 启用内存中跨项目引用(_E) - - S_how navigation links as 导航链接显示方式(_H) @@ -207,11 +202,6 @@ 针对 IntelliSense 功能启用过时数据 - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - 内存中跨项目引用将项目级数据存储在内存中,让 IDE 功能能够跨项目工作。 - - Always add new line on enter 始终在点击回车时时添加新行 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 80c95f5ecd7..052b9037fbb 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -127,11 +127,6 @@ 輸入一個字元後顯示完成清單(_S) - - _Enable in-memory cross project references - 允許記憶體內跨專案參考(_E) - - S_how navigation links as 顯示導覽連結為(_H) @@ -207,11 +202,6 @@ 為 IntelliSense 功能啟用過時資料 - - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - 記憶體內跨專案參考,會在記憶體中儲存專案等級的資料,以允許 IDE 功能在各專案中皆可運作。 - - Always add new line on enter 一律在按 ENTER 時新增新行 From 82c848fc66a99326c0f7c1cf2f612d6089da7bb0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 16:41:18 +0000 Subject: [PATCH 3/3] Automated command ran: fantomas Co-authored-by: vzarytovskii <1260985+vzarytovskii@users.noreply.github.com> --- .../LanguageService/FSharpProjectOptionsManager.fs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index 78075b7048b..0cf3c14676b 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -86,7 +86,8 @@ module private FSharpProjectOptionsHelpers = v1 <> v2)) let inline isProjectInvalidated (oldProject: Project) (newProject: Project) ct = - hasProjectVersionChanged oldProject newProject || hasDependentVersionChanged oldProject newProject ct + hasProjectVersionChanged oldProject newProject + || hasDependentVersionChanged oldProject newProject ct [] type private FSharpProjectOptionsMessage = @@ -278,9 +279,7 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = match! tryComputeOptions referencedProject ct with | None -> canBail <- true | Some (_, projectOptions) -> - referencedProjects.Add( - FSharpReferencedProject.CreateFSharp(referencedProject.OutputFilePath, projectOptions) - ) + referencedProjects.Add(FSharpReferencedProject.CreateFSharp(referencedProject.OutputFilePath, projectOptions)) elif referencedProject.SupportsCompilation then let! comp = referencedProject.GetCompilationAsync(ct) |> Async.AwaitTask let peRef = createPEReference referencedProject comp