diff --git a/CHANGELOG.md b/CHANGELOG.md index 173727c6c..dda016dd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,34 @@ - Debug from .csproj and .sln [#5876](https://github.com/dotnet/vscode-csharp/issues/5876) # Latest +* Fix check for rzls being present (PR: [#7462](https://github.com/dotnet/vscode-csharp/pull/7462)) +* Bump Razor to 9.0.0-preview.24418.1 (PR: [#7456](https://github.com/dotnet/vscode-csharp/pull/7456)) + * Don't add already known documents to the misc files project (#10753) (PR: [#10753](https://github.com/dotnet/razor/pull/10753)) + * Remove ItemCollection from TagHelperDescriptorProviderContext (#10720) (PR: [#10720](https://github.com/dotnet/razor/pull/10720)) + * Cohost inlay hint support (#10672) (PR: [#10672](https://github.com/dotnet/razor/pull/10672)) + * Fix excerpt service to allow for multi line verbatim strings (#10675) (PR: [#10675](https://github.com/dotnet/razor/pull/10675)) + * Fix attribute parsing recovery (#10620) (PR: [#10620](https://github.com/dotnet/razor/pull/10620)) + * Turn off trailing whitespace triming in strings (#10646) (PR: [#10646](https://github.com/dotnet/razor/pull/10646)) + * Handle `:get`/`:set` in `EditorRequired` checking (#10628) (PR: [#10628](https://github.com/dotnet/razor/pull/10628)) +* Include tooltip to Razor provisional completion (PR: [#7440](https://github.com/dotnet/vscode-csharp/pull/7440)) +* Add option `dotnet.completion.triggerCompletionInArgumentLists` to disable completion in argument lists (PR: [#7446](https://github.com/dotnet/vscode-csharp/pull/7446)) +* Bump Roslyn to 4.12.0-2.24422.6 (PR: [#7463](https://github.com/dotnet/vscode-csharp/pull/7463)) + * Fix error closing source link documents in VSCode (PR: [#74862](https://github.com/dotnet/roslyn/pull/74862)) + * Update LSP Protocol Types (PR: [#73911](https://github.com/dotnet/roslyn/pull/73911)) + * Fix issue projects would fail to load with missing output path error (PR: [#74791](https://github.com/dotnet/roslyn/pull/74791)) + * Expose option to disable completion triggers argument list (PR: [#74792](https://github.com/dotnet/roslyn/pull/74792)) +* Update Debugger to v2.43.0 (PR: [#7420](https://github.com/dotnet/vscode-csharp/pull/7420)) +* Bump xamltools to 17.12.35223.16 (PR: [#7464](https://github.com/dotnet/vscode-csharp/pull/7464)) +* Added XAML Hot Reload support for x:FactoryMethod and x:Arguments + +# 2.44.x * Bump Roslyn to 4.12.0-2.24416.3 (PR: [#7448](https://github.com/dotnet/vscode-csharp/pull/7448)) * Use EnableCodeStyleSeverity instead of AnalysisLevel to control new diagnostic severity behavior (PR: [#73843](https://github.com/dotnet/roslyn/pull/73843)) * Cleanup LSP error reporting (PR: [#74530](https://github.com/dotnet/roslyn/pull/74530)) * Add support in DevKit for source link go to definition (requires C# DevKit version `v1.10.6 (pre-release)` or higher) (PR: [#74626](https://github.com/dotnet/roslyn/pull/74626)) * Bump xamltools to 17.12.35216.22 (PR: [#7447](https://github.com/dotnet/vscode-csharp/pull/7447)) * Update Debugger to v2.43.0 (PR: [#7420](https://github.com/dotnet/vscode-csharp/pull/7420)) +* Fix issue with Hot Reload not connecting when Android deploy/launch is too slow: https://github.com/microsoft/vscode-dotnettools/issues/1358 # 2.43.16 * Fix handling Razor files with non-ascii characters (PR: [#7442](https://github.com/dotnet/vscode-csharp/pull/7442)) diff --git a/package.json b/package.json index 113be1117..9dc0bd06d 100644 --- a/package.json +++ b/package.json @@ -37,11 +37,11 @@ } }, "defaults": { - "roslyn": "4.12.0-2.24416.3", + "roslyn": "4.12.0-2.24422.6", "omniSharp": "1.39.11", - "razor": "9.0.0-preview.24366.2", + "razor": "9.0.0-preview.24418.1", "razorOmnisharp": "7.0.0-preview.23363.1", - "xamlTools": "17.12.35216.22" + "xamlTools": "17.12.35223.16" }, "main": "./dist/extension", "l10n": "./l10n", @@ -788,6 +788,12 @@ "description": "%configuration.dotnet.completion.provideRegexCompletions%", "order": 20 }, + "dotnet.completion.triggerCompletionInArgumentLists": { + "type": "boolean", + "default": "true", + "description": "%configuration.dotnet.completion.triggerCompletionInArgumentLists%", + "order": 20 + }, "dotnet.backgroundAnalysis.analyzerDiagnosticsScope": { "type": "string", "enum": [ diff --git a/package.nls.cs.json b/package.nls.cs.json index 6092ab263..8f8deb11b 100644 --- a/package.nls.cs.json +++ b/package.nls.cs.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "Umožňuje zobrazit regulární výrazy v seznamu dokončení.", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "Povolí podporu zobrazení neimportovaných typů a neimportovaných metod rozšíření v seznamech dokončení. Při potvrzení se na začátek aktuálního souboru přidá příslušná direktiva použití. (Dříve omnisharp.enableImportCompletion)", "configuration.dotnet.completion.showNameCompletionSuggestions": "Pro členy, které jste nedávno vybrali, proveďte automatické dokončování názvů objektů.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "Cesta výchozího řešení, které se má otevřít v pracovním prostoru. Můžete přeskočit nastavením na „zakázat“. (Dříve omnisharp.defaultLaunchSolution)", "configuration.dotnet.dotnetPath": "Zadává cestu k adresáři instalace dotnet, která se má použít místo výchozí systémové instalace. To má vliv pouze na instalaci dotnet, která se má použít k hostování samotného jazykového serveru. Příklad: /home/username/mycustomdotnetdirectory", "configuration.dotnet.enableXamlTools": "Povolí nástroje XAML při použití sady C# Dev Kit", diff --git a/package.nls.de.json b/package.nls.de.json index 86aa07f9a..8109c69d0 100644 --- a/package.nls.de.json +++ b/package.nls.de.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "Reguläre Ausdrücke in der Vervollständigungsliste anzeigen.", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "Ermöglicht die Anzeige nicht importierter Typen und nicht importierter Erweiterungsmethoden in Vervollständigungslisten. Wenn ein Commit ausgeführt wird, wird die entsprechende using-Direktive am Anfang der aktuellen Datei hinzugefügt. (Zuvor \"omnisharp.enableImportCompletion\")", "configuration.dotnet.completion.showNameCompletionSuggestions": "Führen Sie die automatische Vervollständigung des Objektnamens für die Elemente aus, die Sie kürzlich ausgewählt haben.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "Der Pfad der Standardlösung, die im Arbeitsbereich geöffnet werden soll, oder auf \"deaktivieren\" festlegen, um sie zu überspringen. (Zuvor \"omnisharp.defaultLaunchSolution\")", "configuration.dotnet.dotnetPath": "Gibt den Pfad zu einem dotnet-Installationsverzeichnis an, das anstelle des Standardsystems verwendet werden soll. Dies wirkt sich nur auf die dotnet-Installation aus, die zum Hosten des Sprachservers selbst verwendet werden soll. Beispiel: \"/home/username/mycustomdotnetdirectory\".", "configuration.dotnet.enableXamlTools": "Aktiviert XAML-Tools bei Verwendung des C#-Dev Kit", diff --git a/package.nls.es.json b/package.nls.es.json index ca05cbec2..db2294fff 100644 --- a/package.nls.es.json +++ b/package.nls.es.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "Mostrar expresiones regulares en la lista de finalización.", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "Habilita la compatibilidad para mostrar tipos no importados y métodos de extensión no importados en listas de finalización. Cuando se confirme, se agregará la directiva de uso adecuada en la parte superior del archivo actual. (Anteriormente \"omnisharp.enableImportCompletion\")", "configuration.dotnet.completion.showNameCompletionSuggestions": "Realice la finalización automática del nombre de objeto para los miembros que ha seleccionado recientemente.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "Ruta de acceso de la solución predeterminada que se va a abrir en el área de trabajo o se establece en \"deshabilitar\" para omitirla. (Anteriormente \"omnisharp.defaultLaunchSolution\")", "configuration.dotnet.dotnetPath": "Especifica la ruta de acceso a un directorio de instalación de dotnet que se va a usar en lugar del predeterminado del sistema. Esto solo influye en la instalación de dotnet que se va a usar para hospedar el propio servidor de idioma. Ejemplo: \"/home/username/mycustomdotnetdirectory\".", "configuration.dotnet.enableXamlTools": "Habilita las herramientas XAML al usar el Kit de desarrollo de C#", diff --git a/package.nls.fr.json b/package.nls.fr.json index fd26b4f96..e31b8b297 100644 --- a/package.nls.fr.json +++ b/package.nls.fr.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "Afficher les expressions régulières dans la liste de saisie semi-automatique.", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "Active la prise en charge de l’affichage des types non pris en charge et des méthodes d’extension non prises en charge dans les listes de saisie semi-automatique. Une fois validée, la directive using appropriée est ajoutée en haut du fichier actif. (Précédemment `omnisharp.enableImportCompletion`)", "configuration.dotnet.completion.showNameCompletionSuggestions": "Effectuez la complétion automatique du nom d’objet pour les membres que vous avez récemment sélectionnés.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "Le chemin d’accès de la solution par défaut à ouvrir dans l’espace de travail, ou la valeur ’disable’ pour l’ignorer. (Précédemment `omnisharp.defaultLaunchSolution`)", "configuration.dotnet.dotnetPath": "Spécifie le chemin d’accès à un répertoire d’installation de dotnet à utiliser à la place du répertoire par défaut du système. Cela n’a d’influence que sur l’installation dotnet à utiliser pour héberger le serveur de langues lui-même. Exemple : \"/home/username/mycustomdotnetdirect\" : \"/home/nom d’utilisateur/monrépertoiredotnetpersonnalisé\".", "configuration.dotnet.enableXamlTools": "Active les outils XAML lors de l’utilisation du Kit de développement C#", diff --git a/package.nls.it.json b/package.nls.it.json index 2c2dbd81d..377e73f1e 100644 --- a/package.nls.it.json +++ b/package.nls.it.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "Mostra espressioni regolari nell'elenco di completamento.", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "Abilita il supporto per mostrare i tipi non importati e i metodi di estensione non importati negli elenchi di completamento. Quando viene eseguito il commit, la direttiva using appropriata verrà aggiunta all'inizio del file corrente. (In precedenza “omnisharp.enableImportCompletion”)", "configuration.dotnet.completion.showNameCompletionSuggestions": "Consente di eseguire il completamento automatico del nome dell'oggetto per i membri selezionati di recente.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "Percorso della soluzione predefinita da aprire nell'area di lavoro o impostare su 'disabilita' per ignorarla. (In precedenza “omnisharp.defaultLaunchSolution”)", "configuration.dotnet.dotnetPath": "Specifica il percorso di una directory di installazione dotnet da usare al posto di quella predefinita del sistema. Ciò influisce solo sull'installazione di dotnet da usare per ospitare il server di linguaggio stesso. Esempio: \"/home/username/mycustomdotnetdirectory\".", "configuration.dotnet.enableXamlTools": "Abilita gli strumenti XAML quando si usa il kit di sviluppo C#", diff --git a/package.nls.ja.json b/package.nls.ja.json index fec1e021b..5a1afad04 100644 --- a/package.nls.ja.json +++ b/package.nls.ja.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "入力候補一覧に正規表現を表示します。", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "インポートされていない型とインポートされていない拡張メソッドを入力候補一覧に表示するためのサポートを有効にします。コミットすると、現在のファイルの先頭に適切な using ディレクティブが追加されます。(以前の `omnisharp.enableImportCompletion`)", "configuration.dotnet.completion.showNameCompletionSuggestions": "最近選択したメンバーの自動オブジェクト名の完了を実行します。", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "ワークスペースで開く既定のソリューションのパス。スキップするには 'disable' に設定します。(以前の `omnisharp.defaultLaunchSolution`)", "configuration.dotnet.dotnetPath": "既定のシステム ディレクトリの代わりに使用する dotnet インストール ディレクトリへのパスを指定します。これは、言語サーバー自体をホストするために使用する dotnet インストールにのみ影響します。例: \"/home/username/mycustomdotnetdirectory\"。", "configuration.dotnet.enableXamlTools": "C# 開発キットを使用するときに XAML ツールを有効にします", diff --git a/package.nls.json b/package.nls.json index b3f1240b5..aca9c125c 100644 --- a/package.nls.json +++ b/package.nls.json @@ -51,6 +51,7 @@ "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "Enables support for showing unimported types and unimported extension methods in completion lists. When committed, the appropriate using directive will be added at the top of the current file. (Previously `omnisharp.enableImportCompletion`)", "configuration.dotnet.completion.showNameCompletionSuggestions": "Perform automatic object name completion for the members that you have recently selected.", "configuration.dotnet.completion.provideRegexCompletions": "Show regular expressions in completion list.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.backgroundAnalysis.analyzerDiagnosticsScope": "Run background code analysis for: (Previously `omnisharp.enableRoslynAnalyzers`)", "configuration.dotnet.backgroundAnalysis.analyzerDiagnosticsScope.openFiles": "Open documents", "configuration.dotnet.backgroundAnalysis.analyzerDiagnosticsScope.fullSolution": "Entire solution", diff --git a/package.nls.ko.json b/package.nls.ko.json index c3523f903..6b84fd491 100644 --- a/package.nls.ko.json +++ b/package.nls.ko.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "완성 목록에 정규식을 표시합니다.", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "완성 목록에 가져오지 않은 유형과 가져오지 않은 확장 메서드를 표시하기 위한 지원을 활성화합니다. 커밋되면 적절한 using 지시문이 현재 파일의 맨 위에 추가됩니다(이전 `omnisharp.enableImportCompletion`).", "configuration.dotnet.completion.showNameCompletionSuggestions": "최근에 선택한 멤버에 대해 자동 개체 이름 완성을 수행합니다.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "작업 영역에서 열릴 기본 솔루션의 경로, 건너뛰려면 '비활성화'로 설정하세요(이전 `omnisharp.defaultLaunchSolution`).", "configuration.dotnet.dotnetPath": "기본 시스템 대신 사용할 dotnet 설치 디렉터리를 지정합니다. 이는 언어 서버 자체를 호스팅하는 데 사용할 dotnet 설치에만 영향을 줍니다(예: \"/home/username/mycustomdotnetdirectory\").", "configuration.dotnet.enableXamlTools": "C# 개발자 키트를 사용할 때 XAML 도구 사용", diff --git a/package.nls.pl.json b/package.nls.pl.json index ff009e01f..968ba7e06 100644 --- a/package.nls.pl.json +++ b/package.nls.pl.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "Pokaż wyrażenia regularne na liście uzupełniania.", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "Zapewnia obsługę wyświetlania niezaimportowanych typów i niezaimportowanych metod rozszerzeń na listach uzupełniania. Po zadeklarowaniu odpowiednia dyrektywa using zostanie dodana w górnej części bieżącego pliku. (Wcześniej „omnisharp.enableImportCompletion”)", "configuration.dotnet.completion.showNameCompletionSuggestions": "Wykonaj automatyczne uzupełnianie nazw obiektów dla elementów członkowskich, które zostały ostatnio wybrane.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "Ścieżka domyślnego rozwiązania, która ma zostać otwarta w obszarze roboczym, lub ustawiona na wartość „wyłącz”, aby je pominąć. (Poprzednio „omnisharp.defaultLaunchSolution”)", "configuration.dotnet.dotnetPath": "Określa ścieżkę do katalogu instalacyjnego dotnet, który ma być używany zamiast domyślnego katalogu systemowego. Ma to wpływ tylko na instalację dotnet używaną do hostowania samego serwera językowego. Przykład: „/home/username/mycustomdotnetdirectory”.", "configuration.dotnet.enableXamlTools": "Włącza narzędzia XAML podczas korzystania z zestawu deweloperskiego języka C#", diff --git a/package.nls.pt-br.json b/package.nls.pt-br.json index 8b07b78ee..b415f69aa 100644 --- a/package.nls.pt-br.json +++ b/package.nls.pt-br.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "Mostrar expressões regulares na lista de conclusão.", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "Habilita o suporte para mostrar tipos e métodos de extensão não importados em listas de conclusão. Quando confirmado, a diretiva using apropriada será adicionada no topo do arquivo atual. (Anteriormente `omnisharp.enableImportCompletion`)", "configuration.dotnet.completion.showNameCompletionSuggestions": "Execute a conclusão automática do nome do objeto para os membros que você selecionou recentemente.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "O caminho da solução padrão a ser aberta no workspace ou definido como 'desabilitado' para ignorá-la. (Anteriormente `omnisharp.defaultLaunchSolution`)", "configuration.dotnet.dotnetPath": "Especifica o caminho para um diretório de instalação dotnet a ser usado em vez do sistema padrão. Isso influencia apenas a instalação do dotnet a ser usada para hospedar o próprio servidor de idiomas. Exemplo: \"/home/username/mycustomdotnetdirectory\".", "configuration.dotnet.enableXamlTools": "Habilita ferramentas XAML ao usar o Kit de Desenvolvimento em C#", diff --git a/package.nls.ru.json b/package.nls.ru.json index 2a07dac74..722182a5f 100644 --- a/package.nls.ru.json +++ b/package.nls.ru.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "Отображение регулярных выражений в списке завершения.", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "Включает поддержку отображения неимпортированных типов и неимпортированных методов расширения в списках завершения. При фиксации соответствующая директива использования будет добавлена в начало текущего файла. (Ранее — \"omnisharp.enableImportCompletion\")", "configuration.dotnet.completion.showNameCompletionSuggestions": "Выполните автоматическое завершение имен объектов для выбранных элементов.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "Путь к решению по умолчанию, которое будет открыто в рабочей области. Или задайте значение \"Отключить\", чтобы пропустить его. (Ранее — \"omnisharp.defaultLaunchSolution\")", "configuration.dotnet.dotnetPath": "Указывает путь к каталогу установки dotnet для использования вместо стандартного системного каталога. Это влияет только на установку dotnet, используемую для размещения самого языкового сервера. Пример: \"/home/username/mycustomdotnetdirectory\".", "configuration.dotnet.enableXamlTools": "Включает инструменты XAML при использовании комплекта разработки C# Dev Kit.", diff --git a/package.nls.tr.json b/package.nls.tr.json index 7607ed104..7008bca04 100644 --- a/package.nls.tr.json +++ b/package.nls.tr.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "Tamamlama listesinde normal ifadeleri göster.", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "Tamamlanma listelerinde içe aktarılmamış türleri ve içe aktarılmamış uzantı yöntemlerini göstermeye yönelik desteği etkinleştirir. Taahhüt edildiğinde, uygun kullanım yönergesi geçerli dosyanın en üstüne eklenecektir. (Önceden 'omnisharp.enableImportCompletion')", "configuration.dotnet.completion.showNameCompletionSuggestions": "Yakın zamanda seçtiğiniz üyeler için otomatik nesne adı tamamlama gerçekleştirin.", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "Varsayılan çözümün yolu, çalışma alanında açılacak veya atlamak için 'devre dışı' olarak ayarlanacak. (Daha önce 'omnisharp.defaultLaunchSolution')", "configuration.dotnet.dotnetPath": "Varsayılan sistem dizini yerine kullanılacak bir dotnet kurulum dizininin yolunu belirtir. Bu, yalnızca dil sunucusunun kendisini barındırmak için kullanılacak dotnet kurulumunu etkiler. Örnek: \"/home/username/mycustomdotnetdirectory\".", "configuration.dotnet.enableXamlTools": "C# Geliştirme Setini kullanırken XAML araçlarını etkinleştirir", diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index 86928cf57..39b7598ed 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "在完成列表中显示正则表达式。", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "支持在完成列表中显示未导入的类型和未导入的扩展方法。提交后,相应的 using 指令将添加到当前文件的顶部。(之前为 \"omnisharp.enableImportCompletion\")", "configuration.dotnet.completion.showNameCompletionSuggestions": "对最近选择的成员执行自动对象名称完成。", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "要在工作区中打开的默认解决方案的路径,或者设置为“禁用”以跳过它。(之前为 \"omnisharp.defaultLaunchSolution\")", "configuration.dotnet.dotnetPath": "指定要使用的 dotnet 安装目录的路径,而不是默认的系统目录。这仅影响用于承载语言服务器本身的 dotnet 安装。示例: \"/home/username/mycustomdotnetdirectory\"。", "configuration.dotnet.enableXamlTools": "使用 C# 开发工具包时启用 XAML 工具", diff --git a/package.nls.zh-tw.json b/package.nls.zh-tw.json index 107dee986..8afde4396 100644 --- a/package.nls.zh-tw.json +++ b/package.nls.zh-tw.json @@ -41,6 +41,7 @@ "configuration.dotnet.completion.provideRegexCompletions": "在完成清單中顯示規則運算式。", "configuration.dotnet.completion.showCompletionItemsFromUnimportedNamespaces": "啟用在完成清單中顯示未匯入的類型和未匯入的擴充方法的支援。認可時,適當的 using 指示詞會新增到目前檔案的頂端。(先前為 `omnisharp.enableImportCompletion`)", "configuration.dotnet.completion.showNameCompletionSuggestions": "為您最近選取的成員執行自動物件名稱完成。", + "configuration.dotnet.completion.triggerCompletionInArgumentLists": "Automatically show completion list in argument lists", "configuration.dotnet.defaultSolution.description": "要在工作區中開啟的預設解決方案路徑,或設為 [停用] 以略過它。(先前為 `omnisharp.defaultLaunchSolution`)", "configuration.dotnet.dotnetPath": "指定要使用的 dotnet 安裝目錄路徑,而非系統預設的路徑。這只會影響用來裝載語言伺服器本身的 dotnet 安裝。範例: \"/home/username/mycustomdotnetdirectory”。", "configuration.dotnet.enableXamlTools": "使用 C# 開發套件時啟用 XAML 工具", diff --git a/src/razor/src/completion/completionHandler.ts b/src/razor/src/completion/completionHandler.ts index 1ca47a316..48247a16a 100644 --- a/src/razor/src/completion/completionHandler.ts +++ b/src/razor/src/completion/completionHandler.ts @@ -154,7 +154,13 @@ export class CompletionHandler { _cancellationToken: vscode.CancellationToken ) { // TODO: Snippet support - + const razorDocumentUri = vscode.Uri.parse( + delegatedCompletionItemResolveParams.identifier.textDocumentIdentifier.uri, + true + ); + const razorDocument = await this.documentManager.getDocument(razorDocumentUri); + const virtualCsharpDocument = razorDocument.csharpDocument as CSharpProjectedDocument; + const provisionalDotPosition = virtualCsharpDocument.getProvisionalDotPosition(); try { if ( delegatedCompletionItemResolveParams.originatingKind != LanguageKind.CSharp || @@ -162,6 +168,16 @@ export class CompletionHandler { ) { return delegatedCompletionItemResolveParams.completionItem; } else { + // will add a provisional dot to the C# document if a C# provisional completion triggered + // this resolve completion request + if (virtualCsharpDocument.ensureResolveProvisionalDot()) { + if (provisionalDotPosition !== undefined) { + await this.ensureProvisionalDotUpdatedInCSharpDocument( + virtualCsharpDocument.uri, + provisionalDotPosition + ); + } + } const newItem = await vscode.commands.executeCommand( resolveCompletionsCommand, delegatedCompletionItemResolveParams.completionItem @@ -175,6 +191,18 @@ export class CompletionHandler { } } catch (error) { this.logger.logWarning(`${CompletionHandler.completionResolveEndpoint} failed with ${error}`); + } finally { + // remove the provisional dot after the resolve has completed and if it was added + if (virtualCsharpDocument.removeResolveProvisionalDot()) { + const removeDot = true; + if (provisionalDotPosition !== undefined) { + await this.ensureProvisionalDotUpdatedInCSharpDocument( + virtualCsharpDocument.uri, + provisionalDotPosition, + removeDot + ); + } + } } return CompletionHandler.emptyCompletionItem; @@ -187,13 +215,28 @@ export class CompletionHandler { projectedPosition: Position, provisionalTextEdit?: SerializableTextEdit ) { + // Convert projected position to absolute index for provisional dot + const absoluteIndex = CompletionHandler.getIndexOfPosition(virtualDocument, projectedPosition); try { + // currently, we are temporarily adding a '.' to the C# document to ensure correct completions are provided + // for each roslyn.resolveCompletion request and we remember the location from the last provisional completion request. + // Therefore we need to remove the resolve provisional dot position + // at the start of every completion request in case a '.' gets added when it shouldn't be. + virtualDocument.clearResolveCompletionRequestVariables(); if (provisionalTextEdit) { // provisional C# completion - return this.provideCSharpProvisionalCompletions(triggerCharacter, virtualDocument, projectedPosition); + // add '.' to projected C# document to ensure correct completions are provided + // This is because when a user types '.' after an object, it is initially in + // html document and not generated C# document. + if (absoluteIndex === -1) { + return CompletionHandler.emptyCompletionList; + } + virtualDocument.addProvisionalDotAt(absoluteIndex); + // projected Position is passed in to the virtual doc so that it can be used during the resolve request + virtualDocument.setProvisionalDotPosition(projectedPosition); + await this.ensureProvisionalDotUpdatedInCSharpDocument(virtualDocument.uri, projectedPosition); } - // non-provisional C# completion const virtualDocumentUri = UriConverter.serialize(virtualDocument.uri); const params: CompletionParams = { context: { @@ -217,55 +260,57 @@ export class CompletionHandler { return csharpCompletions; } catch (error) { this.logger.logWarning(`${CompletionHandler.completionEndpoint} failed with ${error}`); + } finally { + if (provisionalTextEdit && virtualDocument.removeProvisionalDot()) { + const removeDot = true; + await this.ensureProvisionalDotUpdatedInCSharpDocument( + virtualDocument.uri, + projectedPosition, + removeDot + ); + } } return CompletionHandler.emptyCompletionList; } - // Provides 'provisional' C# completions. - // This happens when a user types '.' after an object. In that case '.' is initially in - // html document and not generated C# document. To get correct completions as soon as the user - // types '.' we need to - // 1. Temporarily add '.' to projected C# document at the correct position (projected position) - // 2. Make sure projected document is updated on the Roslyn server so Roslyn provides correct completions - // 3. Invoke Roslyn/C# completion and return that to the Razor LSP server. - // NOTE: currently there is an issue (see comments in code below) causing us to invoke vscode command - // rather then the Roslyn command - // 4. Remove temporarily (provisionally) added '.' from the projected C# buffer. - // 5. Make sure the projected C# document is updated since the user will likely continue interacting with this document. - private async provideCSharpProvisionalCompletions( - triggerCharacter: string | undefined, - virtualDocument: CSharpProjectedDocument, - projectedPosition: Position + private async ensureProvisionalDotUpdatedInCSharpDocument( + virtualDocumentUri: vscode.Uri, + projectedPosition: Position, + removeDot = false // if true then we ensure the provisional dot is removed instead of being added ) { - const absoluteIndex = CompletionHandler.getIndexOfPosition(virtualDocument, projectedPosition); - if (absoluteIndex === -1) { - return CompletionHandler.emptyCompletionList; - } - - try { - // temporarily add '.' to projected C# document to ensure correct completions are provided - virtualDocument.addProvisionalDotAt(absoluteIndex); - await this.ensureProjectedCSharpDocumentUpdated(virtualDocument.uri); - - // Current code has to execute vscode command vscode.executeCompletionItemProvider for provisional completion - // Calling roslyn command vscode.executeCompletionItemProvider returns null - // Tracked by https://github.com/dotnet/vscode-csharp/issues/7250 - return this.provideVscodeCompletions(virtualDocument.uri, projectedPosition, triggerCharacter); - } finally { - if (virtualDocument.removeProvisionalDot()) { - await this.ensureProjectedCSharpDocumentUpdated(virtualDocument.uri); - } - } - } - - private async ensureProjectedCSharpDocumentUpdated(virtualDocumentUri: vscode.Uri) { + // notifies the C# document content provider that the document content has changed this.projectedCSharpProvider.ensureDocumentContent(virtualDocumentUri); + await this.waitForDocumentChange(virtualDocumentUri, projectedPosition, removeDot); + } - // We open and then re-save because we're adding content to the text document within an event. - // We need to allow the system to propogate this text document change. - const newDocument = await vscode.workspace.openTextDocument(virtualDocumentUri); - await newDocument.save(); + // make sure the provisional dot is added or deleted in the virtual document for provisional completion + private async waitForDocumentChange( + uri: vscode.Uri, + projectedPosition: Position, + removeDot: boolean + ): Promise { + return new Promise((resolve) => { + const disposable = vscode.workspace.onDidChangeTextDocument((event) => { + const matchingText = removeDot ? '' : '.'; + if (event.document.uri.toString() === uri.toString()) { + // Check if the change is at the expected index + const changeAtIndex = event.contentChanges.some( + (change) => + change.range.start.character <= projectedPosition.character && + change.range.start.line === projectedPosition.line && + change.range.end.character + 1 >= projectedPosition.character && + change.range.end.line === projectedPosition.line && + change.text === matchingText + ); + if (changeAtIndex) { + // Resolve the promise and dispose of the event listener + resolve(); + disposable.dispose(); + } + } + }); + }); } // Adjust Roslyn completion command results to make it more palatable to VSCode @@ -326,9 +371,7 @@ export class CompletionHandler { } // Provide completions using standard vscode executeCompletionItemProvider command - // Used in HTML context and (temporarily) C# provisional completion context (calling Roslyn - // directly during provisional completion session returns null, root cause TBD, tracked by - // https://github.com/dotnet/vscode-csharp/issues/7250) + // Used in HTML context private async provideVscodeCompletions( virtualDocumentUri: vscode.Uri, projectedPosition: Position, diff --git a/src/razor/src/csharp/csharpProjectedDocument.ts b/src/razor/src/csharp/csharpProjectedDocument.ts index 3366d1590..980faf277 100644 --- a/src/razor/src/csharp/csharpProjectedDocument.ts +++ b/src/razor/src/csharp/csharpProjectedDocument.ts @@ -6,6 +6,7 @@ import { IProjectedDocument } from '../projection/IProjectedDocument'; import { ServerTextChange } from '../rpc/serverTextChange'; import { getUriPath } from '../uriPaths'; +import { Position } from 'vscode-languageclient'; import * as vscode from '../vscodeAdapter'; export class CSharpProjectedDocument implements IProjectedDocument { @@ -13,7 +14,10 @@ export class CSharpProjectedDocument implements IProjectedDocument { private content = ''; private preProvisionalContent: string | undefined; + private preResolveProvisionalContent: string | undefined; private provisionalEditAt: number | undefined; + private resolveProvisionalEditAt: number | undefined; + private ProvisionalDotPosition: Position | undefined; private hostDocumentVersion: number | null = null; private projectedDocumentVersion = 0; @@ -67,8 +71,10 @@ export class CSharpProjectedDocument implements IProjectedDocument { // Edits already applied. return; } - + //reset the state for provisional completion and resolve completion this.removeProvisionalDot(); + this.resolveProvisionalEditAt = undefined; + this.ProvisionalDotPosition = undefined; const newContent = this.getEditedContent('.', index, index, this.content); this.preProvisionalContent = this.content; @@ -80,6 +86,7 @@ export class CSharpProjectedDocument implements IProjectedDocument { if (this.provisionalEditAt && this.preProvisionalContent) { // Undo provisional edit if one was applied. this.setContent(this.preProvisionalContent); + this.resolveProvisionalEditAt = this.provisionalEditAt; this.provisionalEditAt = undefined; this.preProvisionalContent = undefined; return true; @@ -88,6 +95,55 @@ export class CSharpProjectedDocument implements IProjectedDocument { return false; } + // add resolve provisional dot if a provisional completion request was made + // A resolve provisional dot is the same as a provisional dot, but it remembers the + // last provisional dot inserted location and is used for the roslyn.resolveCompletion API + public ensureResolveProvisionalDot() { + //remove the last resolve provisional dot it it exists + this.removeResolveProvisionalDot(); + + if (this.resolveProvisionalEditAt) { + const newContent = this.getEditedContent( + '.', + this.resolveProvisionalEditAt, + this.resolveProvisionalEditAt, + this.content + ); + this.preResolveProvisionalContent = this.content; + this.setContent(newContent); + return true; + } + return false; + } + + public removeResolveProvisionalDot() { + if (this.resolveProvisionalEditAt && this.preResolveProvisionalContent) { + // Undo provisional edit if one was applied. + this.setContent(this.preResolveProvisionalContent); + this.provisionalEditAt = undefined; + this.preResolveProvisionalContent = undefined; + return true; + } + + return false; + } + + public setProvisionalDotPosition(position: Position) { + this.ProvisionalDotPosition = position; + } + + public getProvisionalDotPosition() { + return this.ProvisionalDotPosition; + } + + // since multiple roslyn.resolveCompletion requests can be made for each completion, + // we need to clear the resolveProvisionalEditIndex (currently when a new completion request is made, + // this works if resolve requests are always preceded by a completion request) + public clearResolveCompletionRequestVariables() { + this.resolveProvisionalEditAt = undefined; + this.ProvisionalDotPosition = undefined; + } + private getEditedContent(newText: string, start: number, end: number, content: string) { const before = content.substr(0, start); const after = content.substr(end); diff --git a/src/razor/src/razorLanguageServerOptionsResolver.ts b/src/razor/src/razorLanguageServerOptionsResolver.ts index 9804bbd9b..3b18aef3e 100644 --- a/src/razor/src/razorLanguageServerOptionsResolver.ts +++ b/src/razor/src/razorLanguageServerOptionsResolver.ts @@ -54,13 +54,14 @@ function findLanguageServerExecutable(withinDir: string) { } let pathWithExtension = `${fileName}${extension}`; - if (!fs.existsSync(pathWithExtension)) { + let fullPath = path.join(withinDir, pathWithExtension); + + if (!fs.existsSync(fullPath)) { // We might be running a platform neutral vsix which has no executable, instead we run the dll directly. pathWithExtension = `${fileName}.dll`; + fullPath = path.join(withinDir, pathWithExtension); } - const fullPath = path.join(withinDir, pathWithExtension); - if (!fs.existsSync(fullPath)) { throw new Error( vscode.l10n.t("Could not find Razor Language Server executable '{0}' within directory", fullPath) diff --git a/version.json b/version.json index 7890571c6..caef03ac9 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "2.44", + "version": "2.45", "publicReleaseRefSpec": [ "^refs/heads/release$", "^refs/heads/prerelease$",