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/documentSymbol failed #820

Open
devzenfr opened this issue Mar 11, 2025 · 7 comments
Open

Request textDocument/documentSymbol failed #820

devzenfr opened this issue Mar 11, 2025 · 7 comments

Comments

@devzenfr
Copy link

Godot version

4.4.stable

VS Code version

1.98.1

Godot Tools VS Code extension version

2.5.0

System information

MacOS Sequoia 15.2

Issue description

Since upgrading to Godot 4.4 and plugin version 2.5.0, opening a gdscript file displays the following error

[Error - 09:35:45] Request textDocument/documentSymbol failed.
Error: selectionRange must be contained in fullRange
at tf.validate (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:108:22635)
at new tf (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:108:22843)
at Bt (/Users/zoru/.vscode/extensions/geequlim.godot-tools-2.5.0/out/extension.js:35:72393)
at a (/Users/zoru/.vscode/extensions/geequlim.godot-tools-2.5.0/out/extension.js:35:46743)
at Object.GS [as map] (/Users/zoru/.vscode/extensions/geequlim.godot-tools-2.5.0/out/extension.js:35:46829)
at Object.un [as asDocumentSymbols] (/Users/zoru/.vscode/extensions/geequlim.godot-tools-2.5.0/out/extension.js:35:72360)
at c (/Users/zoru/.vscode/extensions/geequlim.godot-tools-2.5.0/out/extension.js:39:56034)
at async QI.provideDocumentSymbols (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:135:125749)

The error appeared right after updating plugin to 2.5.0.

Steps to reproduce

  • Open a Godot 4.4 project.
  • Install Godot vscode plugin
  • Open a gdscript file
@devzenfr devzenfr added the bug label Mar 11, 2025
@RobTheFiveNine
Copy link

Also having the same issue on 2.5.0 with the following VScode setup:

  • Version: 1.97.2
  • Commit: e54c774e0add60467559eb0d1e229c6452cf8447
  • Date: 2025-02-12T23:20:35.343Z
  • Electron: 32.2.7
  • ElectronBuildId: 10982180
  • Chromium: 128.0.6613.186
  • Node.js: 20.18.1
  • V8: 12.8.374.38-electron.0
  • OS: Linux x64 6.11.0-19-generic

@Calinou
Copy link
Member

Calinou commented Mar 11, 2025

cc @DaelonSuzuka

In the meantime, grab the 2.4.0 VSIX from https://github.com/godotengine/godot-vscode-plugin/releases/tag/2.4.0 and install it.

@RobTheFiveNine
Copy link

It may be worth noting (at least, in my case) - there doesn't seem to be any actual impact, other than the warning dialog popping up in the corner any time text is edited. Everything seems to be working so far for me.

@DaelonSuzuka
Copy link
Collaborator

I can't replicate this on either win10 or debian using Godot 4.4 stable.

Can somebody share a minimum reproduction or something?

@Calinou Calinou pinned this issue Mar 11, 2025
@badmilkrobot
Copy link

badmilkrobot commented Mar 12, 2025

I have this error, but it isn't consistent across all my projects. One smaller project runs fine, while another larger project has the issue. Using same user configs and settings in both, and both are on same machine, windows 11.

Also worth noting: This appears in my converted projects, not ones created in 4.4 as far as I can see.

Error: selectionRange must be contained in fullRange
    at Function.validate (file:///c:/Users/actte/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:108:22635)
    at new tf (file:///c:/Users/actte/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:108:22843)
    at Bt (c:\Users\actte\.vscode\extensions\geequlim.godot-tools-2.5.0\out\extension.js:35:72393)
    at a (c:\Users\actte\.vscode\extensions\geequlim.godot-tools-2.5.0\out\extension.js:35:46743)
    at Object.GS [as map] (c:\Users\actte\.vscode\extensions\geequlim.godot-tools-2.5.0\out\extension.js:35:46829)
    at Object.un [as asDocumentSymbols] (c:\Users\actte\.vscode\extensions\geequlim.godot-tools-2.5.0\out\extension.js:35:72360)
    at c (c:\Users\actte\.vscode\extensions\geequlim.godot-tools-2.5.0\out\extension.js:39:56034)
    at QI.provideDocumentSymbols (file:///c:/Users/actte/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:135:125749)

@devzenfr
Copy link
Author

I can't replicate this on either win10 or debian using Godot 4.4 stable.

Can somebody share a minimum reproduction or something?

I tried creating a new Godot 4.4 project, nothing inside it except a test.tscn file with a simple Node and a test.gd script.

First, the error didn't appear when opening and editing the test.gd file.
But I added a class_name Test at the top of the file and the error appeared immediately.
If I remove the class_name, the error disappears.

Here is the full code for this project

class_name Test
extends Node

Inside test.gd

Do you need a repo with that test project? It really is empty appart from this test scene.

@DaelonSuzuka
Copy link
Collaborator

@devzenfr That replicates it immediately, thanks. Give me a little time to look into this.

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

No branches or pull requests

5 participants