Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow finding symbols in the current document #23

Open
nbfalcon opened this issue Nov 4, 2020 · 7 comments
Open

Allow finding symbols in the current document #23

nbfalcon opened this issue Nov 4, 2020 · 7 comments

Comments

@nbfalcon
Copy link
Member

nbfalcon commented Nov 4, 2020

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

@sebastiansturm
Copy link
Contributor

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
Copy link
Member Author

nbfalcon commented Nov 4, 2020

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

@nbfalcon
Copy link
Member Author

nbfalcon commented Nov 6, 2020

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

@nbfalcon nbfalcon closed this as completed Nov 6, 2020
@nbfalcon
Copy link
Member Author

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.

@nbfalcon nbfalcon reopened this Dec 31, 2020
@Lythenas
Copy link

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

@razzmatazz
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants