-
Notifications
You must be signed in to change notification settings - Fork 706
Code formatting runs unexpected sometimes #8284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Have the same issue, vscode (1.100.1) started indenting the outer namespace recently (no more than a week). It seems that an interaction between the The bug is not present:
The bug is present:
I have not tried downgrading vscode itself. |
Yeah, totally right, 5/7 days ago vsCode was running OK. With last version and latest versions of all extensions with GitHub Copilot enabled, this is a non sense. I have a solution with 5 projects, almost 600 files. Each time I press CTRL+S to save the file, it takes from 2 to 8 seconds to just format the document!!! Also copilot suggestions take from 4 to 6 seconds to show up. If there is a mistake on the c# syntax, it takes up to 30 seconds to mark it with the bottom red line. I've been working on this very project for the last 12 months, and 5/7 days ago there was no problem, but the moment I've installed last version of vscode and upgrade all extensions, this is awful. |
Can you confirm if VSCode 1.100.2 also reproduces the issue? If anyone has a project they can as well, please send it our way. I have not been able to trigger formatting to run unexpectedly. Additionally, if you could collect the trace level
|
Tested in 1.100.2 and still exists A newly created project like this can also trigger the unexpected formatting running so I dont think its related to project These are extension host log. The C# log window is empty and nothing to send |
@L2750558108 You are invoking the Source Action command. The RoslynLSP does not use the "source" code action kinds, so I would expect this to always be empty. However, these lines in your extension host might be a clue as to what is going on.
Are you using OmniSharp? OmniSharp supports a If you are using OmniSharp, can you also check your VS Code settings to ensure you don't have configuration like the following. "editor.codeActionsOnSave": {
"source.fixAll.csharp": true
} |
Yes
I checked and didnt find config like this |
Does this only happen when you use the "Source Action" context menu? |
No, also happens when i use "Extract Interface" or "Move to file" refactor options. But these cases seems different, the unexpected formatting trigger by "Source Action" wont respect the format config in omnisharp.json file, but these two cases will |
Uh oh!
There was an error while loading. Please reload this page.
Environment data
dotnet --info
output:.NET SDK:
Version: 9.0.202
Commit: 3a53853c30
Workload version: 9.0.200-manifests.21502d11
MSBuild version: 17.13.13+1c2026462
运行时环境:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.202\
已安装 .NET 工作负载:
没有要显示的已安装工作负载。
配置为在安装新清单时使用 loose manifests。
Host:
Version: 9.0.3
Architecture: x64
Commit: 831d23e561
.NET SDKs installed:
6.0.405 [C:\Program Files\dotnet\sdk]
7.0.400 [C:\Program Files\dotnet\sdk]
8.0.302 [C:\Program Files\dotnet\sdk]
9.0.202 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
VS Code version:1.100.0
C# Extension version:2.72.34
C# logs
C# output window contents:Empty
See this page for collecting more detailed logs
Steps to reproduce
This also happend when using the extract interface and move to file refactor options
eab416aea4c1addd1dbdd7dd25ef2bd5.mp4
Expected behavior
N/A
Actual behavior
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: