helix icon indicating copy to clipboard operation
helix copied to clipboard

treesitter object pickers

Open QiBaobin opened this issue 2 years ago • 1 comments

Add pickers so that we can search beside moving.

QiBaobin avatar Aug 10 '22 03:08 QiBaobin

I like this in spirit, but the functionality overlaps a bit with the <space>s symbol picker. I'd rather see the symbol picker learn to fall back to tree-sitter objects when lsp is not present. It may also be interesting to teach the workspace picker to filter by object type, rather than having separate pickers for each.

EpocSquadron avatar Aug 10 '22 10:08 EpocSquadron

Echoing @EpocSquadron -- I like having a single place to go for symbols, and falling back to treesitter when there's no lsp would be amazing.

heliostatic avatar Aug 10 '22 16:08 heliostatic

I like this in spirit, but the functionality overlaps a bit with the <space>s symbol picker. I'd rather see the symbol picker learn to fall back to tree-sitter objects when lsp is not present. It may also be interesting to teach the workspace picker to filter by object type, rather than having separate pickers for each.

done.

QiBaobin avatar Aug 11 '22 00:08 QiBaobin

@QiBaobin I just tried this PR, and it's great. One possible improvement: today, if there's no lsp for a language, you get an error on the symbol picker. But with this PR, there's no error, but if the language doesn't have textobjects there are no symbols, either (e.g. .nix files). If there's no lsp and also no textobjects in the tree-sitter, it would be nice to have some sort of message to that effect.

heliostatic avatar Aug 12 '22 17:08 heliostatic

@QiBaobin I just tried this PR, and it's great. One possible improvement: today, if there's no lsp for a language, you get an error on the symbol picker. But with this PR, there's no error, but if the language doesn't have textobjects there are no symbols, either (e.g. .nix files). If there's no lsp and also no textobjects in the tree-sitter, it would be nice to have some sort of message to that effect.

Good point, the logic is added now.

QiBaobin avatar Aug 13 '22 05:08 QiBaobin