Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 10, 2025

Auto-insert was using global editor.tabSize instead of respecting C#-specific overrides like "[csharp]": { "editor.tabSize": 4 }.

Changes

  • onAutoInsert.ts: Pass document URI to getConfiguration() to enable language-specific setting resolution

    // Before
    const editorConfig = vscode.workspace.getConfiguration('editor');
    
    // After  
    const editorConfig = vscode.workspace.getConfiguration('editor', resource);
  • onAutoInsert.integration.test.ts: Add test verifying language-specific tabSize is respected

Fixes #8755

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: gulp test:integration:csharp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Fix #8755
Likely the code here needs to be updated - https://github.com/dotnet/vscode-csharp/blob/main/src/lsptoolshost/autoInsert/onAutoInsert.ts#L145

Additionally, ideally the options would respect not just the language setting value, but also the detected space setting if it is different from the general one. Potentially the actual file being edited needs to be passed in as the resource?


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: dibarbet <5749229+dibarbet@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix auto-insert settings to respect language and space options Fix auto-insert ignoring language-specific editor.tabSize Nov 10, 2025
Copilot AI requested a review from dibarbet November 10, 2025 21:22
Copilot finished work on behalf of dibarbet November 10, 2025 21:22
@dibarbet dibarbet marked this pull request as ready for review November 10, 2025 22:21
@dibarbet dibarbet requested a review from a team as a code owner November 10, 2025 22:21
@dibarbet dibarbet enabled auto-merge November 11, 2025 00:32
@dibarbet dibarbet merged commit f52d436 into main Nov 11, 2025
33 checks passed
@dibarbet dibarbet deleted the copilot/fix-auto-insert-options branch November 11, 2025 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto indent ignores tabsize configured for C# and uses general tab size

3 participants