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

Mouseover for RustAnalyzer not working in VSCode. #210

Open
Nucl3arSn3k opened this issue Aug 5, 2023 · 3 comments
Open

Mouseover for RustAnalyzer not working in VSCode. #210

Nucl3arSn3k opened this issue Aug 5, 2023 · 3 comments

Comments

@Nucl3arSn3k
Copy link

After fixing my rust analyzer install, mouseover doesn't work for showing me the details of what type a variable is. I've tried disabling and reenabling it, and I've also tried reinstalling the rust analyzer executable as well as the extension. What else can I do to fix this?

@Nucl3arSn3k
Copy link
Author

I'm also getting this error,which could be related.
[ERROR rust_analyzer::dispatch] unknown request: Request { id: RequestId(I32(14)), method: "rust-analyzer/fetchDependencyList", params: Object {} }

@lnicola
Copy link
Member

lnicola commented Aug 5, 2023

I suspect you have a mismatched extension and server binary. Did you set rust-analyzer.server.path? The extension comes with a bundled server, and you don't need to change it on the major platforms.

If that doesn't fix it, please file an issue in the proper repository and include the required information (version, settings, code sample etc.).

lnicola added a commit that referenced this issue Dec 4, 2023
@c-git
Copy link

c-git commented Dec 15, 2023

I'm getting a similar error and I don't know why or what is triggering it. I've been getting it for a few days and mostly ignoring it but figured might be worthwhile mentioning it. Only rust code I've been working on recently has been my Shuttle CCH Solutions so I'm not sure if it's related to that code specifically or a new RA. Putting a copy of the log below, happy to provide more info as needed.

Panic context:
> 
version: 0.3.1766-standalone
request: textDocument/hover HoverParams {
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/home/one/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs",
            query: None,
            fragment: None,
        },
    },
    position: Position(
        Position {
            line: 364,
            character: 11,
        },
    ),
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
}

thread 'Worker' panicked at /github/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/line-index-0.1.0-pre.1/src/lib.rs:148:35:
invalid offset
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_fmt
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_display
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:168:5
   3: core::panicking::panic_str
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:152:5
   4: core::option::expect_failed
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/option.rs:1988:5
   5: rust_analyzer::lsp::to_proto::range
   6: rust_analyzer::lsp::to_proto::location_from_nav
   7: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
   8: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
   9: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  10: rust_analyzer::handlers::request::handle_hover
  11: std::panicking::try
  12: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 17:07:45] Request textDocument/hover failed.
  Message: request handler panicked: invalid offset
  Code: -32603 

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

No branches or pull requests

3 participants