geany / geany-plugins

The combined Geany Plugins collection
http://plugins.geany.org/
581 stars 262 forks source link

projectorganizer: Add popup panel for navigation #1341

Open techee opened 2 months ago

techee commented 2 months ago

This feature allows quick navigation do document/workspace symbols based on their names, open files, and line numbers.

The panel's code is mostly stolen from the LSP plugin which in turn stole it from the Colomban Wendling's Commander plugin.

techee commented 2 months ago

@b4n Thanks for having a look at it - I'll address the changes you suggested.

Apart from that, I was kind of disappointed that the "goto file" only lists Geany open documents rather than the project's documents -- maybe you'd like to add that?

Definitely makes sense for projectorganizer which knows what files belong to the project. So yes, I should add that. This isn't possible in the LSP plugin from which this feature was taken because the plugin itself doesn't know what files belong to the project (this is only known to the server).

Maybe I could also re-introduce the fuzzy search you use in the Commander plugin so one doesn't have to type the searched query exactly. In the LSP plugin it didn't make sense for the workspace symbols where the server did something like that already but e.g. for file names or file's symbols it could be useful (still we probably shouldn't use it for workspace symbols because there's way too many of them and filtering them could take too long because of this).

Also, I hoped to be able to go to a specific file's line, not only in the current file -- but that's probably less useful in practice.

Probably not hard to add something like filename.c:123, I'm just sure I'd be too lazy to type something like that :-). But maybe e.g. the right arrow could complete the value in the search entry to the selected value in the list so one could then just type :123.

techee commented 1 month ago

Apart from that, I was kind of disappointed that the "goto file" only lists Geany open documents rather than the project's documents -- maybe you'd like to add that?

Done in the last commit - open files are sorted before project files and also non-open project files don't have any icon in front of them to distinguish them from the open files.

Also, I hoped to be able to go to a specific file's line, not only in the current file -- but that's probably less useful in practice.

Not done now, possibly in the future.

techee commented 5 days ago

I've updated this PR to use https://github.com/geany/geany/pull/3916. What's still missing is updating the required Geany API once we bump it in Geany.