Skip to content
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

Request textDocument/foldingRange failed #9125

Closed
scottkuhl opened this issue Aug 15, 2023 · 4 comments · Fixed by #9134
Closed

Request textDocument/foldingRange failed #9125

scottkuhl opened this issue Aug 15, 2023 · 4 comments · Fixed by #9134
Assignees

Comments

@scottkuhl
Copy link

Type: Bug

Issue Description

When editing a razor file, I repeated get this message popping up.

image

Steps to Reproduce

Open any razor file.

Logs

C# log

[Client - 1:44:00 PM] (Warning) razor/foldingRange failed with Error: Illegal argument [Info - 1:44:00 PM] Returned 83 semantic tokens for range Microsoft.VisualStudio.LanguageServer.Protocol.Range in file:///Users/scott/Projects/dotnet/Test/Test/Main.razor. [Error - 1:44:00 PM] Request textDocument/foldingRange failed. Message: Error writing JSON RPC Message: ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'index') Code: -32003 [object Object] [Info - 1:44:01 PM] Returned 83 semantic tokens for range Microsoft.VisualStudio.LanguageServer.Protocol.Range in file:///Users/scott/Projects/dotnet/Test/test/Main.razor. [Error - 1:44:02 PM] Request textDocument/foldingRange failed. Message: Error writing JSON RPC Message: ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'index') Code: -32003 [object Object]

Environment information

VSCode version: 1.81.1
C# Extension: 2.0.357
Using OmniSharp: false

Dotnet Information .NET SDK: Version: 7.0.400 Commit: 73bf45718d

Runtime Environment:
OS Name: Mac OS X
OS Version: 13.4
OS Platform: Darwin
RID: osx.13-arm64
Base Path: /usr/local/share/dotnet/sdk/7.0.400/

Host:
Version: 7.0.10
Architecture: arm64
Commit: a6dbb800a4

.NET SDKs installed:
6.0.412 [/usr/local/share/dotnet/sdk]
6.0.413 [/usr/local/share/dotnet/sdk]
7.0.306 [/usr/local/share/dotnet/sdk]
7.0.307 [/usr/local/share/dotnet/sdk]
7.0.400 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.21 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.21 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

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
aspnetcorerazor-html-css-class-completion kevin-chatham 1.0.3 kevin-chatham.aspnetcorerazor-html-css-class-completion-1.0.3
auto-close-tag formulahendry 0.5.14 formulahendry.auto-close-tag-0.5.14
better-comments aaron-bond 3.0.2 aaron-bond.better-comments-3.0.2
code-butler projektanker 2.2.1 projektanker.code-butler-2.2.1
code-spell-checker streetsidesoftware 2.20.5 streetsidesoftware.code-spell-checker-2.20.5
csdevkit ms-dotnettools 0.3.21 ms-dotnettools.csdevkit-0.3.21-darwin-arm64
csharp ms-dotnettools 2.0.357 ms-dotnettools.csharp-2.0.357-darwin-arm64
dotnet-maui ms-dotnettools 0.2.13 ms-dotnettools.dotnet-maui-0.2.13-darwin-arm64
dotnet-meteor nromanov 3.1.1 nromanov.dotnet-meteor-3.1.1
EditorConfig EditorConfig 0.16.4 editorconfig.editorconfig-0.16.4
github-vscode-theme GitHub 6.3.4 github.github-vscode-theme-6.3.4
intellicode-api-usage-examples VisualStudioExptTeam 0.2.7 visualstudioexptteam.intellicode-api-usage-examples-0.2.7
libman adrianwilczynski 1.0.1 adrianwilczynski.libman-1.0.1
nugetpackagemanagergui aliasadidev 2.0.6 aliasadidev.nugetpackagemanagergui-2.0.6
prettier-vscode esbenp 10.1.0 esbenp.prettier-vscode-10.1.0
shortcut-menu-bar jerrygoyal 3.0.4 jerrygoyal.shortcut-menu-bar-3.0.4
TabOut albert 0.2.2 albert.tabout-0.2.2
todo-tree Gruntfuggly 0.0.226 gruntfuggly.todo-tree-0.0.226
vscode-dotnet-runtime ms-dotnettools 1.7.0 ms-dotnettools.vscode-dotnet-runtime-1.7.0
vscode-edge-devtools ms-edgedevtools 2.1.3 ms-edgedevtools.vscode-edge-devtools-2.1.3
vscode-gutter-preview kisstkondoros 0.30.0 kisstkondoros.vscode-gutter-preview-0.30.0
vscode-icons vscode-icons-team 12.5.0 vscode-icons-team.vscode-icons-12.5.0
vscodeintellicode VisualStudioExptTeam 1.2.30 visualstudioexptteam.vscodeintellicode-1.2.30
vscodeintellicode-csharp ms-dotnettools 0.1.26 ms-dotnettools.vscodeintellicode-csharp-0.1.26-darwin-arm64

Extension version: 2.0.357
VS Code version: Code 1.81.1 (Universal) (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:20:33.924Z)
OS version: Darwin arm64 22.5.0
Modes:

System Info
Item Value
CPUs Apple M2 Pro (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 2, 3, 3
Memory (System) 16.00GB (0.06GB free)
Process Argv
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vsccc:30803844
2e4cg342:30602488
89544117:30613380
a9j8j154:30646983
showlangstatbar:30737416
03d35959:30757346
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofa:30804715
pythonnosmt12:30797651
pythonidxptcf:30805731
pythonnoceb:30805159
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30812749

@dibarbet dibarbet transferred this issue from dotnet/vscode-csharp Aug 15, 2023
@dibarbet
Copy link
Member

Transferring to Razor

@ghost ghost added the untriaged label Aug 15, 2023
@allisonchou
Copy link
Contributor

@scottkuhl Thanks for the report! A new version of the C# extension was released a few hours ago that we think fixes this issue (2.0.376). Can you update and let us know if the issue reproduces?

@ghost ghost removed the untriaged label Aug 16, 2023
@scottkuhl
Copy link
Author

@allisonchou The error no longer happens on all razor pages. But it still happens on a Main.razor page in a MAUI Blazor project. I can recreate it just by creating a new project and opening or editing that file.

@davidwengier
Copy link
Member

Thanks for the feedback @scottkuhl, I'm hopeful that #9134 will fix the remaining issues with the code folding error popup, once and for all

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants