Skip to content

textDocument/formatting fails: 'end' must not be less than 'start' #9518

Description

@mustufaeshaq

Type: Bug

Issue Description

Steps to Reproduce

Expected Behavior

Actual Behavior

Extension version: 2.140.9
VS Code version: Code 1.128.0 (fc3def6774c76082adf699d366f31a557ce5573f, 2026-07-07T15:14:24-07:00)
OS version: Darwin arm64 25.6.0
Modes:

Logs

C# log

Details
2026-07-08 20:31:12.814 [info] Locating .NET runtime version 10.0.5
2026-07-08 20:31:12.955 [info] Dotnet path: /Users/mustufalakdawala/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/10.0.9~arm64~aspnetcore/dotnet
2026-07-08 20:31:12.955 [info] Activating C# + C# Dev Kit...
2026-07-08 20:31:13.191 [info] info: Program[0]
2026-07-08 20:31:13.191 [info]       Server started with process ID 2859
2026-07-08 20:31:13.806 [info] [Program] Language server initialized
2026-07-08 20:31:13.807 [info] [Program] Monitoring client process 2110 for exit
2026-07-08 20:31:14.023 [info] [initialized] [Microsoft.CodeAnalysis.LanguageServer.FileBasedPrograms.FileBasedProgramsEntryPointDiscovery] Finished discovery in '/Users/mustufalakdawala/Documents/PROJECTS/WEB_APPLICATIONS/BFC' in 4 milliseconds
2026-07-08 20:31:15.605 [info] [serviceBroker/connect] [WorkspaceProjectFactoryService] Project /Users/mustufalakdawala/Documents/PROJECTS/WEB_APPLICATIONS/BFC/BFC.Web/BFC.Web.csproj loaded by C# Dev Kit
2026-07-08 20:50:18.697 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='2000' end='1975'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-08 21:46:20.106 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='6386' end='6361'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-08 21:46:59.839 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='6324' end='6299'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-08 21:48:47.994 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='6167' end='6142'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-08 21:50:47.866 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='6202' end='6177'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-08 21:52:13.831 [info] Locating .NET runtime version 10.0.5
2026-07-08 21:52:13.899 [info] Dotnet path: /Users/mustufalakdawala/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/10.0.9~arm64~aspnetcore/dotnet
2026-07-08 21:52:13.899 [info] Activating C# + C# Dev Kit...
2026-07-08 21:52:14.029 [info] info: Program[0]
2026-07-08 21:52:14.029 [info]       Server started with process ID 7165
2026-07-08 21:52:14.432 [info] [Program] Language server initialized
2026-07-08 21:52:14.434 [info] [Program] Monitoring client process 7102 for exit
2026-07-08 21:52:14.681 [info] [initialized] [Microsoft.CodeAnalysis.LanguageServer.FileBasedPrograms.FileBasedProgramsEntryPointDiscovery] Finished discovery in '/Users/mustufalakdawala/Documents/PROJECTS/WEB_APPLICATIONS/BFC' in 4 milliseconds
2026-07-08 21:52:16.338 [info] [serviceBroker/connect] [WorkspaceProjectFactoryService] Project /Users/mustufalakdawala/Documents/PROJECTS/WEB_APPLICATIONS/BFC/BFC.Web/BFC.Web.csproj loaded by C# Dev Kit
2026-07-08 21:52:37.001 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='6202' end='6177'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-09 12:40:17.142 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='2098' end='2073'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-09 12:44:55.193 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='2001' end='1976'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-09 14:40:39.754 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='4255' end='4230'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-09 17:02:53.113 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='4255' end='4230'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-09 17:13:51.998 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='4258' end='4233'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-10 12:16:19.856 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='4153' end='4128'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-07-10 13:08:08.743 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='4217' end='4192'. (Parameter 'end')
  Code: -32000 
[object Object]

C# LSP Trace Logs log

Details

Environment Information

VSCode version: 1.128.0
C# Extension: 2.140.9
Using OmniSharp: false

Dotnet Information

Host:
Version: 10.0.9
Architecture: arm64
Commit: 901ca94124
RID: osx-arm64

.NET SDKs installed:
No SDKs were found.

