Skip to content

Add lsp-ivy-document-symbol#38

Open
razzmatazz wants to merge 2 commits into
emacs-lsp:masterfrom
razzmatazz:document-symbol
Open

Add lsp-ivy-document-symbol#38
razzmatazz wants to merge 2 commits into
emacs-lsp:masterfrom
razzmatazz:document-symbol

Conversation

@razzmatazz
Copy link
Copy Markdown

This adds an implementation of lsp-ivy-document-symbol; at some point I got frustrated with imenu and how it behaves (at least to what I have on doom emacs) and figured I might do something about this.

This might need more love, testing and feedback to get up to a good quality, but I already have support for both DocumentSymbol and SymbolInformation (older LSP servers) as response from textDocument/documentSymbol.

Bildschirmfoto 2022-09-30 um 22 07 33

Comment thread lsp-ivy.el
;; Keywords: languages, debug
;; URL: https://github.com/emacs-lsp/lsp-ivy
;; Package-Requires: ((emacs "25.1") (dash "2.14.1") (lsp-mode "6.2.1") (ivy "0.13.0"))
;; Package-Requires: ((emacs "27.1") (dash "2.14.1") (lsp-mode "6.2.1") (ivy "0.13.0"))
Copy link
Copy Markdown
Author

@razzmatazz razzmatazz Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

27.1 is required for flatten-tree -- I can probably drop it and rewrite it differently if needed

Comment thread lsp-ivy.el
"`ivy' for lsp textDocument/documentSymbol."
(interactive)
(let* ((xs (lsp-request-while-no-input "textDocument/documentSymbol"
(lsp--text-document-position-params)))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should use this method. IMHO it should be async and it should let the user type while the query runs.

Comment thread lsp-ivy.el



(lsp-defun lsp-ivy--format-document-symbol-match (dsym)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may handle deprecated as well. And using lsp-defun does not make sense if you don't destructure in the params.

Consider integrating with treemacs icons (you may check for lsp-treemacs and use the helpers from there).
Consider optionally adding the possibility to indicate the parent/child relation using identation.

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

Successfully merging this pull request may close these issues.

3 participants