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

[Error] Request workspace/symbol failed. Message: Method not found: symbol Code: -32601 #697

Closed
MilesWilde opened this issue Aug 18, 2024 · 14 comments
Labels
bug language server Issue is not originating from this extension, but from the LSP instead

Comments

@MilesWilde
Copy link

Godot version

Godot_v4.3-stable_win64

VS Code version

1.92.2

Godot Tools VS Code extension version

2.1.0

System information

Windows 10

Issue description

When I am using Tabnine AI and I talk to it, the error pops up about 15-20 times inside of the GDScriptLanguageClient Output
[Error - 4:09:50 PM] Request workspace/symbol failed.
Message: Method not found: symbol
Code: -32601

It force opens the output and spams errors which can be distracting. It would be nice if I could disable specific errors from showing

Steps to reproduce

Open Godot
Open VSC
Create a blank .gd file
Connect to language server through VSC
Install Tabnine AI, talk to it
Output should pop up with the indicated error

@MilesWilde
Copy link
Author

Still a bug, but tabnine proving not to be useful here

@bs
Copy link

bs commented Aug 21, 2024

@Calinou, I'm getting this on a vanilla install of VSCode.

It looks like textDocument/documentSymbol does return results while workspace/symbol returns 'code': -32601, 'message': 'Method not found: symbol'.

Is cmd/ctrl-shift-o supposed to query the LSP?

@Calinou
Copy link
Member

Calinou commented Aug 26, 2024

Is cmd/ctrl-shift-o supposed to query the LSP?

Yes, it queries the list of symbols from the current file (which is returned by the LSP).

@Calinou Calinou reopened this Aug 26, 2024
@Calinou Calinou removed the archived label Aug 26, 2024
@bs
Copy link

bs commented Aug 26, 2024

cmd-shift-o isn't returning anything for me.

Any tips on debugging? I started Godot with ./Godot --lsp-server --verbose and looking at Godot LSP for messages in VSCode but don't see anything.

Curiously, most messages to go Godot LSP but then cmd-t throws to GDScriptLanguageClient

CleanShot 2024-08-26 at 16 34 10@2x
CleanShot 2024-08-26 at 16 39 08@2x

@DaelonSuzuka
Copy link
Collaborator

DaelonSuzuka commented Aug 27, 2024

I started Godot with ./Godot --lsp-server --verbose

Why are you doing that? What is the --lsp-server flag supposed to do?

@bs
Copy link

bs commented Aug 31, 2024

@DaelonSuzuka I was trying to see what the LSP server was returning when VSCode Godot-Tools was querying it.

@DaelonSuzuka DaelonSuzuka added the language server Issue is not originating from this extension, but from the LSP instead label Sep 8, 2024
@DaelonSuzuka
Copy link
Collaborator

@bs I can't find any evidence that an --lsp-server flag exists or has ever existed, so I don't understand why you would do that.

cmd-shift-o isn't returning anything for me.

There's currently a bug in the Language Server where it won't return document symbols if there is an extends statement anywhere except the first line of the file.

@MilesWilde As far as I can tell, this is a problem with the Language Server, which is a component of the Godot Editor. You should open an issue at https://github.com/godotengine/godot.

@bs
Copy link

bs commented Sep 10, 2024

@DaelonSuzuka Hmm, I can't seem to find where I got that, either. 😅 Is there a way to output the language server requests Godot sees and any errors thrown?

I can confirm that what I'm seeing is because of the order of extends. Do you have a link to the github issue? I did a search and couldn't find it.

@DaelonSuzuka
Copy link
Collaborator

DaelonSuzuka commented Sep 11, 2024

Is there a way to output the language server requests Godot sees and any errors thrown?

Not unless you want to clone the repo, set up the dev environment, and launch the extension in debug mode. The LSP is so chatty that enabling logging in release builds was causing performance problems, so I had to make it a development-only feature.

Do you have a link to the github issue?

I don't know if there is one, I merely observed the behavior while investigating some tickets on here.

PS: impressive username, btw
PPS: the cert on your homepage appears to have expired

@jaredstorm
Copy link

jaredstorm commented Sep 11, 2024

Could this issue also crop up when trying to rename symbols in a file? I noticed that renaming has stopped working for me after updating to the latest version of the extension.

Edit: For context, my setup is godot-tools extension v2.1.0, running vscode 1.93.0 on windows 11 and Godot 4.3, with the language server running in the background. Not using tabnine, but I do have the unofficial Godot Files extension v0.0.10 installed.

@jaredstorm
Copy link

but I do have the unofficial Godot Files extension v0.0.10 installed.

Just tried uninstalling this and reloading to make sure it wasn't the cause, and it wasn't.

Could this issue also crop up when trying to rename symbols in a file?

I should also clarify, I didn't notice the language server outputting Request workspace/symbol failed when renaming variables, but I did when searching for workspace level symbols through the command palette. (ctrl+P, then type #test to reproduce), but I thought they may still be related since they both have something to do with symbols, and I don't have trouble renaming variables outside of gdscript files.

@bs
Copy link

bs commented Sep 12, 2024

Not unless you want to clone the repo, set up the dev environment, and launch the extension in debug mode. The LSP is so chatty that enabling logging in release builds was causing performance problems, so I had to make it a development-only feature.

Wow, that's impressive!
I think it's about time I did this. I've been wanting to hunt down a few crashes I've been getting.

Do you have a link to the github issue?

I don't know if there is one, I merely observed the behavior while investigating some tickets on here.

When I saw symbols being returned in Sublime and Zed, for example, I figured it was LSP results, but it looks like they're doing local indexing.

I'll open a ticket.

PS: impressive username, btw PPS: the cert on your homepage appears to have expired

Thanks for the help here, and for the cert heads-up! 😂

@DaelonSuzuka
Copy link
Collaborator

The fix for this was just published in 2.3.0.

@bs feel free to message me on Discord if you want to get into extension development

@bs
Copy link

bs commented Oct 15, 2024

Thank you, @DaelonSuzuka! When I get a chance, I'll poke at the class_name order bug, and will ping you on Discord!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug language server Issue is not originating from this extension, but from the LSP instead
Projects
None yet
Development

No branches or pull requests

5 participants