-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement support format request: provideDocumentRangesFormattingEdits #12082
Comments
This is caused by the formatting task getting stuck behind a long IntelliSense parsing operation. It's being tracked by #6156 already, although that issue mentions format on type and vcFormat, the same issue would repro with clang-format and not on type. ...unless you don't see the C/C++ task bar progress indicator showing "IntelliSense: Updating" (and/or cpptools-srv isn't using CPU). |
I don't see this indicator. The problem happens no matter which IntelliSense operations are underway. If I wait for the open file to be fully parsed and for VSCode to do nothing, then save, the save operation can still hang for a long time. |
@ArnoGW1 Can you set C_Cpp.loggingLevel to "Debug" and look in the C/C++ logging to see what it shows when your format and the bug repros? e.g. normally, you should see something like
but if there are other messages then those could be contributing to the issue. |
I also encountered this problem. I have been worried about the performance issues of vs (api components and the like), because as far as I know, we only need to call the |
Copying a bit more than what you asked; this was with
Note that my settings contain: "[cpp]": {
"editor.formatOnType": true,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modificationsIfAvailable"
}, But I remember having that issue before adding |
Note that it sometimes doesn't finish at all. It's been happening a lot lately, which is blocking. Here's the log:
|
I just had a formatting failure when saving a small change, not sure it's related:
|
@ArnoGW1 Is the id of the So is the issue just with formatOnSave or do you see an issue when invoking format document too?? I'm seeing 4 formatRange requests being sent when formatOnSave is invoked. Do you have any more repro details for the "error' offset is outside the file"? |
@ArnoGW1 When a file has many edits with |
There were very few changes, less than 10 lines in a 160-line file. I will answer your other questions when I have time to investigate. |
Type: Bug
Formatting any simple 60-line C++ file is sometimes instant, sometimes so long that I give up and try again. I've seen it take 20 seconds or more.
This doesn't depend on contents; formatting randomly takes a long or short time when doing minor changes in the same small .cpp file.
Extension version: 1.19.6
VS Code version: Code 1.87.0 (Universal) (019f4d1419fbc8219a181fab7892ebccf7ee29a2, 2024-02-27T23:42:56.944Z)
OS version: Darwin arm64 23.2.0
Modes:
Remote OS version: Windows_NT x64 10.0.22631
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: