From b64141459e78b327e39bf59bd5f57737ce0a6a44 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 8 Feb 2024 04:27:09 -0800 Subject: [PATCH 1/4] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2373271 (#16670) --- .../FSharp.Editor/xlf/FSharp.Editor.de.xlf | 23 ++++---- .../FSharp.Editor/xlf/FSharp.Editor.es.xlf | 31 +++++----- .../FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 41 ++++++------- .../FSharp.Editor/xlf/FSharp.Editor.it.xlf | 37 ++++++------ .../FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 25 ++++---- .../FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 25 ++++---- .../FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 29 +++++----- .../FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 37 ++++++------ .../FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 41 ++++++------- .../FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 21 +++---- .../xlf/FSharp.Editor.zh-Hans.xlf | 57 ++++++++++--------- .../xlf/FSharp.Editor.zh-Hant.xlf | 39 ++++++------- 12 files changed, 208 insertions(+), 198 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index 65760e26e6d..bc05638c6f5 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -174,16 +174,16 @@ Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) - F#-Projekt- und Cacheleistungsoptionen; -Projektübergreifende Verweise im Arbeitsspeicher aktivieren; -Enable_partial_type_checking; -IntelliSense-Leistungsoptionen; + Optionen zur F#-Projekt- und Cacheleistung; +Proj_ektübergreifende Verweise im Arbeitsspeicher aktivieren; +Aktivieren der partiellen Typüberprüfung; +Optionen zur IntelliSense-Leistung; Veraltete Daten für IntelliSense-Features aktivieren; Zeit bis zur Verwendung veralteter Ergebnisse (in Millisekunden); Parallelisierung (Neustart erforderlich); Parallele Typüberprüfung mit Signaturdateien aktivieren; Parallele Verweisauflösung aktivieren; -Schnellsuche und Umbenennen von Verweisen aktivieren (experimentell); +Schnellsuche und Umbenennen von Verweisen aktivieren (Neustart erforderlich); Cacheanalyseergebnisse (experimentell) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - Formatierung; + Formatierung; Bevorzugte Beschreibungsbreite in Zeichen; -Signatur in der angegebenen Breite formatieren, indem Zeilenumbrüche hinzugefügt werden, die den F#-Syntaxregeln entsprechen; +Formatieren Sie die Signatur in der angegebenen Breite, indem Sie Zeilenumbrüche hinzufügen, die F#-Syntaxregeln entsprechen; Navigationslinks; Navigationslinks anzeigen als; -Unterstreichung einfarbig; -Punkt unterstrichen; -Strich unterstrichen; +Durchgezogene Unterstreichung; +Gepunktete Unterstreichung; +Gestrichelte Unterstreichung; +Hinweise in QuickInfo anzeigen Remarks: - Remarks: + Bemerkungen: diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index ab74a46359b..4b789c84545 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -174,19 +174,17 @@ Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) - Opciones de rendimiento de proyectos y caché de F#; -Habilitar referencias cruzadas de proyecto en memoria; + Opciones de rendimiento de almacenamiento en caché y proyectos de F#; +Habilitar referencias entre proyectos en memoria; Enable_partial_type_checking; Opciones de rendimiento de IntelliSense; -Habilitar datos obsoletos para funciones de IntelliSense; +Habilitar datos obsoletos para características de IntelliSense; Tiempo hasta que se utilizan los resultados obsoletos (en milisegundos); -Paralelización (requiere reinicio); - -Habilitar la comprobación paralela de tipos con archivos de firmas; - -Habilitar la resolución de referencias en paralelo; -Habilitar búsqueda rápida de referencias y renombrado (experimental); -Caché de resultados de análisis (experimental) +Paralelización (requiere reiniciar); +Habilitar la comprobación de tipos paralelos con archivos de firma; +Habilitar resolución de referencias paralelas; +Habilitar referencias de búsqueda rápida y cambio de nombre (es necesario reiniciar); +Resultados del análisis de la caché (experimental) @@ -204,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - Formato; -Ancho de descripción preferido en caracteres; -Dar formato a la firma con el ancho dado agregando saltos de línea que cumplan las reglas de sintaxis de F#; + Formateando; +Anchura preferida de la descripción en caracteres; +Da formato a la firma al ancho dado agregando saltos de línea conforme a las reglas de sintaxis de F#; Vínculos de navegación; Mostrar vínculos de navegación como; Subrayado sólido; -Subrayado de punto; -Subrayado de guion; +Subrayado de puntos; +Subrayado guion; +Mostrar comentarios en Información rápida Remarks: - Remarks: + Comentarios: diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index f265c7a3508..93f27375a08 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -174,17 +174,17 @@ Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) - Options de performances du projet F # et de la mise en cache ; -Activer les références de projets croisés en mémoire ; -Enable_partial_type_checking ; -Options de performances IntelliSense ; -Activer les données obsolètes pour les fonctionnalités IntelliSense ; -Temps jusqu'à ce que les résultats obsolètes soient utilisés (en millisecondes) ; -Parallélisation (nécessite un redémarrage) ; -Activer la vérification de type parallèle avec les fichiers de signature ; -Activer la résolution de référence parallèle ; -Activer les références de recherche rapide et renommer (expérimental) ; -Résultats de l'analyse du cache (expérimental) + Options relatives aux performances de la mise en cache et des projets F#; +Activer les références de projet croisé en mémoire; +Enable_partial_type_checking; +Options relatives aux performances d’IntelliSense; +Activer les données périmées pour les fonctionnalités IntelliSense; +Délai avant l’utilisation des résultats périmés (en millisecondes); +Parallélisation (Nécessite un redémarrage); +Activer la vérification de type parallèle avec les fichiers de signature; +Activer la résolution de référence parallèle; +Activer la recherche rapide de références et le renommage (redémarrage requis); +Résultats de l’analyse du cache (expérimental) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - Formatage; -Largeur de description préférée en caractères ; -Mettre en forme la signature à la largeur donnée en ajoutant des sauts de ligne conformes aux règles de syntaxe F# ; -Liens de navigation ; -Afficher les liens de navigation en tant que ; -Soulignement uni ; -Soulignement pointé ; -Soulignement en tirets ; + Mise en forme; +Largeur de description préférée en caractères; +Formatez la signature à la largeur donnée en ajoutant des sauts de ligne conformes aux règles de syntaxe F#; +Liens de navigation; +Afficher les liens de navigation en tant que; +Soulignement avec un trait uni; +Soulignement avec des points; +Soulignement avec des tirets; +Afficher les notes dans Info express Remarks: - Remarks: + Notes : diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index 2346263eb6c..c43e7044b9b 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -174,17 +174,17 @@ Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) - Opzioni prestazioni progetto F# e memorizzazione nella cache; -Abilita riferimenti tra progetti in memoria; -Enable_partial_type_checking; -Opzioni prestazioni IntelliSense; -Abilita dati non aggiornati per le funzionalità di IntelliSense; -Tempo prima dell'utilizzo dei risultati non aggiornati (in millisecondi); + Opzioni per le prestazioni di memorizzazione nella cache e progetti F#; +_Abilita i riferimenti tra progetti in memoria; +Abilita il controllo parziale dei tipi; +Opzioni per le prestazioni IntelliSense; +Abilita dati non aggiornati per le funzionalità IntelliSense; +Intervallo di utilizzo dei risultati non aggiornati (in millisecondi); Parallelizzazione (richiede il riavvio); -Abilita il controllo dei tipi paralleli con i file di firma; -Abilita risoluzione riferimenti paralleli; -Abilita la ricerca rapida dei riferimenti e la ridenominazione (sperimentale); -Memorizza nella cache i risultati dell'analisi (sperimentale) +Abilitare il controllo dei tipi paralleli con i file di firma; +Abilitare risoluzione riferimenti paralleli; +Abilitare i riferimenti di ricerca rapida > ridenominazione (riavvio necessario); +Risultati dell'analisi della cache (sperimentale) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - Formattazione; + Formattazione; Larghezza descrizione preferita in caratteri; -Formatta la firma in base alla larghezza specificata aggiungendo interruzioni di riga conformi alle regole di sintassi F#; -Collegamenti di spostamento; -Mostra collegamenti di spostamento come; -Sottolineatura a tinta unita; -Sottolineatura a punto; -Sottolineatura a trattini; +Consente di formattare la firma in base alla larghezza specificata aggiungendo interruzioni di riga conformi alle regole di sintassi F#; +Collegamenti di navigazione; +Mostra collegamenti di navigazione come; +Sottolineatura continua; +Sottolineatura punto; +Sottolineatura tratteggiata; +Mostra i commenti in Informazioni rapide Remarks: - Remarks: + Note: diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 04a229c98e3..9d9dfb23c2e 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -175,15 +175,15 @@ Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) F# プロジェクトとキャッシュのパフォーマンス オプション; -メモリ内のプロジェクト間参照を有効にする。 +メモリ内のプロジェクト間参照を有効にする; Enable_partial_type_checking; -IntelliSense パフォーマンス オプション; -IntelliSense 機能の古いデータを有効にする。 +IntelliSense のパフォーマンス オプション; +IntelliSense 機能に対して古いデータを有効にする; 古い結果が使用されるまでの時間 (ミリ秒); 並列化 (再起動が必要); -署名ファイルを使用して並列型チェックを有効にする。 +署名ファイルを使用して並列型チェックを有効にする; 並列参照解決を有効にする; -高速検索参照の有効化と名前の変更 (試験段階); +高速検索参照と名前の変更を有効にする (再起動が必要); キャッシュ解析の結果 (試験段階) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - 書式 設定; -希望の説明の幅 (文字数); -F# 構文規則に準拠するよう、改行を追加して指定された幅に署名を書式設定します; + 書式設定; +優先する説明の文字幅; +F# 構文規則に準拠した改行を追加して、署名を指定された幅に書式設定する; ナビゲーション リンク; -ナビゲーション リンクを次のように表示します: -塗りつぶしの下線; +次としてナビゲーション リンクを表示; +実線の下線; ドットの下線; -ダッシュ下線; +破線の下線; +クイック ヒントに注釈を表示する Remarks: - Remarks: + 注釈: diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index d2251deb61a..f5d17cf4c7d 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -175,15 +175,15 @@ Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) F# 프로젝트 및 캐싱 성능 옵션; -메모리 내 프로젝트 간 참조 활성화; +메모리 내 크로스 프로젝트 참조 사용; Enable_partial_type_checking; IntelliSense 성능 옵션; -IntelliSense 기능에 부실 데이터 사용; +IntelliSense 기능에 대해 부실 데이터 사용; 부실 결과가 사용될 때까지의 시간(밀리초); 병렬화(다시 시작 필요); -서명 파일과 함께 병렬 형식 검사 사용; -병렬 참조 확인 사용; -빠른 찾기 참조 및 이름 바꾸기 사용(실험적); +서명 파일로 병렬 유형 검사 사용; +병렬 참조 해상도 사용; +빠른 찾기 참조 및 이름 바꾸기 사용(다시 시작 필요); 캐시 구문 분석 결과(실험적) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - 서식; -기본 설정 문자 설명 너비; -F# 구문 규칙에 맞는 줄바꿈을 추가하여 지정된 너비에 서명 서식 지정; + 서식; +기본 설정 설명 너비(문자); +F# 구문 규칙에 맞는 줄 바꿈을 추가하여 지정된 너비에 시그니처의 서식 지정; 탐색 링크; -탐색 링크 표시 형식; +탐색 링크를 다음으로 표시; 실선 밑줄; -점선 밑줄; -대시 밑줄; +점 밑줄; +대시 밑줄; +요약 정보에 설명 표시 Remarks: - Remarks: + 설명: diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index 6a3347d9bd2..aadc760089a 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -174,17 +174,17 @@ Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) - Opcje wydajności projektów i buforowania języka F#; + Opcje wydajności projektu i buforowania języka F#; Włącz odwołania między projektami w pamięci; -Enable_partial_type_checking; +Włącz_częściową_kontrolę_typu; Opcje wydajności funkcji IntelliSense; -Włącz nieaktualne dane dla funkcji IntelliSense; +Włącz nieaktualne dane na potrzeby funkcji IntelliSense; Czas do użycia nieaktualnych wyników (w milisekundach); Równoległość (wymaga ponownego uruchomienia); -Włącz kontrolę typów równoległych za pomocą plików podpisu; -Włącz rozpoznawanie odwołań równoległych; -Włącz szybkie znajdowanie odwołań i zmianę nazwy (eksperymentalne); -Wyniki analizowania pamięci podręcznej (eksperymentalne) +Włącz równoległą kontrolę typu za pomocą plików sygnatury; +Włącz równoległe rozpoznawanie odwołań; +Włącz szybkie znajdowanie odwołań i zmień nazwę (wymagane ponowne uruchomienie); +Wyniki analizy pamięci podręcznej (eksperymentalne) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - Formatowanie; + Formatowanie; Preferowana szerokość opisu w znakach; Sformatuj sygnaturę na daną szerokość, dodając podziały wierszy zgodne z regułami składni języka F#; -Linki nawigacji; -Pokaż linki nawigacji jako; -Pełne podkreślenie; -Podkreślenie kropką; -Podkreślenie kreską; +Linki nawigacyjne; +Pokaż linki nawigacyjne jako; +Podkreślenie ciągłe; +Podkreślenie z kropek; +Podkreślenie z kresek; +Pokaż uwagi w szybkich informacjach Remarks: - Remarks: + Uwagi: diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index 120d286433d..e52c4a34ea9 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -174,17 +174,17 @@ Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) - Opções de desempenho de projeto e cache do F#; - Habilitar referências de projeto cruzado na memória; - Enable_partial_type_checking; - Opções de desempenho do IntelliSense; - Habilitar dados obsoletos para recursos do IntelliSense; - Tempo até que os resultados obsoletos sejam usados (em milissegundos); - Paralelização (requer reinicialização); - Habilitar a verificação de tipo paralelo com arquivos de assinatura; - Habilitar resolução de referência paralela; - Habilitar referências de localização rápida e renomear (experimental); - Resultados da análise de cache (experimental) + Projeto em F# e opções de desempenho em cache; +_Habilitar referências de projeto cruzado na memória; +Habilitar verificação parcial de tipo; +Opções de desempenho do IntelliSense; +Habilitar dados obsoletos para os recursos do IntelliSense; +Tempo até que os resultados obsoletos sejam utilizados (em milissegundos); +Paralelização (requer reinicialização); +Habilitar a verificação de tipo paralelo com arquivos de assinatura; +Habilitar a resolução de referência paralela; +Habilitar referências de localização rápida e renomear (reinicialização necessária); +Resultados da análise de cache (experimental) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - Formatação; -Largura da descrição preferida em caracteres; -Formate a assinatura para a largura especificada adicionando quebras de linha em conformidade com as regras de sintaxe do F#; + Formatação; +Largura de descrição preferencial em caracteres; +Formate a assinatura para a largura fornecida adicionando quebras de linha em conformidade com as regras de sintaxe de F#; Links de navegação; -Mostrar links de navegação como; +Exibir link de navegação como; Sublinhado sólido; -Ponto sublinhado; -Traço sublinhado; +Sublinhado pontilhado; +Sublinhado tracejado; +Mostrar os comentários nas Informações Rápidas Remarks: - Remarks: + Comentários: diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index 06f6eadd24c..6b67d4dee3e 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -174,17 +174,17 @@ Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) - Параметры производительности проекта F# и кэширования; -Включить перекрестные ссылки проекта в памяти; -Enable_partial_type_checking; -Параметры производительности IntelliSense; -Включить устаревшие данные для функций IntelliSense; -Время до использования устаревших результатов (в миллисекундах); -Параллелизация (требуется перезагрузка); -Включить параллельную проверку типов с файлами подписей; -Включить параллельное эталонное разрешение; -Включить быстрый поиск ссылок и переименование (экспериментально); -Результаты анализа кэша (экспериментально) + Параметры производительности проекта и кэширования F#; +Включить перекрестные ссылки проектов в памяти; +Enable_partial_type_checking; +Параметры производительности IntelliSense; +Включите устаревшие данные для функций IntelliSense; +Время до использования устаревших результатов (в миллисекундах); +Распараллеливание (требуется перезагрузка); +Включить параллельную проверку типов с файлами сигнатур; +Включить параллельное разрешение ссылок; +Включить быстрый поиск ссылок и переименование (требуется перезагрузка); +Результаты анализа кэша (экспериментальная функция) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - Форматирование; -Предпочитаемая ширина описания в символах; -Форматирование подписи до заданной ширины путем добавления разрывов строк в соответствии с правилами синтаксиса F#; -Ссылки навигации; -Показать ссылки навигации как; -Сплошное подчеркивание; -Пунктирное подчеркивание; -Штриховое подчеркивание; + Форматирование; +Предпочтительная ширина описания в символах; +Отформатируйте подпись до заданной ширины, добавив разрывы строк в соответствии с правилами синтаксиса F#; +Навигационные ссылки; +Показывать навигационные ссылки как; +Сплошное подчеркивание; +Точка подчеркивания; +Подчеркивание тире; +Показать заметки в кратких сведениях Remarks: - Remarks: + Комментарии: diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index 93b8cb2cc3e..e943accb2c6 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -174,16 +174,16 @@ Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) - F# Proje ve Önbelleğe Alma Performans Seçenekleri; + F# Proje ve Önbelleğe Alma Performansı Seçenekleri; Bellek içi çapraz proje başvurularını etkinleştir; -Enable_partial_type_checking; +Kısmi_tür_denetlemeyi_etkinleştir; IntelliSense Performans Seçenekleri; IntelliSense özellikleri için eski verileri etkinleştir; -Eski sonuçlar kullanılana kadar geçen süre (milisaniye olarak); +Eski sonuçların kullanılması için geçecek süre (milisaniye cinsinden); Paralelleştirme (yeniden başlatma gerektirir); İmza dosyalarıyla paralel tür denetlemeyi etkinleştir; Paralel başvuru çözümlemeyi etkinleştir; -Başvuruları hızlı bulma ve yeniden adlandırmayı etkinleştir (deneysel) +Başvuruları hızlı bulmayı ve yeniden adlandırmayı etkinleştir (yeniden başlatma gerektirir); Ayrıştırma sonuçlarını önbelleğe al (deneysel) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - Biçimlendirme; + Biçimlendirme; Karakter olarak tercih edilen açıklama genişliği; -F# söz dizimi kurallarına uyan satır sonları ekleyerek imzayı verilen genişliğe biçimlendir; +F# söz dizimi kurallarına uyan satır sonları ekleyerek imzayı belirtilen genişliğe biçimlendir; Gezinti bağlantıları; -Gezinti bağlantılarını şöyle göster; -Düz alt çizgi; +Gezinti bağlantılarını farklı göster; +Kesintisiz alt çizgi; Nokta alt çizgi; -Tire alt çizgisi; +Tire alt çizgi; +Açıklamaları Hızlı Bilgide göster Remarks: - Remarks: + Açıklamalar: diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index 36a50465468..5e7381c2da5 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -43,16 +43,16 @@ Display return type hints (preview); Display inline parameter name hints (preview); Live Buffers; Use live (unsaved) buffers for analysis - 块结构指南; -显示 F# 代码的结构指南; -大纲; -显示 F# 代码的大纲和可折叠节点; -内联提示; -显示内联类型提示(预览); -显示返回类型提示(预览); -显示内联参数名称提示(预览); -实时缓冲区; -使用实时(未保存)缓冲区进行检查 + 块结构指南; +显示 F# 代码的结构指南; +概述; +显示 F# 代码的大纲显示节点和可折叠节点; +内联提示; +显示内联类型提示(预览); +显示返回类型提示(预览); +显示内联参数名称提示(预览版); +实时缓冲区; +使用实时(未保存)缓冲区进行分析 @@ -174,17 +174,17 @@ Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) - F# 项目和缓存性能选项; -启用内存中的跨项目引用; -启用部分类型检查; -IntelliSense 性能选项; -为智能感知功能启用旧数据; -使用陈旧结果的时间(以毫秒为单位); -并行处理(需要重新启动); -使用签名文件进行并行类型检查; -启用并行引用解析; -启用快速查找参考和重命名(实验性); -缓存解析结果(实验性)。 + F# 项目和缓存性能选项; +启用内存中跨项目引用; +Enable_partial_type_checking; +IntelliSense 性能选项; +为 IntelliSense 功能启用过时数据; +使用过时结果前等待的时间(以毫秒计); +并行化(需要重启); +使用签名文件启用并行类型检查; +启用并行引用解析; +启用快速查找引用和重命名(需要重新启动); +缓存分析结果(实验性) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - 格式设置; -首选描述宽度 (以字符为单位); -通过添加符合 F# 语法规则的换行符,将签名格式设置为指定宽度; + 格式设置; +以字符为单位的首选说明宽度; +通过添加符合 F# 语法规则的换行符,将签名设置为给定宽度的格式; 导航链接; -将导航链接显示为; -实心下划线; +导航链接显示方式; +实线下划线; 点下划线; -短划线下划线; +短线下划线; +在快速信息中显示备注 Remarks: - Remarks: + 注解: diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index a855f93cd70..7152105652b 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -174,16 +174,16 @@ Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required); Cache parsing results (experimental) - F# 專案和快取效能選項; -啟用記憶體內跨專案參考; -Enable_partial_type_checking; -IntelliSense 效能選項; -啟用 IntelliSense 功能的過時資料; -使用過時結果之前的時間 (毫秒); -平行化 (需要重新開機); -啟用平行類型檢查與簽章檔案; -啟用平行參考解析; -啟用快速尋找參考和重新命名 (實驗性); + F# 專案與快取效能選項; +允許記憶體內跨專案參考; +啟用部分型別檢查; +IntelliSense 效能選項; +為 IntelliSense 功能啟用過時資料; +使用過時結果前等待的時間 (毫秒); +平行處理 (需要重新啟動); +啟用簽章檔案的平行類型檢查; +啟用平行參考解析; +啟用快速尋找參考和重新命名 (需要重新啟動); 快取剖析結果 (實驗性) @@ -202,19 +202,20 @@ Solid underline; Dot underline; Dash underline; Show remarks in Quick Info - 格式化; -慣用描述寬度 (以字元為單位); -透過新增符合 F# 語法規則的分行符號,將簽章格式設定為指定寬度; -瀏覽連結; -將瀏覽連結顯示為; -實心底線; -點底線; -虛線底線; + 格式化; +慣用説明寬度 (以字元為單位); +透過新增符合 F# 語法規則的分行符號,將簽章格式設定為指定寬度; +導覽連結; +顯示導覽連結為; +實線底線; +點線底線; +虛點底線; +在快速諮詢中顯示備註 Remarks: - Remarks: + 備註: From 57ec474a9c3a6e3a8173cbdb6ecd6d74b0f380f2 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 9 Feb 2024 03:26:00 -0800 Subject: [PATCH 2/4] Update test framework - improve baseline comparison and failure diagnosis (#16669) * Update framework * feedback --- .../BasicGrammarElements/MethodResolution.fs | 21 ++---- .../IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs | 3 +- .../EmittedIL/ByRefTests.fs | 17 ++--- .../CompilerGeneratedAttributeOnAccessors.fs | 14 ++-- .../Interop/StaticsInInterfaces.fs | 15 ++-- tests/FSharp.Test.Utilities/Compiler.fs | 48 +++++++++---- tests/FSharp.Test.Utilities/CompilerAssert.fs | 38 ++++++++++ .../DirectoryAttribute.fs | 2 +- .../FSharp.Test.Utilities.fsproj | 1 + tests/FSharp.Test.Utilities/ILChecker.fs | 23 +++++-- .../FSharp.Test.Utilities/ReflectionHelper.fs | 8 ++- tests/FSharp.Test.Utilities/Utilities.fs | 3 +- .../Compiler/CodeGen/EmittedIL/CeEdiThrow.fs | 3 +- .../Compiler/CodeGen/EmittedIL/Mutation.fs | 30 +++----- .../EmittedIL/ReferenceAssemblyTests.fs | 69 +++++++------------ .../CodeGen/EmittedIL/TaskGeneratedCode.fs | 3 +- 16 files changed, 159 insertions(+), 139 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MethodResolution.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MethodResolution.fs index af9a6eb8d0b..613001af658 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MethodResolution.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MethodResolution.fs @@ -76,8 +76,7 @@ extends [runtime]System.Object } - .method assembly specialname static class [runtime]System.Tuple`2 - get_patternInput@9() cil managed + .method assembly specialname static class [runtime]System.Tuple`2 get_patternInput@9() cil managed { .maxstack 8 @@ -85,8 +84,7 @@ extends [runtime]System.Object IL_0005: ret } - .method assembly specialname static int32 - get_outArg@9() cil managed + .method assembly specialname static int32 get_outArg@9() cil managed { .maxstack 8 @@ -94,8 +92,7 @@ extends [runtime]System.Object IL_0005: ret } - .method assembly specialname static void - set_outArg@9(int32 'value') cil managed + .method assembly specialname static void set_outArg@9(int32 'value') cil managed { .maxstack 8 @@ -104,8 +101,7 @@ extends [runtime]System.Object IL_0006: ret } - .method assembly specialname static class [runtime]System.Tuple`2 - 'get_patternInput@10-1'() cil managed + .method assembly specialname static class [runtime]System.Tuple`2 'get_patternInput@10-1'() cil managed { .maxstack 8 @@ -113,8 +109,7 @@ extends [runtime]System.Object IL_0005: ret } - .method assembly specialname static int32 - 'get_outArg@10-1'() cil managed + .method assembly specialname static int32 'get_outArg@10-1'() cil managed { .maxstack 8 @@ -122,8 +117,7 @@ extends [runtime]System.Object IL_0005: ret } - .method assembly specialname static void - 'set_outArg@10-1'(int32 'value') cil managed + .method assembly specialname static void 'set_outArg@10-1'(int32 'value') cil managed { .maxstack 8 @@ -174,8 +168,7 @@ extends [runtime]System.Object .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 4 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs index 7a5b9991113..d3d7be2cf36 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -723,8 +723,7 @@ let main _ = |> shouldSucceed |> verifyIL [ """ - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 - '|GoodPotato|_|'<(class [Potato]Potato.Lib/IPotato`1) T>(!!T x) cil managed + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 '|GoodPotato|_|'<(class [Potato]Potato.Lib/IPotato`1) T>(!!T x) cil managed { .maxstack 8 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ByRefTests.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ByRefTests.fs index 2cd6057ac66..133e67e45a7 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ByRefTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ByRefTests.fs @@ -325,8 +325,7 @@ type C() = extends [System.Runtime]System.Attribute { .custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .method public specialname rtspecialname - instance void .ctor() cil managed + .method public specialname rtspecialname instance void .ctor() cil managed { .custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [netstandard]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -366,8 +365,7 @@ type C() = .get instance int32& modreq([netstandard]System.Runtime.InteropServices.InAttribute) System.Runtime.CompilerServices.C::get_X() }""" - let verifyMethod = """.method public hidebysig specialname instance int32& modreq([netstandard]System.Runtime.InteropServices.InAttribute) - get_X() cil managed + let verifyMethod = """.method public hidebysig specialname instance int32& modreq([netstandard]System.Runtime.InteropServices.InAttribute) get_X() cil managed { .param [0] .custom instance void System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 )""" @@ -377,8 +375,7 @@ type C() = extends [netstandard]System.Attribute { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) - .method public specialname rtspecialname - instance void .ctor() cil managed + .method public specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 @@ -408,8 +405,7 @@ type C<'T>() = member _.X<'U>(): inref<'T> = &x """ - let verifyMethod = """.method public hidebysig instance !T& modreq([runtime]System.Runtime.InteropServices.InAttribute) - X() cil managed + let verifyMethod = """.method public hidebysig instance !T& modreq([runtime]System.Runtime.InteropServices.InAttribute) X() cil managed { .param [0] .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 )""" @@ -435,8 +431,7 @@ module Test = member _.X<'U>(): inref<'T> = &x """ - let verifyMethod = """.method public hidebysig instance !T& modreq([netstandard]System.Runtime.InteropServices.InAttribute) - X() cil managed + let verifyMethod = """.method public hidebysig instance !T& modreq([netstandard]System.Runtime.InteropServices.InAttribute) X() cil managed { .param [0] .custom instance void System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 )""" @@ -463,7 +458,7 @@ type C<'T>() = X() cil managed { .param [0] - .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 ) """ + .custom instance void [runtime]System.Runtime.CompilerServices.IsReadOnlyAttribute::.ctor() = ( 01 00 00 00 )""" FSharp src |> compile diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompilerGeneratedAttributeOnAccessors.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompilerGeneratedAttributeOnAccessors.fs index b90ad6a95d4..ec17c961cf2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompilerGeneratedAttributeOnAccessors.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CompilerGeneratedAttributeOnAccessors.fs @@ -41,8 +41,7 @@ module ``Auto-generated accessors have CompilerGenerated attribute`` = |> compile |> verifyIL [ """ - .method public hidebysig specialname - instance int32 get_Age() cil managed + .method public hidebysig specialname instance int32 get_Age() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -53,8 +52,7 @@ module ``Auto-generated accessors have CompilerGenerated attribute`` = IL_0006: ret } - .method public hidebysig specialname - instance void set_Age(int32 v) cil managed + .method public hidebysig specialname instance void set_Age(int32 v) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -84,8 +82,7 @@ module ``Auto-generated accessors have CompilerGenerated attribute`` = |> compile |> verifyIL [ """ - .method public specialname static int32 - get_Age() cil managed + .method public specialname static int32 get_Age() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -103,8 +100,7 @@ module ``Auto-generated accessors have CompilerGenerated attribute`` = IL_0016: ret } - .method public specialname static void - set_Age(int32 v) cil managed + .method public specialname static void set_Age(int32 v) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -202,5 +198,5 @@ module ``Let bindings in classes shoulnd't have DebuggerNonUserCodeAttribute`` = """ |> compileAssembly |> getType "Test+User" - |> getPrivateMethod "moo" + |> getPrivateInstanceMethod "moo" |> shouldn't haveAttribute "DebuggerNonUserCodeAttribute" diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs b/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs index 903e7832065..b16f787ba23 100644 --- a/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs +++ b/tests/FSharp.Compiler.ComponentTests/Interop/StaticsInInterfaces.fs @@ -193,8 +193,7 @@ extends [runtime]System.Object implements class [csLib]StaticsInInterfaces.IGetNext`1 { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) - .method public specialname rtspecialname -instance void .ctor() cil managed + .method public specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 @@ -205,8 +204,7 @@ instance void .ctor() cil managed IL_0008: ret } - .method public hidebysig static class StaticsTesting/MyRepeatSequence -'StaticsInInterfaces.IGetNext.Next'(class StaticsTesting/MyRepeatSequence other) cil managed + .method public hidebysig static class StaticsTesting/MyRepeatSequence 'StaticsInInterfaces.IGetNext.Next'(class StaticsTesting/MyRepeatSequence other) cil managed { .override method !0 class [csLib]StaticsInInterfaces.IGetNext`1::Next(!0) @@ -222,8 +220,7 @@ extends [runtime]System.Object implements class [csLib]StaticsInInterfaces.IGetNext`1 { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) - .method public specialname rtspecialname -instance void .ctor() cil managed + .method public specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 @@ -234,8 +231,7 @@ instance void .ctor() cil managed IL_0008: ret } - .method public static class StaticsTesting/MyRepeatSequence2 -Next(class StaticsTesting/MyRepeatSequence2 other) cil managed + .method public static class StaticsTesting/MyRepeatSequence2 Next(class StaticsTesting/MyRepeatSequence2 other) cil managed { .maxstack 8 @@ -243,8 +239,7 @@ Next(class StaticsTesting/MyRepeatSequence2 other) cil managed IL_0001: ret } - .method public hidebysig static class StaticsTesting/MyRepeatSequence2 -'StaticsInInterfaces.IGetNext.Next'(class StaticsTesting/MyRepeatSequence2 other) cil managed + .method public hidebysig static class StaticsTesting/MyRepeatSequence2 'StaticsInInterfaces.IGetNext.Next'(class StaticsTesting/MyRepeatSequence2 other) cil managed { .override method !0 class [csLib]StaticsInInterfaces.IGetNext`1::Next(!0) diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 46462d0a473..c29d0958801 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -207,7 +207,7 @@ module rec Compiler = | Arm = 5 | Arm64 = 6 - let private defaultOptions : string list = [] + let public defaultOptions : string list = [] let normalizePathSeparator (text:string) = text.Replace(@"\", "/") @@ -1112,7 +1112,9 @@ Actual: let private createBaselineErrors (baselineFile: BaselineFile) (actualErrors: string) : unit = printfn $"creating baseline error file for convenience: {baselineFile.FilePath}, expected: {baselineFile.BslSource}" - FileSystem.OpenFileForWriteShim(baselineFile.FilePath).Write(actualErrors) + let file = FileSystem.OpenFileForWriteShim(baselineFile.FilePath) + file.SetLength(0) + file.WriteAllText(actualErrors) let private verifyFSBaseline fs : unit = match fs.Baseline with @@ -1156,6 +1158,18 @@ Actual: | Some p -> func p il | CompilationResult.Failure f -> failwith $"Result should be \"Success\" in order to get IL. Failure: {Environment.NewLine}{f}" + let withILContains expected result : CompilationResult = + match result with + | CompilationResult.Success s -> + match s.OutputPath with + | None -> failwith "Operation didn't produce any output!" + | Some p -> + match ILChecker.verifyILAndReturnActual [] p expected with + | true, _, _ -> result + | false, errorMsg, _actualIL -> CompilationResult.Failure( {s with Output = Some (ExecutionOutput { StdOut = errorMsg; ExitCode = 0; StdErr = "" })} ) + + | CompilationResult.Failure f -> failwith $"Result should be \"Success\" in order to get IL. Failure: {Environment.NewLine}{f}" + let verifyIL = doILCheck ILChecker.checkIL let verifyILNotPresent = doILCheck ILChecker.checkILNotPresent @@ -1170,7 +1184,7 @@ Actual: match baseline.ILBaseline.Content with | Some b -> b | None -> String.Empty - let success, errorMsg, actualIL = ILChecker.verifyILAndReturnActual p expectedIL + let success, errorMsg, actualIL = ILChecker.verifyILAndReturnActual [] p [expectedIL] if not success then // Failed try update baselines if required @@ -1348,7 +1362,6 @@ Actual: if documents <> expectedDocuments then failwith $"Expected documents are different from PDB.\nExpected: %A{expectedDocuments}\nActual: %A{documents}" - let private verifyPdbOptions reader options = for option in options do match option with @@ -1546,8 +1559,6 @@ Actual: let withResult (expectedResult: SimpleErrorInfo ) (result: CompilationResult) : CompilationResult = withResults [expectedResult] result - - module TextBasedDiagnosticAsserts = open FSharp.Compiler.Text.Range @@ -1674,26 +1685,35 @@ Actual: | _ -> failwith "Cannot check exit code on this run result." result - let private checkOutput (category: string) (substring: string) (selector: ExecutionOutput -> string) (result: CompilationResult) : CompilationResult = + let private checkOutputInOrder (category: string) (substrings: string list) (selector: ExecutionOutput -> string) (result: CompilationResult) : CompilationResult = match result.RunOutput with | None -> failwith (sprintf "Execution output is missing cannot check \"%A\"" category) | Some o -> match o with | ExecutionOutput e -> let where = selector e - if not (where.Contains(substring)) then - failwith (sprintf "\nThe following substring:\n %A\nwas not found in the %A\nOutput:\n %A" substring category where) + let mutable searchPos = 0 + for substring in substrings do + match where.IndexOf(substring, searchPos) with + | -1 -> failwith (sprintf "\nThe following substring:\n %A\nwas not found in the %A\nOutput:\n %A" substring category where) + | pos -> searchPos <- pos + substring.Length | _ -> failwith "Cannot check output on this run result." result - let withOutputContains (substring: string) (result: CompilationResult) : CompilationResult = - checkOutput "STDERR/STDOUT" substring (fun o -> o.StdOut + "\n" + o.StdErr) result + let withOutputContainsAllInOrder (substrings: string list) (result: CompilationResult) : CompilationResult = + checkOutputInOrder "STDERR/STDOUT" substrings (fun o -> o.StdOut + "\n" + o.StdErr) result let withStdOutContains (substring: string) (result: CompilationResult) : CompilationResult = - checkOutput "STDOUT" substring (fun o -> o.StdOut) result + checkOutputInOrder "STDOUT" [substring] (fun o -> o.StdOut) result + + let withStdOutContainsAllInOrder (substrings: string list) (result: CompilationResult) : CompilationResult = + checkOutputInOrder "STDOUT" substrings (fun o -> o.StdOut) result + + let withStdErrContainsAllInOrder (substrings: string list) (result: CompilationResult) : CompilationResult = + checkOutputInOrder "STDERR" substrings (fun o -> o.StdErr) result let withStdErrContains (substring: string) (result: CompilationResult) : CompilationResult = - checkOutput "STDERR" substring (fun o -> o.StdErr) result + checkOutputInOrder "STDERR" [substring] (fun o -> o.StdErr) result let private assertEvalOutput (selector: FsiValue -> 'T) (value: 'T) (result: CompilationResult) : CompilationResult = match result.RunOutput with @@ -1752,5 +1772,3 @@ Actual: match hash with | Some h -> h | None -> failwith "Implied signature hash returned 'None' which should not happen" - - \ No newline at end of file diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 7951ba31d5d..f482764de82 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -5,6 +5,7 @@ namespace FSharp.Test #nowarn "57" open System +open System.Globalization open System.IO open System.Text open System.Reflection @@ -24,6 +25,42 @@ open NUnit.Framework open TestFramework open System.Collections.Immutable + +#if !NETCOREAPP +module AssemblyResolver = + + let probingPaths = [| + AppDomain.CurrentDomain.BaseDirectory + Path.GetDirectoryName(typeof.Assembly.Location) + |] + + let addResolver () = + AppDomain.CurrentDomain.add_AssemblyResolve(fun h args -> + let found () = + (probingPaths ) |> Seq.tryPick(fun p -> + try + let name = AssemblyName(args.Name) + let codebase = Path.GetFullPath(Path.Combine(p, name.Name)) + if File.Exists(codebase + ".dll") then + name.CodeBase <- codebase + ".dll" + name.CultureInfo <- Unchecked.defaultof + name.Version <- Unchecked.defaultof + Some (name) + elif File.Exists(codebase + ".exe") then + name.CodeBase <- codebase + ".exe" + name.CultureInfo <- Unchecked.defaultof + name.Version <- Unchecked.defaultof + Some (name) + else None + with | _ -> None + ) + match found() with + | None -> Unchecked.defaultof + | Some name -> Assembly.Load(name) ) + + do addResolver() +#endif + [] type ILVerifier (dllFilePath: string) = @@ -621,6 +658,7 @@ module rec CompilerAssertHelpers = let timeout = 30000 let exitCode, output, errors = Commands.executeProcess (Some fileName) arguments (Path.GetDirectoryName(outputFilePath)) timeout (exitCode, output |> String.concat "\n", errors |> String.concat "\n") + open CompilerAssertHelpers [] diff --git a/tests/FSharp.Test.Utilities/DirectoryAttribute.fs b/tests/FSharp.Test.Utilities/DirectoryAttribute.fs index 5365abdbdb5..c1561fa6c9b 100644 --- a/tests/FSharp.Test.Utilities/DirectoryAttribute.fs +++ b/tests/FSharp.Test.Utilities/DirectoryAttribute.fs @@ -92,7 +92,7 @@ type DirectoryAttribute(dir: string) = FSBaseline = { FilePath = fsOutFilePath; BslSource = fsBslFilePath; Content = fsBslSource } ILBaseline = { FilePath = ilOutFilePath; BslSource = ilBslFilePath; Content = ilBslSource } } - Options = [] + Options = Compiler.defaultOptions OutputType = Library Name = Some filename IgnoreWarnings = false diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 5cfcba98ca7..607d3fb1c4d 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -90,6 +90,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/FSharp.Test.Utilities/ILChecker.fs b/tests/FSharp.Test.Utilities/ILChecker.fs index 8164f876a52..0db96f449ee 100644 --- a/tests/FSharp.Test.Utilities/ILChecker.fs +++ b/tests/FSharp.Test.Utilities/ILChecker.fs @@ -29,12 +29,17 @@ module ILChecker = (fun me -> String.Empty) ) - let private normalizeILText assemblyName (ilCode: string) = + let normalizeILText assemblyName (ilCode: string) = let blockComments = @"/\*(.*?)\*/" let lineComments = @"//(.*?)\r?\n" let lineCommentsEof = @"//(.*?)$" let strings = @"""((\\[^\n]|[^""\n])*)""" let verbatimStrings = @"@(""[^""]*"")+" + let methodSingleLine = "^(\s*\.method.*)(?: \s*)$[\r?\n?]^(\s*\{)" + let methodMultiLine = "^(\s*\.method.*)(?: \s*)$[\r?\n?]^(?: \s*)(.*)\s*$[\r?\n?]^(\s*\{)" + + let normalizeNewLines (text: string) = text.Replace("\r\n", "\n").Replace("\r\n", "\r") + let stripComments (text:string) = Regex.Replace(text, $"{blockComments}|{lineComments}|{lineCommentsEof}|{strings}|{verbatimStrings}", @@ -45,6 +50,11 @@ module ILChecker = me.Value), RegexOptions.Singleline) |> filterSpecialComment + let unifyMethodLine (text:string) = + let text1 = Regex.Replace(text, $"{methodSingleLine}", (fun me -> $"{me.Groups[1].Value}\n{me.Groups[2].Value}"), RegexOptions.Multiline) + let text2 = Regex.Replace(text1, $"{methodMultiLine}", (fun me -> $"{me.Groups[1].Value} {me.Groups[2].Value}\n{me.Groups[3].Value}"), RegexOptions.Multiline) + text2 + let replace input (pattern, replacement: string) = Regex.Replace(input, pattern, replacement, RegexOptions.Singleline) let unifyRuntimeAssemblyName ilCode = @@ -62,8 +72,11 @@ module ILChecker = |> unifyRuntimeAssemblyName |> unifyImageBase - ilCode.Trim() |> stripComments |> unifyingAssemblyNames - + ilCode.Trim() + |> normalizeNewLines + |> stripComments + |> unifyingAssemblyNames + |> unifyMethodLine let private generateIlFile dllFilePath ildasmArgs = let ilFilePath = Path.ChangeExtension(dllFilePath, ".il") @@ -165,8 +178,8 @@ module ILChecker = let verifyIL (dllFilePath: string) (expectedIL: string) = checkIL dllFilePath [expectedIL] - let verifyILAndReturnActual (dllFilePath: string) (expectedIL: string) = - checkILPrim [] dllFilePath [expectedIL] + let verifyILAndReturnActual args dllFilePath expectedIL = + checkILPrim args dllFilePath expectedIL let checkILNotPresent dllFilePath unexpectedIL = let actualIL = generateIL dllFilePath [] diff --git a/tests/FSharp.Test.Utilities/ReflectionHelper.fs b/tests/FSharp.Test.Utilities/ReflectionHelper.fs index c5c5db2ca72..f14d474be56 100644 --- a/tests/FSharp.Test.Utilities/ReflectionHelper.fs +++ b/tests/FSharp.Test.Utilities/ReflectionHelper.fs @@ -33,7 +33,13 @@ let getMethod methodName (ty: Type) = | methodInfo -> methodInfo /// Gets a type's private method -let getPrivateMethod methodName (ty: Type) = +let getPublicInstanceMethod methodName (ty: Type) = + match ty.GetMethod(methodName, BindingFlags.Public ||| BindingFlags.Instance) with + | null -> failwith $"Error: Type did not contain public method %s{methodName}" + | methodInfo -> methodInfo + +/// Gets a type's private method +let getPrivateInstanceMethod methodName (ty: Type) = match ty.GetMethod(methodName, BindingFlags.NonPublic ||| BindingFlags.Instance) with | null -> failwith $"Error: Type did not contain private method %s{methodName}" | methodInfo -> methodInfo diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs index d434d837485..897837c6bce 100644 --- a/tests/FSharp.Test.Utilities/Utilities.fs +++ b/tests/FSharp.Test.Utilities/Utilities.fs @@ -38,6 +38,7 @@ type FactForDESKTOPAttribute() = do base.Skip <- "NETCOREAPP is not supported runtime for this kind of test, it is intended for DESKTOP only" #endif + // This file mimics how Roslyn handles their compilation references for compilation testing module Utilities = @@ -306,7 +307,7 @@ let main argv = 0""" File.WriteAllText(directoryBuildPropsFileName, directoryBuildProps) File.WriteAllText(directoryBuildTargetsFileName, directoryBuildTargets) - let timeout = 30000 + let timeout = 120000 let exitCode, dotnetoutput, dotneterrors = Commands.executeProcess (Some config.DotNetExe) "build" projectDirectory timeout if exitCode <> 0 || errors.Length > 0 then diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs index 85108186587..cf9f65fecbb 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/CeEdiThrow.fs @@ -29,8 +29,7 @@ let foo = Try(){ """, (fun verifier -> verifier.VerifyIL [ """ - .method public strict virtual instance int32 - Invoke(class [runtime]System.Exception _arg1) cil managed + .method public strict virtual instance int32 Invoke(class [runtime]System.Exception _arg1) cil managed { .maxstack 5 diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs index d2f071fcb04..2f7eb6de700 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs @@ -56,8 +56,7 @@ x.ToString() """, (fun verifier -> verifier.VerifyIL [ """ - .method public specialname static valuetype [mscorlib]System.TimeSpan - get_x() cil managed + .method public specialname static valuetype [mscorlib]System.TimeSpan get_x() cil managed { .maxstack 8 @@ -106,8 +105,7 @@ x.Day """, (fun verifier -> verifier.VerifyIL [ """ - .method public specialname static valuetype [mscorlib]System.DateTime - get_x() cil managed + .method public specialname static valuetype [mscorlib]System.DateTime get_x() cil managed { .maxstack 8 @@ -155,8 +153,7 @@ x.ToString() """, (fun verifier -> verifier.VerifyIL [ """ - .method public specialname static valuetype [mscorlib]System.Decimal - get_x() cil managed + .method public specialname static valuetype [mscorlib]System.Decimal get_x() cil managed { .maxstack 8 @@ -221,8 +218,7 @@ type StaticC() = .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) .field assembly int32 x .custom instance void [FSharp.Core]Microsoft.FSharp.Core.VolatileFieldAttribute::.ctor() = ( 01 00 00 00 ) - .method public specialname rtspecialname - instance void .ctor() cil managed + .method public specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 @@ -237,8 +233,7 @@ type StaticC() = IL_0011: ret } - .method public hidebysig specialname - instance int32 get_X() cil managed + .method public hidebysig specialname instance int32 get_X() cil managed { .maxstack 8 @@ -248,8 +243,7 @@ type StaticC() = IL_0008: ret } - .method public hidebysig specialname - instance void set_X(int32 v) cil managed + .method public hidebysig specialname instance void set_X(int32 v) cil managed { .maxstack 8 @@ -275,8 +269,7 @@ type StaticC() = .field static assembly int32 x .custom instance void [FSharp.Core]Microsoft.FSharp.Core.VolatileFieldAttribute::.ctor() = ( 01 00 00 00 ) .field static assembly int32 init@10 - .method public specialname rtspecialname - instance void .ctor() cil managed + .method public specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 @@ -287,8 +280,7 @@ type StaticC() = IL_0008: ret } - .method public specialname static int32 - get_X() cil managed + .method public specialname static int32 get_X() cil managed { .maxstack 8 @@ -309,8 +301,7 @@ type StaticC() = IL_001c: ret } - .method public specialname static void - set_X(int32 v) cil managed + .method public specialname static void set_X(int32 v) cil managed { .maxstack 8 @@ -332,8 +323,7 @@ type StaticC() = IL_001d: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 8 diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs index b20315ffce3..0a932212df8 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs @@ -757,8 +757,7 @@ type [] MySecondRecord = { Name: string } .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoComparisonAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoEqualityAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) - .method public hidebysig specialname instance string - get_Name() cil managed + .method public hidebysig specialname instance string get_Name() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -768,8 +767,7 @@ type [] MySecondRecord = { Name: string } IL_0001: throw } - .method public hidebysig specialname instance void - set_Name(string 'value') cil managed + .method public hidebysig specialname instance void set_Name(string 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -779,8 +777,7 @@ type [] MySecondRecord = { Name: string } IL_0001: throw } - .method public specialname rtspecialname - instance void .ctor(string name) cil managed + .method public specialname rtspecialname instance void .ctor(string name) cil managed { .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, class [runtime]System.Type) = ( 01 00 60 06 00 00 20 4E 65 74 37 46 53 68 61 72 @@ -792,8 +789,7 @@ type [] MySecondRecord = { Name: string } IL_0001: throw } - .method public specialname rtspecialname - instance void .ctor() cil managed + .method public specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 @@ -801,8 +797,7 @@ type [] MySecondRecord = { Name: string } IL_0001: throw } - .method public strict virtual instance string - ToString() cil managed + .method public strict virtual instance string ToString() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -827,8 +822,7 @@ type [] MySecondRecord = { Name: string } .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoComparisonAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoEqualityAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) - .method public hidebysig specialname instance string - get_Name() cil managed + .method public hidebysig specialname instance string get_Name() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -838,8 +832,7 @@ type [] MySecondRecord = { Name: string } IL_0001: throw } - .method public hidebysig specialname instance void - set_Name(string 'value') cil managed + .method public hidebysig specialname instance void set_Name(string 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -849,8 +842,7 @@ type [] MySecondRecord = { Name: string } IL_0001: throw } - .method public specialname rtspecialname - instance void .ctor(string name) cil managed + .method public specialname rtspecialname instance void .ctor(string name) cil managed { .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, class [runtime]System.Type) = ( 01 00 60 06 00 00 20 4E 65 74 37 46 53 68 61 72 @@ -862,8 +854,7 @@ type [] MySecondRecord = { Name: string } IL_0001: throw } - .method public specialname rtspecialname - instance void .ctor() cil managed + .method public specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 @@ -871,8 +862,7 @@ type [] MySecondRecord = { Name: string } IL_0001: throw } - .method public strict virtual instance string - ToString() cil managed + .method public strict virtual instance string ToString() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -1170,8 +1160,7 @@ type Person(name : string, age : int) = .custom instance void [FSharp.Core]Microsoft.FSharp.Core.SealedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) .field assembly bool smth - .method public specialname rtspecialname - instance void .ctor(bool smth) cil managed + .method public specialname rtspecialname instance void .ctor(bool smth) cil managed { .maxstack 8 @@ -1179,8 +1168,7 @@ type Person(name : string, age : int) = IL_0001: throw } - .method assembly specialname rtspecialname - instance void .ctor() cil managed + .method assembly specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 @@ -1188,8 +1176,7 @@ type Person(name : string, age : int) = IL_0001: throw } - .method public hidebysig specialname - instance bool get_Something() cil managed + .method public hidebysig specialname instance bool get_Something() cil managed { .maxstack 8 @@ -1217,8 +1204,7 @@ type Person(name : string, age : int) = IL_0001: throw } - .method public hidebysig specialname - instance string get_Name() cil managed + .method public hidebysig specialname instance string get_Name() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -1228,8 +1214,7 @@ type Person(name : string, age : int) = IL_0001: throw } - .method public hidebysig specialname - instance void set_Name(string v) cil managed + .method public hidebysig specialname instance void set_Name(string v) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -1239,8 +1224,7 @@ type Person(name : string, age : int) = IL_0001: throw } - .method public hidebysig specialname - instance int32 get_Age() cil managed + .method public hidebysig specialname instance int32 get_Age() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -1250,8 +1234,7 @@ type Person(name : string, age : int) = IL_0001: throw } - .method public hidebysig specialname - instance void set_Age(int32 v) cil managed + .method public hidebysig specialname instance void set_Age(int32 v) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -1441,19 +1424,16 @@ type CompilerGoesBoom<'a>() = """.class interface public abstract auto ansi serializable beforefieldinit Foobar.IHasStaticAbstractBase`1 { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) - .method public hidebysig abstract virtual - instance !a BoomInstance() cil managed + .method public hidebysig abstract virtual instance !a BoomInstance() cil managed { } - .method public hidebysig static abstract virtual - !a BoomStatic() cil managed + .method public hidebysig static abstract virtual !a BoomStatic() cil managed { } }""" - """.method private hidebysig newslot virtual - instance !a 'Foobar.IHasStaticAbstractBase<\'a>.BoomInstance'() cil managed + """.method private hidebysig newslot virtual instance !a 'Foobar.IHasStaticAbstractBase<\'a>.BoomInstance'() cil managed { .override method instance !0 class Foobar.IHasStaticAbstractBase`1::BoomInstance() @@ -1509,19 +1489,16 @@ type CompilerGoesBoom<'a>() = """.class interface public abstract auto ansi serializable beforefieldinit Foobar.IHasStaticAbstractBase`1 { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) - .method public hidebysig abstract virtual - instance !a BoomInstance() cil managed + .method public hidebysig abstract virtual instance !a BoomInstance() cil managed { } - .method public hidebysig static abstract virtual - !a BoomStatic() cil managed + .method public hidebysig static abstract virtual !a BoomStatic() cil managed { } }""" - """.method private hidebysig newslot virtual - instance !a 'Foobar.IHasStaticAbstractBase<\'a>.BoomInstance'() cil managed + """.method private hidebysig newslot virtual instance !a 'Foobar.IHasStaticAbstractBase<\'a>.BoomInstance'() cil managed { .override method instance !0 class Foobar.IHasStaticAbstractBase`1::BoomInstance() diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs index dc9c9cdd377..492bb64bfc4 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs @@ -37,8 +37,7 @@ let testTask() = task { return 1 } """, (fun verifier -> verifier.VerifyIL [ """ -.method public strict virtual instance void -MoveNext() cil managed +.method public strict virtual instance void MoveNext() cil managed { .override [runtime]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext From ec04044e53cf6001357290c2cd77413248752502 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 9 Feb 2024 12:38:37 +0100 Subject: [PATCH 3/4] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240207.1 (#16675) --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9010c61d06b..6bff45a6228 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - ffac2194c39660f03761ba81bdd6026202942184 + a739c05eb1a5200d7fa2f1e3977b4dc54fdec36a From b8979083b6a93823fdee72a950da4a09869f8481 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Fri, 9 Feb 2024 16:33:08 +0100 Subject: [PATCH 4/4] Transparent Compiler Tests (#16591) --- azure-pipelines.yml | 16 ++++++- src/Compiler/Service/FSharpCheckerResults.fs | 5 ++ src/Compiler/Service/FSharpCheckerResults.fsi | 6 +++ src/Compiler/Service/FSharpProjectSnapshot.fs | 42 +++++++++++++--- src/Compiler/Service/TransparentCompiler.fs | 48 ++++++++++++++----- src/Compiler/Service/service.fs | 5 -- src/Compiler/Service/service.fsi | 6 --- .../CompilerService/AsyncMemoize.fs | 10 ++-- .../FSharpChecker/TransparentCompiler.fs | 3 +- .../TypeChecks/TyparNameTests.fs | 2 +- ...ervice.SurfaceArea.netstandard20.debug.bsl | 5 +- ...vice.SurfaceArea.netstandard20.release.bsl | 5 +- .../FSharpExprPatternsTests.fs | 4 +- .../TooltipTests.fs | 8 +++- tests/FSharp.Test.Utilities/CompilerAssert.fs | 7 ++- .../FSharp.Test.Utilities.fsproj | 2 +- .../ProjectGeneration.fs | 2 +- tests/service/AssemblyContentProviderTests.fs | 3 +- tests/service/ProjectAnalysisTests.fs | 18 +++++-- .../BraceMatchingServiceTests.fs | 4 +- .../EditorFormattingServiceTests.fs | 13 +++-- .../IndentationServiceTests.fs | 3 +- .../SignatureHelpProviderTests.fs | 4 +- 23 files changed, 158 insertions(+), 63 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index df00f0bc2c2..d3ccdd3792f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,4 +1,4 @@ -# CI and PR triggers +# CI and PR triggers trigger: branches: include: @@ -433,6 +433,10 @@ stages: vs_release: _configuration: Release _testKind: testVs + transparent_compiler_release: + _configuration: Release + _testKind: testCoreclr + ${{ if eq(variables['Build.Reason'], 'Flaky, disabled, was PullRequest') }}: inttests_release: _configuration: Release @@ -450,7 +454,15 @@ stages: env: NativeToolsOnMachine: true displayName: Build / Test - condition: ne(variables['_testKind'], 'testIntegration') + condition: and( ne(variables['_testKind'], 'testIntegration'), ne(variables['System.JobName'], 'transparent_compiler_release') ) + + - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) + env: + TEST_TRANSPARENT_COMPILER: 1 + NativeToolsOnMachine: true + displayName: Build / Test Transparent Compiler + condition: and( eq(variables['System.JobName'], 'transparent_compiler_release'), ne(variables['_testKind'], 'testIntegration') ) + - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) env: NativeToolsOnMachine: true diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index f55010a9025..045e0aae7a0 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -60,6 +60,11 @@ open Internal.Utilities.Hashing type FSharpUnresolvedReferencesSet = FSharpUnresolvedReferencesSet of UnresolvedAssemblyReference list +[] +type DocumentSource = + | FileSystem + | Custom of (string -> Async) + [] type DelayedILModuleReader = val private name: string diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi index 26781c4356e..0ae8b3039d9 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fsi +++ b/src/Compiler/Service/FSharpCheckerResults.fsi @@ -30,6 +30,12 @@ open FSharp.Compiler.Text open Internal.Utilities.Collections +[] +[] +type DocumentSource = + | FileSystem + | Custom of (string -> Async) + /// Delays the creation of an ILModuleReader [] type DelayedILModuleReader = diff --git a/src/Compiler/Service/FSharpProjectSnapshot.fs b/src/Compiler/Service/FSharpProjectSnapshot.fs index 148d39da787..cdc7ffe9252 100644 --- a/src/Compiler/Service/FSharpProjectSnapshot.fs +++ b/src/Compiler/Service/FSharpProjectSnapshot.fs @@ -81,6 +81,25 @@ type FSharpFileSnapshot(FileName: string, Version: string, GetSource: unit -> Ta |> Task.FromResult ) + static member CreateFromDocumentSource(fileName: string, documentSource: DocumentSource) = + + match documentSource with + | DocumentSource.Custom f -> + let version = DateTime.Now.Ticks.ToString() + + FSharpFileSnapshot( + fileName, + version, + fun () -> + task { + match! f fileName |> Async.StartAsTask with + | Some source -> return SourceTextNew.ofISourceText source + | None -> return failwith $"Couldn't get source for file {f}" + } + ) + + | DocumentSource.FileSystem -> FSharpFileSnapshot.CreateFromFileSystem fileName + member public _.FileName = FileName member _.Version = Version member _.GetSource() = GetSource() @@ -603,13 +622,22 @@ and [] FSha return snapshotAccumulator[options] } - static member internal GetFileSnapshotFromDisk _ fileName = - FSharpFileSnapshot.CreateFromFileSystem fileName |> async.Return - - static member FromOptions(options: FSharpProjectOptions) = - FSharpProjectSnapshot.FromOptions(options, FSharpProjectSnapshot.GetFileSnapshotFromDisk) + static member FromOptions(options: FSharpProjectOptions, documentSource: DocumentSource) = + FSharpProjectSnapshot.FromOptions( + options, + fun _ fileName -> + FSharpFileSnapshot.CreateFromDocumentSource(fileName, documentSource) + |> async.Return + ) - static member FromOptions(options: FSharpProjectOptions, fileName: string, fileVersion: int, sourceText: ISourceText) = + static member FromOptions + ( + options: FSharpProjectOptions, + fileName: string, + fileVersion: int, + sourceText: ISourceText, + documentSource: DocumentSource + ) = let getFileSnapshot _ fName = if fName = fileName then @@ -619,7 +647,7 @@ and [] FSha fun () -> Task.FromResult(SourceTextNew.ofISourceText sourceText) ) else - FSharpFileSnapshot.CreateFromFileSystem fName + FSharpFileSnapshot.CreateFromDocumentSource(fName, documentSource) |> async.Return FSharpProjectSnapshot.FromOptions(options, getFileSnapshot) diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 0795cb6c17a..124be183fd9 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -325,6 +325,11 @@ type internal TransparentCompiler useSyntaxTreeCache ) as self = + let documentSource = + match getSource with + | Some getSource -> DocumentSource.Custom getSource + | None -> DocumentSource.FileSystem + // Is having just one of these ok? let lexResourceManager = Lexhelp.LexResourceManager() @@ -1474,8 +1479,6 @@ type internal TransparentCompiler let tcSymbolUses = sink.GetSymbolUses() let tcOpenDeclarations = sink.GetOpenDeclarations() - let tcDependencyFiles = [] // TODO add as a set to TcIntermediate - // TODO: Apparently creating diagnostics can produce further diagnostics. So let's capture those too. Hopefully there is a more elegant solution... // Probably diagnostics need to be evaluated during typecheck anyway for proper formatting, which might take care of this too. let extraLogger = CapturingDiagnosticsLogger("DiagnosticsWhileCreatingDiagnostics") @@ -1535,7 +1538,7 @@ type internal TransparentCompiler projectSnapshot.IsIncompleteTypeCheckEnvironment, None, projectSnapshot.ToOptions(), - Array.ofList tcDependencyFiles, + Array.ofList tcInfo.tcDependencyFiles, creationDiags, parseResults.Diagnostics, tcDiagnostics, @@ -1934,7 +1937,7 @@ type internal TransparentCompiler ) : NodeCode = node { let! snapshot = - FSharpProjectSnapshot.FromOptions(options, fileName, fileVersion, sourceText) + FSharpProjectSnapshot.FromOptions(options, fileName, fileVersion, sourceText, documentSource) |> NodeCode.AwaitAsync ignore parseResults @@ -1955,7 +1958,7 @@ type internal TransparentCompiler ) : NodeCode = node { let! snapshot = - FSharpProjectSnapshot.FromOptions(options, fileName, fileVersion, sourceText) + FSharpProjectSnapshot.FromOptions(options, fileName, fileVersion, sourceText, documentSource) |> NodeCode.AwaitAsync ignore parseResults @@ -2007,7 +2010,10 @@ type internal TransparentCompiler ) : NodeCode> = node { ignore canInvalidateProject - let! snapshot = FSharpProjectSnapshot.FromOptions options |> NodeCode.AwaitAsync + + let! snapshot = + FSharpProjectSnapshot.FromOptions(options, documentSource) + |> NodeCode.AwaitAsync return! this.FindReferencesInFile(fileName, snapshot.ProjectSnapshot, symbol, userOpName) } @@ -2020,7 +2026,10 @@ type internal TransparentCompiler member this.GetAssemblyData(options: FSharpProjectOptions, fileName, userOpName: string) : NodeCode = node { - let! snapshot = FSharpProjectSnapshot.FromOptions options |> NodeCode.AwaitAsync + let! snapshot = + FSharpProjectSnapshot.FromOptions(options, documentSource) + |> NodeCode.AwaitAsync + return! this.GetAssemblyData(snapshot.ProjectSnapshot, fileName, userOpName) } @@ -2039,7 +2048,9 @@ type internal TransparentCompiler userOpName: string ) : NodeCode = node { - let! snapshot = FSharpProjectSnapshot.FromOptions options |> NodeCode.AwaitAsync + let! snapshot = + FSharpProjectSnapshot.FromOptions(options, documentSource) + |> NodeCode.AwaitAsync match! this.ParseAndCheckFileInProject(fileName, snapshot.ProjectSnapshot, userOpName) with | parseResult, FSharpCheckFileAnswer.Succeeded checkResult -> return parseResult, checkResult @@ -2053,7 +2064,10 @@ type internal TransparentCompiler userOpName: string ) : NodeCode = node { - let! snapshot = FSharpProjectSnapshot.FromOptions options |> NodeCode.AwaitAsync + let! snapshot = + FSharpProjectSnapshot.FromOptions(options, documentSource) + |> NodeCode.AwaitAsync + return! this.ParseFile(fileName, snapshot.ProjectSnapshot, userOpName) } @@ -2068,7 +2082,7 @@ type internal TransparentCompiler ignore builder let! snapshot = - FSharpProjectSnapshot.FromOptions(options, fileName, 1, sourceText) + FSharpProjectSnapshot.FromOptions(options, fileName, 1, sourceText, documentSource) |> NodeCode.AwaitAsync match! this.ParseAndCheckFileInProject(fileName, snapshot.ProjectSnapshot, "GetCachedCheckFileResult") with @@ -2118,7 +2132,11 @@ type internal TransparentCompiler ) : NodeCode = node { ignore userOpName - let! snapshot = FSharpProjectSnapshot.FromOptions options |> NodeCode.AwaitAsync + + let! snapshot = + FSharpProjectSnapshot.FromOptions(options, documentSource) + |> NodeCode.AwaitAsync + return! ComputeSemanticClassification(fileName, snapshot.ProjectSnapshot) } @@ -2141,7 +2159,7 @@ type internal TransparentCompiler ) : NodeCode = node { let! snapshot = - FSharpProjectSnapshot.FromOptions(options, fileName, fileVersion, sourceText) + FSharpProjectSnapshot.FromOptions(options, fileName, fileVersion, sourceText, documentSource) |> NodeCode.AwaitAsync return! this.ParseAndCheckFileInProject(fileName, snapshot.ProjectSnapshot, userOpName) @@ -2153,7 +2171,11 @@ type internal TransparentCompiler member this.ParseAndCheckProject(options: FSharpProjectOptions, userOpName: string) : NodeCode = node { ignore userOpName - let! snapshot = FSharpProjectSnapshot.FromOptions options |> NodeCode.AwaitAsync + + let! snapshot = + FSharpProjectSnapshot.FromOptions(options, documentSource) + |> NodeCode.AwaitAsync + return! ComputeParseAndCheckProject snapshot.ProjectSnapshot } diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 492ff2da497..803755ab13f 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -37,11 +37,6 @@ open FSharp.Compiler.Text.Range open FSharp.Compiler.TcGlobals open FSharp.Compiler.BuildGraph -[] -type DocumentSource = - | FileSystem - | Custom of (string -> Async) - /// Callback that indicates whether a requested result has become obsolete. [] type IsResultObsolete = IsResultObsolete of (unit -> bool) diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index 14124fbda6b..e74249cd604 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -19,12 +19,6 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.Text open FSharp.Compiler.Tokenization -[] -[] -type DocumentSource = - | FileSystem - | Custom of (string -> Async) - /// Used to parse and check F# source code. [] type public FSharpChecker = diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs index e442335f940..7c252019e2d 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs @@ -54,6 +54,8 @@ type internal EventRecorder<'a, 'b, 'c when 'a : equality and 'b : equality>(mem let actual = events |> Seq.toArray Assert.Equal<_ array>(expected, actual) + member _.Sequence = events |> Seq.map id + [] let ``Basics``() = @@ -63,10 +65,8 @@ let ``Basics``() = return key * 2 } - let eventLog = ConcurrentBag() - let memoize = AsyncMemoize() - memoize.OnEvent(fun (e, (_label, k, _version)) -> eventLog.Add (e, k)) + let events = EventRecorder(memoize) let result = seq { @@ -84,7 +84,9 @@ let ``Basics``() = Assert.Equal(expected, result) - let groups = eventLog |> Seq.groupBy snd |> Seq.toList + (waitUntil (events.CountOf Finished) 3).Wait() + + let groups = events.Sequence |> Seq.groupBy snd |> Seq.toList Assert.Equal(3, groups.Length) for key, events in groups do Assert.Equal>(Set [ Requested, key; Started, key; Finished, key ], Set events) diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs index 664b79d4e0e..cbc8e7690fe 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs @@ -651,7 +651,7 @@ let fuzzingTest seed (project: SyntheticProject) = task { [] let Fuzzing signatureFiles = - let seed = 1106087513 + let seed = System.Random().Next() let rng = System.Random(int seed) let fileCount = 30 @@ -711,7 +711,6 @@ type GiraffeTheoryAttribute() = [] let GiraffeFuzzing signatureFiles = let seed = System.Random().Next() - //let seed = 1044159179 let giraffeDir = if signatureFiles then giraffeSignaturesDir else giraffeDir let giraffeTestsDir = if signatureFiles then giraffeSignaturesTestsDir else giraffeTestsDir diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/TyparNameTests.fs b/tests/FSharp.Compiler.ComponentTests/TypeChecks/TyparNameTests.fs index 339fa1e2629..d8316d365e7 100644 --- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/TyparNameTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/TyparNameTests.fs @@ -14,7 +14,7 @@ module TyparNameTests = (additionalFile: SourceCodeFileKind) : string array = let typeCheckResult = - cUnit |> withAdditionalSourceFile additionalFile |> typecheckProject false false + cUnit |> withAdditionalSourceFile additionalFile |> typecheckProject false CompilerAssertHelpers.UseTransparentCompiler assert (Array.isEmpty typeCheckResult.Diagnostics) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index e53606d2de3..da61adbe19b 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -2304,6 +2304,7 @@ FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: Boolean Equals( FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: Boolean IsSignatureFile FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: Boolean get_IsSignatureFile() FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: FSharpFileSnapshot Create(System.String, System.String, Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,System.Threading.Tasks.Task`1[FSharp.Compiler.Text.ISourceTextNew]]) +FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: FSharpFileSnapshot CreateFromDocumentSource(System.String, FSharp.Compiler.CodeAnalysis.DocumentSource) FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: FSharpFileSnapshot CreateFromFileSystem(System.String) FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: Int32 GetHashCode() FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: System.String FileName @@ -2333,9 +2334,9 @@ FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjec FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectIdentifier get_Identifier() FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectSnapshot Create(System.String, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ReferenceOnDisk], Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot], Boolean, Boolean, System.DateTime, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Text.Range,System.String,System.String]], Microsoft.FSharp.Core.FSharpOption`1[System.Int64]) FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectSnapshot Replace(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot]) -FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions) +FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, FSharp.Compiler.CodeAnalysis.DocumentSource) FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Core.FSharpFunc`2[System.String,Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot]]], Microsoft.FSharp.Core.FSharpOption`1[System.Collections.Generic.Dictionary`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot]]) -FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, System.String, Int32, FSharp.Compiler.Text.ISourceText) +FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.DocumentSource) FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String Label FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String get_Label() FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot+FSharpReference: FSharpProjectSnapshot get_snapshot() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index e53606d2de3..da61adbe19b 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -2304,6 +2304,7 @@ FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: Boolean Equals( FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: Boolean IsSignatureFile FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: Boolean get_IsSignatureFile() FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: FSharpFileSnapshot Create(System.String, System.String, Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,System.Threading.Tasks.Task`1[FSharp.Compiler.Text.ISourceTextNew]]) +FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: FSharpFileSnapshot CreateFromDocumentSource(System.String, FSharp.Compiler.CodeAnalysis.DocumentSource) FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: FSharpFileSnapshot CreateFromFileSystem(System.String) FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: Int32 GetHashCode() FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot: System.String FileName @@ -2333,9 +2334,9 @@ FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjec FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectIdentifier get_Identifier() FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectSnapshot Create(System.String, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ReferenceOnDisk], Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot], Boolean, Boolean, System.DateTime, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`3[FSharp.Compiler.Text.Range,System.String,System.String]], Microsoft.FSharp.Core.FSharpOption`1[System.Int64]) FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: FSharpProjectSnapshot Replace(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot]) -FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions) +FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, FSharp.Compiler.CodeAnalysis.DocumentSource) FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpFunc`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Core.FSharpFunc`2[System.String,Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpFileSnapshot]]], Microsoft.FSharp.Core.FSharpOption`1[System.Collections.Generic.Dictionary`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot]]) -FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, System.String, Int32, FSharp.Compiler.Text.ISourceText) +FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: Microsoft.FSharp.Control.FSharpAsync`1[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot] FromOptions(FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.DocumentSource) FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String Label FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot: System.String get_Label() FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot+FSharpReference: FSharpProjectSnapshot get_snapshot() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs b/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs index 5d31b6f74fc..a50010f6f86 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs @@ -1,5 +1,7 @@ module FSharp.Compiler.Service.Tests.FSharpExprPatternsTests +open FSharp.Test + #nowarn "57" open FSharp.Compiler.CodeAnalysis @@ -137,7 +139,7 @@ let testPatterns handler source = } let checker = - FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource, keepAssemblyContents = true) + FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource, keepAssemblyContents = true, useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) let checkResult = checker.ParseAndCheckFileInProject("A.fs", 0, Map.find "A.fs" files, projectOptions) diff --git a/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs b/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs index 92993a62a61..d3e08461809 100644 --- a/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs @@ -1,5 +1,6 @@ module FSharp.Compiler.Service.Tests.TooltipTests + #nowarn "57" open FSharp.Compiler.CodeAnalysis @@ -8,6 +9,7 @@ open FSharp.Compiler.Text open FSharp.Compiler.Tokenization open FSharp.Compiler.EditorServices open FSharp.Compiler.Symbols +open FSharp.Test open NUnit.Framework let testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource line colAtEndOfNames lineText names (expectedContent: string) = @@ -29,7 +31,8 @@ let testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource line colAtEn SourceFiles = [| "A.fsi"; "A.fs" |] } let checker = - FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource) + FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource, + useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) let checkResult = checker.ParseAndCheckFileInProject("A.fs", 0, Map.find "A.fs" files, projectOptions) @@ -276,7 +279,8 @@ let testToolTipSquashing source line colAtEndOfNames lineText names tokenTag = SourceFiles = [| "A.fs" |] } let checker = - FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource) + FSharpChecker.Create(documentSource = DocumentSource.Custom documentSource, + useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) let checkResult = checker.ParseAndCheckFileInProject("A.fs", 0, Map.find "A.fs" files, projectOptions) diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index f482764de82..e7d56f247dd 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -296,8 +296,11 @@ and Compilation = module rec CompilerAssertHelpers = - let useTransparentCompiler = FSharp.Compiler.CompilerConfig.FSharpExperimentalFeaturesEnabledAutomatically - let checker = FSharpChecker.Create(suggestNamesForErrors=true, useTransparentCompiler=useTransparentCompiler) + let UseTransparentCompiler = + FSharp.Compiler.CompilerConfig.FSharpExperimentalFeaturesEnabledAutomatically || + not (String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TEST_TRANSPARENT_COMPILER"))) + + let checker = FSharpChecker.Create(suggestNamesForErrors=true, useTransparentCompiler=UseTransparentCompiler) // Unlike C# whose entrypoint is always string[] F# can make an entrypoint with 0 args, or with an array of string[] let mkDefaultArgs (entryPoint:MethodBase) : obj[] = [| diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 607d3fb1c4d..8c18161775f 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -28,11 +28,11 @@ scriptlib.fsx - + diff --git a/tests/FSharp.Test.Utilities/ProjectGeneration.fs b/tests/FSharp.Test.Utilities/ProjectGeneration.fs index 2236eee988d..2157d8fb7fe 100644 --- a/tests/FSharp.Test.Utilities/ProjectGeneration.fs +++ b/tests/FSharp.Test.Utilities/ProjectGeneration.fs @@ -931,7 +931,7 @@ type ProjectWorkflowBuilder ?isExistingProject ) = - let useTransparentCompiler = defaultArg useTransparentCompiler FSharp.Compiler.CompilerConfig.FSharpExperimentalFeaturesEnabledAutomatically + let useTransparentCompiler = defaultArg useTransparentCompiler CompilerAssertHelpers.UseTransparentCompiler let useGetSource = not useTransparentCompiler && defaultArg useGetSource false let useChangeNotifications = not useTransparentCompiler && defaultArg useChangeNotifications false let autoStart = defaultArg autoStart true diff --git a/tests/service/AssemblyContentProviderTests.fs b/tests/service/AssemblyContentProviderTests.fs index 41d6a8c660f..03deb321c24 100644 --- a/tests/service/AssemblyContentProviderTests.fs +++ b/tests/service/AssemblyContentProviderTests.fs @@ -12,6 +12,7 @@ open NUnit.Framework open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.EditorServices open FSharp.Compiler.Service.Tests.Common +open FSharp.Test let private filePath = "C:\\test.fs" @@ -28,7 +29,7 @@ let private projectOptions : FSharpProjectOptions = UnresolvedReferences = None Stamp = None } -let private checker = FSharpChecker.Create() +let private checker = FSharpChecker.Create(useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let private assertAreEqual (expected, actual) = if actual <> expected then diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index a1a58a709b2..8a643c9a7bc 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -4593,8 +4593,13 @@ let ``Test project35b Dependency files for ParseAndCheckFileInProject`` () = for d in checkFileResults.DependencyFiles do printfn "ParseAndCheckFileInProject dependency: %s" d checkFileResults.DependencyFiles |> Array.exists (fun s -> s.Contains "notexist.dll") |> shouldEqual true - // The file itself is not a dependency since it is never read from the file system when using ParseAndCheckFileInProject - checkFileResults.DependencyFiles |> Array.exists (fun s -> s.Contains Project35b.fileName1) |> shouldEqual false + + if not checker.UsesTransparentCompiler then + // The file itself is not a dependency since it is never read from the file system when using ParseAndCheckFileInProject + checkFileResults.DependencyFiles |> Array.exists (fun s -> s.Contains Project35b.fileName1) |> shouldEqual false + else + // Transparent compiler doesn't differentiate between foreground and background requests. All files have to be present in the input snapshot so the filesystem doesn't have to be watched for those. Maybe source files shouldn't be included in the dependency list at all. But they show the dependencies gathered from graph-based checking which could be useful? + () [] let ``Test project35b Dependency files for GetBackgroundCheckResultsForFileInProject`` () = @@ -4602,8 +4607,13 @@ let ``Test project35b Dependency files for GetBackgroundCheckResultsForFileInPro for d in checkFileResults.DependencyFiles do printfn "GetBackgroundCheckResultsForFileInProject dependency: %s" d checkFileResults.DependencyFiles |> Array.exists (fun s -> s.Contains "notexist.dll") |> shouldEqual true - // The file is a dependency since it is read from the file system when using GetBackgroundCheckResultsForFileInProject - checkFileResults.DependencyFiles |> Array.exists (fun s -> s.Contains Project35b.fileName1) |> shouldEqual true + + if not checker.UsesTransparentCompiler then + // The file is a dependency since it is read from the file system when using GetBackgroundCheckResultsForFileInProject + checkFileResults.DependencyFiles |> Array.exists (fun s -> s.Contains Project35b.fileName1) |> shouldEqual true + else + // Transparent compiler doesn't differentiate between foreground and background requests. All files have to be present in the input snapshot so the filesystem doesn't have to be watched for those. Maybe source files shouldn't be included in the dependency list at all. But they show the dependencies gathered from graph-based checking which could be useful? + () [] let ``Test project35b Dependency files for check of project`` () = diff --git a/vsintegration/tests/FSharp.Editor.Tests/BraceMatchingServiceTests.fs b/vsintegration/tests/FSharp.Editor.Tests/BraceMatchingServiceTests.fs index 135d5d31f2f..8027a06e85f 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/BraceMatchingServiceTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/BraceMatchingServiceTests.fs @@ -8,9 +8,11 @@ open Microsoft.CodeAnalysis.Text open FSharp.Compiler.CodeAnalysis open Microsoft.VisualStudio.FSharp.Editor open FSharp.Editor.Tests.Helpers +open FSharp.Test type BraceMatchingServiceTests() = - let checker = FSharpChecker.Create() + let checker = + FSharpChecker.Create(useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) let fileName = "C:\\test.fs" diff --git a/vsintegration/tests/FSharp.Editor.Tests/EditorFormattingServiceTests.fs b/vsintegration/tests/FSharp.Editor.Tests/EditorFormattingServiceTests.fs index 9442957325f..985abc67e31 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/EditorFormattingServiceTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/EditorFormattingServiceTests.fs @@ -57,7 +57,9 @@ marker4""" [] [] member this.TestIndentation(marker: string, expectedLine: string) = - let checker = FSharpChecker.Create() + let checker = + FSharpChecker.Create(useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) + let position = indentTemplate.IndexOf(marker) Assert.True(position >= 0, "Precondition failed: unable to find marker in template") @@ -94,7 +96,8 @@ marker4""" [] [] member this.TestPasteChanges_PastingOntoIndentedLine(enabled: bool, prefix: string) = - let checker = FSharpChecker.Create() + let checker = + FSharpChecker.Create(useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) let parsingOptions, _ = checker.GetParsingOptionsFromProjectOptions RoslynTestHelpers.DefaultProjectOptions @@ -160,7 +163,8 @@ somethingElseHere [] [] member this.TestPasteChanges_PastingOntoEmptyLine(prefix: string) = - let checker = FSharpChecker.Create() + let checker = + FSharpChecker.Create(useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) let parsingOptions, _ = checker.GetParsingOptionsFromProjectOptions RoslynTestHelpers.DefaultProjectOptions @@ -220,7 +224,8 @@ somethingElseHere [] member this.TestPasteChanges_PastingWithAutoIndentationInPasteSpan() = - let checker = FSharpChecker.Create() + let checker = + FSharpChecker.Create(useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) let parsingOptions, _ = checker.GetParsingOptionsFromProjectOptions RoslynTestHelpers.DefaultProjectOptions diff --git a/vsintegration/tests/FSharp.Editor.Tests/IndentationServiceTests.fs b/vsintegration/tests/FSharp.Editor.Tests/IndentationServiceTests.fs index 81f2bfc7f09..6b70bb07c8c 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/IndentationServiceTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/IndentationServiceTests.fs @@ -12,7 +12,8 @@ open FSharp.Editor.Tests.Helpers open FSharp.Test type IndentationServiceTests() = - let checker = FSharpChecker.Create() + let checker = + FSharpChecker.Create(useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) let filePath = "C:\\test.fs" diff --git a/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs index af66c01ed69..f85ee51a6c8 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs @@ -12,6 +12,7 @@ open FSharp.Editor.Tests.Helpers open Microsoft.CodeAnalysis open Microsoft.IO open Microsoft.VisualStudio.FSharp.Editor.CancellableTasks +open FSharp.Test module SignatureHelpProvider = let private DefaultDocumentationProvider = @@ -20,7 +21,8 @@ module SignatureHelpProvider = override doc.AppendDocumentation(_, _, _, _, _, _, _, _) = () } - let checker = FSharpChecker.Create() + let checker = + FSharpChecker.Create(useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) let filePath = "C:\\test.fs"