For my "look up symbols in a dialog" use case: LSP's goto-implementation cannot be used for that, and other LSP interfaces are not really sutiable either, as you pictured above. So what can we do to keep such functionality?

Do I imagine correctly it shows some entry with symbols below and as you type it filters-out symbols to correspond to the entered text? I think this is exactly what vscode uses workspace/symbol for.

To avoid speculations about how exactly LSP servers behave, I have just implemented such a feature in the plugin - stealing good ideas from vscode and stealing Colomban's Commander plugin GUI code :-). In fact, I think it would be fantastic to have such a feature directly in Geany so various plugins don't have to re-implement it over and over.

Screenshot 2023-11-11 at 11 33 05

Basically when invoked with the # prefix, it performs workspace/symbols call and shows the result (without any further filtering or reordering, this is exactly what LSP returns). The call is re-performed every time the user types something. So this call is apparently more something like autocomplete over global symbols, it's just meant for going to the symbols based on their name, working fast in real time and showing a limited number of entries only.

Then I implemented searching in current document's symbols when prefixed with @ - this time the filtering in the list is done by me using the code we use for filtering in the sidebar.

I also added the other vscode goto features even though they aren't directly related to the plugin - prefixed with : it goes to the line number and without any prefix it searches in open documents.

I also added fallbacks to use TM symbols when LSP isn't available for the given language.

Anyway, back to the question what one would have to do if interested in all symbols - workspace/symbols isn't the right call for it. One would probably have to query them document by document for all the project's files (and in Geany we don't even know what "project files" are) and then merge them. I really don't think this is the way to go and I think we should just leave the "intelligence" on the server.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/pull/3571/c1806781727@github.com>