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" repeatedly pops up. #9131

Closed
james-white-x opened this issue Aug 16, 2023 · 7 comments · Fixed by #9134
Closed

"Request textDocument/foldingRange failed" repeatedly pops up. #9131

james-white-x opened this issue Aug 16, 2023 · 7 comments · Fixed by #9134

Comments

@james-white-x
Copy link

Type: Bug

Issue Description

Constant error popping up saying Request textDocument/foldingRange failed. I am using vscode with Ubuntu 20.04 WSL setup.

Steps to Reproduce

  1. Create a brand new blazor app from the cli
    dotnet new blazorwasm -o BlazorServerApp
  2. Run project with C#
  3. This error starts to pop up
    "Request textDocument/semanticTokens/range failed."
  4. Duplicate this div below itself in the /Shared/NavMenu.razor file
    <div class="nav-item px-3"> <NavLink class="nav-link" href="fetchdata"> <span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data </NavLink> </div>
  5. Now the "Request textDocument/foldingRange failed" repeatedly pops up.

Expected Behavior

Not to constantly have extension errors popping up because it cannot understand the code.

Actual Behavior

"Request textDocument/foldingRange failed" repeatedly pops up.

Logs

C# log

Post the output from Output-->C# here

C# LSP Trace Logs

Post the output from Output-->C# LSP Trace Logs here. Requires `dotnet.server.trace` to be set to `Trace`

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: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/7.0.400/

Host:
Version: 7.0.10
Architecture: x64
Commit: a6dbb800a4

.NET SDKs installed:
7.0.400 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.10 [/usr/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
csdevkit ms-dotnettools 0.3.21 ms-dotnettools.csdevkit-0.3.21-linux-x64
csharp ms-dotnettools 2.0.357 ms-dotnettools.csharp-2.0.357-linux-x64
git-graph mhutchie 1.30.0 mhutchie.git-graph-1.30.0
gitflow vector-of-bool 1.2.1 vector-of-bool.gitflow-1.2.1
githistory donjayamanne 0.6.20 donjayamanne.githistory-0.6.20
gitlens eamodio 14.2.1 eamodio.gitlens-14.2.1
mongodb-vscode mongodb 1.2.0 mongodb.mongodb-vscode-1.2.0
powershell ms-vscode 2023.6.0 ms-vscode.powershell-2023.6.0
prettier-vscode esbenp 10.1.0 esbenp.prettier-vscode-10.1.0
python ms-python 2023.14.0 ms-python.python-2023.14.0
sass-indented syler 1.8.27 syler.sass-indented-1.8.27
svg jock 1.5.3 jock.svg-1.5.3
vscode-color-picker AntiAntiSepticeye 0.0.4 antiantisepticeye.vscode-color-picker-0.0.4
vscode-dotnet-pack ms-dotnettools 1.0.12 ms-dotnettools.vscode-dotnet-pack-1.0.12
vscode-dotnet-runtime ms-dotnettools 1.7.0 ms-dotnettools.vscode-dotnet-runtime-1.7.0
vscode-eslint dbaeumer 2.4.2 dbaeumer.vscode-eslint-2.4.2
vscode-html-css ecmel 1.13.1 ecmel.vscode-html-css-1.13.1
vscode-import-cost wix 3.3.0 wix.vscode-import-cost-3.3.0
vscode-lottie lottiefiles 1.0.5 lottiefiles.vscode-lottie-1.0.5
vscode-pylance ms-python 2023.8.20 ms-python.vscode-pylance-2023.8.20
vscode-react-native msjsdiag 1.11.2 msjsdiag.vscode-react-native-1.11.2
vscode-yaml redhat 1.14.0 redhat.vscode-yaml-1.14.0
vscodeintellicode-csharp ms-dotnettools 0.1.26 ms-dotnettools.vscodeintellicode-csharp-0.1.26-linux-x64

Extension version: 2.0.357
VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:22:42.175Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2

System Info
Item Value
CPUs AMD Ryzen 7 Microsoft Surface (R) Edition (16 x 1996)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.45GB (4.39GB free)
Process Argv --folder-uri=vscode-remote://wsl+Ubuntu/home/james/repos/FirstBlazorApp --remote=wsl+Ubuntu --crash-reporter-id f28b5a18-e7d9-4c97-873a-6695beca75bd
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.15.90.1-microsoft-standard-WSL2
CPUs AMD Ryzen 7 Microsoft Surface (R) Edition (16 x 1996)
Memory (System) 7.49GB (4.45GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
py29gd2263:30792226
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyonecf:30548226
vscccc:30803845
3biah626:30602489
89544117:30613380
a9j8j154:30646983
showlangstatbar:30737416
03d35959:30757346
7ij38806:30736111
pythonfmttext:30731395
pythoncmv:30756943
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofa:30804715
pythonnosmt12:30797651
pythonidxpt:30805730
pythonnoceb:30805159
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30812749

@dibarbet
Copy link
Member

Transferring over to Razor

@dibarbet dibarbet transferred this issue from dotnet/vscode-csharp Aug 16, 2023
@ghost ghost added the untriaged label Aug 16, 2023
@allisonchou
Copy link
Contributor

@james-white-x 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
@james-white-x
Copy link
Author

The new update has solved the issue. Thanks

@ghost ghost added untriaged and removed needs more info labels Aug 17, 2023
@davidwengier
Copy link
Contributor

Thanks for checking @james-white-x, I'll go ahead and close this issue.

@ghost ghost removed the untriaged label Aug 17, 2023
@MrJackWilson
Copy link

I'm still getting this error using the new extension version. The full error is:

Request textDocument/foldingRange failed.
  Message: Error writing JSON RPC Message: ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'index')

I'm getting this error in an empty cshtml file. Whenever I type something it pops up.

@davidwengier
Copy link
Contributor

Thanks @MrJackWilson. Do things work any better after closing open razor/cshtml documents, then using the Reload Window command, and trying again?

I'm hopeful that #9134 will fix the remaining issues with the code folding error popup.

@MrJackWilson
Copy link

I've disabled and reenabled the C# Dev Kit a few times now, it seems to be working, but I'll let you know if it stops again.

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.

5 participants