GDQuest / zed-gdscript

Zed support for the GDScript language
MIT License
37 stars 10 forks source link

Does this support symbol search out of the box or does something else need to be configured? #28

Closed bs closed 3 months ago

bs commented 3 months ago

What is the current behavior?

cmd-t brings up search project symbols but no results.

What is the expected behavior?

A list of symbols in the project to filter.

NathanLovato commented 3 months ago

Hi!

Project symbols are a feature provided by language servers. The GDScript language server does not provide project symbols as far as I know.

So, this is something the extension unfortunately cannot offer at the moment. The feature would need to be contributed to the language in the Godot engine itself: https://github.com/godotengine/godot

Then, it would be available to all third-party code editors.

From the Zed documentation:

To use the language server to search for a symbol across the project, press cmd-t.

bs commented 3 months ago

Ah, OK. I'll dig a little deeper.

In Sublime (using the new: https://github.com/dementive/SublimeGodot), textDocument/documentSymbol does return results while workspace/symbol returns 'code': -32601, 'message': 'Method not found: symbol'

NathanLovato commented 3 months ago

The document symbols are supported, and so is go to definition or find references.

Workspace/project-wide symbols indeed that are not supported by Godot's language server. You can check the source code here if you'd like: https://github.com/godotengine/godot/tree/master/modules/gdscript/language_server

I think the feature would need to be added in https://github.com/godotengine/godot/blob/master/modules/gdscript/language_server/gdscript_workspace.h

bs commented 2 months ago

I'll take a look! And found search-buffer-symbols with cmd-shift-o. Was surprised to not see it in the command palette!

ygingras commented 2 months ago

Commenting for posterity: search-buffer-symbols is called "outline:toggle" in the command pallet. It's bound to "ctrl-shit-o" by default on Linux.