emacs-lsp / lsp-ivy

lsp-mode ❤️ ivy
GNU General Public License v3.0
135 stars 18 forks source link

Allow finding symbols in the current document #23

Open nbfalcon opened 4 years ago

nbfalcon commented 4 years ago

There is a function that searches the entire for symbols, but none to search only the current document.

sebastiansturm commented 4 years ago

not sure how far this overlaps with the imenu functionality already provided by lsp-mode, but I guess I could just add an optional prefix parameter that will be used to match against returned filenames; that way you could restrict your search to a specific directory, or file, such as the file being visited by the current buffer

nbfalcon commented 4 years ago

Actually, imenu might be good enough. I was thinking more of "textDocument/documentSymbols" wrapped in ivy-read. I tried implementing that, but failed.

nbfalcon commented 4 years ago

Okay, on second thought this would duplicate the functionality of imenu, which does exactly what I want. I'm closing this.

nbfalcon commented 3 years ago

VSCode has a feature to specifically search for DocumentSymbols, and we should also have that. I'm reopening because I'm almost done implementing this.

Lythenas commented 3 years ago

@nbfalcon Did you manage to implement this? For me the imenu is not very good to use.

razzmatazz commented 2 years ago

same for me.. imenu integration in lsp appears to cut symbol description up to certain length..

an example:

Bildschirmfoto 2022-09-13 um 21 52 11

thinking about implementing lsp-ivy-document-symbol in lsp-ivy.el unless I find a way to make lsp-mode not truncate imenu items..

razzmatazz commented 2 years ago

oh, found imenu-max-item-length, so truncation is not a problem for now