.NET runtimes installed:
Microsoft.AspNetCore.App 10.0.9 [/Users/mustufalakdawala/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/10.0.9arm64aspnetcore/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 10.0.9 [/Users/mustufalakdawala/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/10.0.9arm64aspnetcore/shared/Microsoft.NETCore.App]

Other architectures found:
x64 [/usr/local/share/dotnet/x64]
registered at [/etc/dotnet/install_location_x64]

Environment variables:
DOTNET_CLI_UI_LANGUAGE [en-US]
DOTNET_NOLOGO [true]

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Visual Studio Code Extensions
Extension Author Version Folder Name
color-highlight naumovs 2.8.0 naumovs.color-highlight-2.8.0
csdevkit ms-dotnettools 3.20.199 ms-dotnettools.csdevkit-3.20.199-darwin-arm64
csharp ms-dotnettools 2.140.9 ms-dotnettools.csharp-2.140.9-darwin-arm64
dart-code Dart-Code 3.138.0 dart-code.dart-code-3.138.0
data-workspace-vscode ms-mssql 0.6.3 ms-mssql.data-workspace-vscode-0.6.3
debugpy ms-python 2026.6.0 ms-python.debugpy-2026.6.0-darwin-arm64
flutter Dart-Code 3.138.0 dart-code.flutter-3.138.0
gitlens eamodio 18.2.0 eamodio.gitlens-18.2.0
material-icon-theme PKief 5.36.1 pkief.material-icon-theme-5.36.1
mssql ms-mssql 1.43.0 ms-mssql.mssql-1.43.0
powerplatform-vscode microsoft-IsvExpTools 2.0.145 microsoft-isvexptools.powerplatform-vscode-2.0.145
prettier-vscode esbenp 12.4.0 esbenp.prettier-vscode-12.4.0
python ms-python 2026.4.0 ms-python.python-2026.4.0-darwin-arm64
sarif-viewer MS-SarifVSCode 3.4.5 ms-sarifvscode.sarif-viewer-3.4.5
sql-bindings-vscode ms-mssql 0.4.1 ms-mssql.sql-bindings-vscode-0.4.1
sql-database-projects-vscode ms-mssql 1.6.1 ms-mssql.sql-database-projects-vscode-1.6.1
vim vscodevim 1.32.4 vscodevim.vim-1.32.4
vscode-codeql GitHub 1.17.7 github.vscode-codeql-1.17.7
vscode-dotnet-runtime ms-dotnettools 3.1.0 ms-dotnettools.vscode-dotnet-runtime-3.1.0
vscode-pylance ms-python 2026.2.1 ms-python.vscode-pylance-2026.2.1
vscode-python-envs ms-python 1.36.0 ms-python.vscode-python-envs-1.36.0-darwin-arm64
C# Settings
Setting Value
preferCSharpExtension false
compilerDiagnosticScope openFiles
analyzerDiagnosticScope openFiles
enableXamlTools true
useServerGC true
System Info
Item Value
CPUs Apple M3 (8 x 2400)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x106b [Google Inc. (Apple)], DEVICE=0x0000 [ANGLE (Apple, ANGLE Metal Renderer: Apple M3, Version 26.6 (Build 25G5057c))], DRIVER_VENDOR=Apple, DRIVER_VERSION=26.6 ACTIVE
Machine model name: Mac
Machine model version: 15.12
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: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.06GB free)
Process Argv --crash-reporter-id 75df1212-d9e5-4c1b-a09d-344c2ed62119
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
pythonvspyt551:31249599
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
6abeh943:31336334
envsdeactivate2:31538737
cloudbuttont:31379625
3efgi100_wstrepl:31403338
ec5jj548:31422691
cp_cls_t_966_ss:31526232
8hhj4413:31478653
cp_cls_c_1081:31454833
conptydll_true:31498968
e9c30283:31461165
test_treatment2:31471001
46204921:31447328
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
chat:31457767
7e187181:31503455
ghj88844:31499326
ddid_c:31478207
hmra_i5g22:31518061
ie3bb177:31543534
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
db5d2638:31499441
jb_cp_cls_t_632:31543129
b1ei0813:31506238
56dj4588:31512888
32d76977:31512328
ha629193:31508444
cdk-lw-on:31524445
f9bf7985:31543584
31fi7170_t:31522396
jh5f2457_c:31540921
g4a0e106:31529594
8hfba999:31537718
jbcp_cls_pctr_t:31531130
61138546:31518536
cp_intellij_c_nes:31533503
d7b18187:31526828
h561g132:31533256
sessions_3:31532893
ihg5j128:31534457
jh7i3328:31546038
9gg7f176:31542112
sandbox-ui-on-2:31543161
nes-nc-lc-2k:31546583

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions