C# Dev Kit auto-insert ignores editor.autoClosingBrackets and editor.formatOnType
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 65/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- csharp, typescript, vscode
調査の方向性
Look at the C# extension's auto-insert handler registration, likely in the TypeScript source. The issue mentions a registerOnAutoInsert handler that processes { and newline. Find where this handler is defined and how it reads VS Code settings like editor.autoClosingBrackets and editor.formatOnType. Test changes by disabling the handler's brace insertion when those settings are 'never' and false. Verify the fix works with C# Dev Kit enabled and doesn't break other formatting.
索引モデルが issue の本文から書いたものです。
説明
Summary
With C# Dev Kit enabled, typing { and pressing Enter in a C# file automatically inserts/indents a closing } and moves the opening { to its own line.
This happens despite C# auto-closing and format-on-type being explicitly disabled.
Disabling C# Dev Kit stops the behavior, but Visual Studio Tools for Unity depends on C# Dev Kit.
Environment
- VS Code: 1.139.0
- C# Dev Kit: 3.40.204
- C#: 2.160.4
- .NET Install Tool: 3.2.0
- Visual Studio Tools for Unity: 1.3.1
- OS: Windows
Relevant VS Code settings
"editor.autoClosingBrackets": "never",
"editor.autoIndent": "keep",
"editor.formatOnType": false,
"[csharp]": {
"editor.formatOnType": false,
"editor.formatOnSave": false,
"editor.formatOnPaste": false,
"editor.autoClosingBrackets": "never"
},
"csharp.format.enable": false
Relevant .editorconfig settings
[*.cs]
csharp_new_line_before_open_brace = none
csharp_indent_braces = false
Steps to reproduce
- Enable C# Dev Kit.
- Open a
.csfile in a loaded solution. - Type
void Foo() {and press Enter.
Expected behavior
The opening brace remains on the same line, no closing brace is inserted, and normal indentation is preserved:
void Foo() {
|
Actual behavior
Roslyn inserts/reformats braces:
void Foo()
{
|
}
Isolation performed
- Reloading VS Code with extensions disabled stops the behavior.
- Disabling C# Dev Kit alone stops the behavior.
- The C# extension’s
registerOnAutoInserthandler processes{and newline changes independently ofeditor.autoClosingBracketsandeditor.formatOnType. - Filtering
{and newline from that handler locally fixes the issue while keeping C# Dev Kit and Visual Studio Tools for Unity enabled.
Requested behavior
Please make Roslyn auto-insert honor:
editor.autoClosingBrackets: "never"editor.formatOnType: false
Alternatively, please add a user setting that disables Roslyn auto-insert for braces and newlines.
- 主要言語
- TypeScript
- スター
- 3.1k
- フォーク
- 736
- 平均マージ
- 21時間 21分
- マージ済み PR(30日)
- 42
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/vscode-csharp のほかの issue
-
Infrastructure Test
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
dotnet/vscode-csharp#9791 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
C# crashオープンBug C#DK Needs More Info Reliability Remote Extensions Roslyn LSP
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
dotnet/vscode-csharp#9807 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Debugger untriaged
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
dotnet/vscode-csharp#9802 ·
メンテナーはふだん 1 日以内に返信
-
untriaged
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
dotnet/vscode-csharp#9787 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
C# Dev Kit writes an untracked runfile-discovery cache into the workspace対応中かも @RikkiGibson が 13 日前に担当しました。 オープンBug Feature - Run File
dotnet/vscode-csharp#9767 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
dotnet/vscode-csharp の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
openedx/frontend-app-authoring#3274 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
area/documentation status/need-triage
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
google-gemini/gemini-cli#29548 ·
メンテナーはふだん 1 日以内に返信
-
sdk-typescript vector-store
難易度 2/5 半日 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信