Skip to content

try to add a document_symbols handler #9

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

Merged
merged 3 commits into from
Jul 17, 2024
Merged

Conversation

emarcotte-dh
Copy link
Contributor

started using this the lsp the other day and found it very helpful to jump from message-to-message. thanks!

i use https://github.com/hedyhli/outline.nvim and work with some massive proto files, so i thought it might be nice to be able to get an outline of the file in the outline view.

i'm not an expert with treesitter node walking nor language servers so there are probably several optimizations that could be made.

not sure if there's interest in this but I figured i would post it anyway.

@coder3101
Copy link
Owner

I'll check the PR later today. Thanks for the contribution.

Copy link
Owner

@coder3101 coder3101 left a comment

Choose a reason for hiding this comment

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

You could also update Readme with checklist for this support.

@coder3101 coder3101 enabled auto-merge (squash) July 15, 2024 05:50
@emarcotte-dh
Copy link
Contributor Author

thanks for the notes! will prob be a few days before i get back to this

@emarcotte-dh
Copy link
Contributor Author

I did have one other question that feels very "Man I haven't written enough rust" -- The lsp types struct for document symbols doesn't have any constructors/default implementation that I can find, but marks one if its fields deprecated. is there any way to avoid this:

warning: use of deprecated field `async_lsp::lsp_types::DocumentSymbol::deprecated`: Use tags instead
   --> src/parser.rs:199:21
    |
199 |                     deprecated: None,
    |                     ^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

auto-merge was automatically disabled July 17, 2024 12:16

Head branch was pushed to by a user without write access

@coder3101
Copy link
Owner

Best we can do is to suppress that deprecated struct initialisation using #[allow(deprecated)]. See rust-lang/rust#102777

@coder3101
Copy link
Owner

We can probably leverage DocumentSymbol for other operation such as goto-def, hover etc. But that is out of your PR's scope so I let that go for now.

@coder3101 coder3101 enabled auto-merge (squash) July 17, 2024 18:01
@coder3101 coder3101 merged commit 5427b3b into coder3101:main Jul 17, 2024
1 check passed
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.

2 participants