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
Implement support format request: provideDocumentRangesFormattingEdits #12082
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).
...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.
Arno Gobbin (@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?
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 clang-format executable file to format the source code. If this is the case The technical solution should be optimized very soon!
Formatting using visual studio only takes a moment (also clang-format), and if there are syntax errors in the code, it will take a long time and fail.
Arno Gobbin (@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?
Copying a bit more than what you asked; this was with formatOnSave and saving took around 4 seconds in a 116-line file:
Do you have any more repro details for the "error' offset is outside the file"?
This is something I'm running into as well. Curiously this is the only discussion I could find online referencing it. The Clang-Format extension outputs error: offset 2530 is outside the file.
We've been using this issue to track handling of multi-range format requests. It's unclear to me whether all related issues mentioned here have been addressed. It's possible there was a VS Code bug at some point that was generating excessive individual format requests, which may have since been resolved. If anyone is still repro'ing behavior they had reported here, please open a new issue with repro steps.
Activity
sean-mcmanus commentedon Mar 8, 2024
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).
ArnoGW1 commentedon Mar 11, 2024
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.
sean-mcmanus commentedon Mar 11, 2024
Arno Gobbin (@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.
romanholidaypancakes commentedon Mar 12, 2024
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
clang-formatexecutable file to format the source code. If this is the case The technical solution should be optimized very soon!Formatting using visual studio only takes a moment (also clang-format), and if there are syntax errors in the code, it will take a long time and fail.
ArnoGW1 commentedon Mar 12, 2024
Copying a bit more than what you asked; this was with
formatOnSaveand saving took around 4 seconds in a 116-line file:Note that my settings contain:
But I remember having that issue before adding
formatOnSaveMode.ArnoGW1 commentedon Mar 12, 2024
Note that it sometimes doesn't finish at all. It's been happening a lot lately, which is blocking. Here's the log:
10 remaining items
daniellivingston commentedon Apr 8, 2025
This is something I'm running into as well. Curiously this is the only discussion I could find online referencing it. The Clang-Format extension outputs
error: offset 2530 is outside the file.Setting C_Cpp.loggingLevel to "Debug" shows:
Colengms commentedon Sep 18, 2026
We've been using this issue to track handling of multi-range format requests. It's unclear to me whether all related issues mentioned here have been addressed. It's possible there was a VS Code bug at some point that was generating excessive individual format requests, which may have since been resolved. If anyone is still repro'ing behavior they had reported here, please open a new issue with repro steps.
sean-mcmanus commentedon Sep 22, 2026
Arno Gobbin (@ArnoGW1) Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.35.2
ArnoGW1 commentedon Sep 23, 2026
Thank you! I will check this when I work on C++ stuff again.