Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

trouble to receive SelectionRangeRequest #44

Open
charlesxsh opened this issue Apr 12, 2022 · 2 comments
Open

trouble to receive SelectionRangeRequest #44

charlesxsh opened this issue Apr 12, 2022 · 2 comments

Comments

@charlesxsh
Copy link

Hi there, I am trying to using lsp-server to capture selection event in VSCode, however, I only received hover event.

let server_capabilities = serde_json::to_value(
        &ServerCapabilities {
            definition_provider: Some(OneOf::Left(true)),
            selection_range_provider: Some(SelectionRangeProviderCapability::Simple(true)),
            hover_provider: Some(HoverProviderCapability::Simple(true)),
            ..Default::default()
        }
    ).unwrap();

Can anyone enlighten me anywhere I am doing wrong?

@lnicola
Copy link
Member

lnicola commented Apr 12, 2022

I'm not sure, but we're using it in rust-analyzer: https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/main_loop.rs#L587=, https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/caps.rs#L60=.

I think it's working with Code, but I do remember thinking it worked a bit weirdly. I think it was caching the result.

@charlesxsh
Copy link
Author

@lnicola that's my guess too. Thank you anyway

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

No branches or pull requests

2 participants