You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C# Dev Kit auto-insert ignores editor.autoClosingBrackets and editor.formatOnType #9804
@dibarbet That is not an ideal solution, as it disables various other auto-formatting/auto-insert behaviours that are desireable. Auto-completion/auto-formatting of braces should be configurable independently (and were, until very recently - this issue only arose for me since yesterday).
Without those, the extension treats the file as a 'Miscellaneous File' and generally runs in a degraded state. In this state the .editorconfig is not applied. The C# language status bar will indicate you're in this state by the 'Miscellaenous Files' label:
I noticed you might be using Unity - Unity should be generating the project (.csproj) for you, though I believe some setup in Unity is required.
Reproduced in an empty Unity project, as shown here. Attached the C# Dev Kit logs and the project itself (excluding Library).
(The opening brace being moved to a new line seems to not happen every time. I can't determine the exact steps or context that determines whether it happens or not. The closing brace being moved & indented does happen every time.)
Just to reiterate that this issue only arose within the last 2 days; I've never seen it happen before with Unity. It feels very much like a recent extension update issue, although from what I see none of my extensions have been updated that recently (and I already tried rolling back various extensions to their second-latest versions).
Bump. This is labelled "Resolved-Configuration Issue", but there doesn't seem to be a configuration that fixes this particular problem. The only config that was suggested is to disable dotnet.autoInsert.enableAutoInsert, but doing so turns off all auto-insert behaviour, not just this particular case. Again, this is an issue that only started recently - enableAutoInsert was turned on before without this issue happening.
My previous comment shows a repro of the issue in a fresh project with Assembly-CSharp as the active context, so it isn't an issue with no project context as suggested above.
Activity
dibarbet commentedon Sep 23, 2026
To disable this behavior, turn off
dotnet.autoInsert.enableAutoInsertandrewfender commentedon Sep 23, 2026
@dibarbet That is not an ideal solution, as it disables various other auto-formatting/auto-insert behaviours that are desireable. Auto-completion/auto-formatting of braces should be configurable independently (and were, until very recently - this issue only arose for me since yesterday).
dibarbet commentedon Sep 23, 2026
Hmm I can't reproduce this:
Are you able to share your project at all? Can you run the

csdevkit.collectLogswith these settings, and reproduce the issue under the recording?andrewfender commentedon Sep 23, 2026
csdevkit-logs-2026-09-23T21-47-46.zip
CSTest.zip
2026-09-23.22-47-12.mp4
I reproduced it here with an empty project. I've attached the logs and the project.
dibarbet commentedon Sep 23, 2026
@andrewfender thanks for the logs and details! At least from your latest repro, this is happening because you just have a C# file open with no context on what project it belongs to. C# files need to be part of a project, or have directives indicating it's a standalone file based app. See this for more details - https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/program-structure/#file-based-apps-vs-project-based-apps
Without those, the extension treats the file as a 'Miscellaneous File' and generally runs in a degraded state. In this state the

.editorconfigis not applied. The C# language status bar will indicate you're in this state by the 'Miscellaenous Files' label:I noticed you might be using Unity - Unity should be generating the project (
.csproj) for you, though I believe some setup in Unity is required.andrewfender commentedon Sep 24, 2026
2026-09-24.07-50-44.mp4
csdevkit-logs-2026-09-24T06-51-13.zip
TestProject.zip
Reproduced in an empty Unity project, as shown here. Attached the C# Dev Kit logs and the project itself (excluding Library).
(The opening brace being moved to a new line seems to not happen every time. I can't determine the exact steps or context that determines whether it happens or not. The closing brace being moved & indented does happen every time.)
Just to reiterate that this issue only arose within the last 2 days; I've never seen it happen before with Unity. It feels very much like a recent extension update issue, although from what I see none of my extensions have been updated that recently (and I already tried rolling back various extensions to their second-latest versions).
andrewfender commentedon Oct 20, 2026
Bump. This is labelled "Resolved-Configuration Issue", but there doesn't seem to be a configuration that fixes this particular problem. The only config that was suggested is to disable
dotnet.autoInsert.enableAutoInsert, but doing so turns off all auto-insert behaviour, not just this particular case. Again, this is an issue that only started recently -enableAutoInsertwas turned on before without this issue happening.My previous comment shows a repro of the issue in a fresh project with
Assembly-CSharpas the active context, so it isn't an issue with no project context as suggested above.Can this issue be reopened?