Skip to content

[Error - 10:32:44 PM] Request textDocument/inlayHint failed. #17376

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

Closed
dheijl opened this issue Jun 9, 2024 · 3 comments · Fixed by #17380
Closed

[Error - 10:32:44 PM] Request textDocument/inlayHint failed. #17376

dheijl opened this issue Jun 9, 2024 · 3 comments · Fixed by #17380
Assignees
Labels
C-bug Category: bug

Comments

@dheijl
Copy link

dheijl commented Jun 9, 2024

VSCode 1.90.0, with RA extension, just opening project https://github.com/dheijl/swyh-rs/ triggers this RA panic:

Panic context:
> 
version: 0.4.1990-standalone (913371fb0 2024-06-08)
request: textDocument/inlayHint InlayHintParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/c%3A/Users/Danny/source/rust/projects/swyh-rs/src/utils/audiodevices.rs",
            query: None,
            fragment: None,
        },
    },
    range: Range {
        start: Position {
            line: 203,
            character: 0,
        },
        end: Position {
            line: 299,
            character: 0,
        },
    },
}

thread 'Worker' panicked at crates\hir\src\semantics.rs:1516:13:


Failed to lookup [email protected] in this Semantics.
Make sure to use only query nodes, derived from this instance of Semantics.
root node:   [email protected]
known nodes: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]


stack backtrace:
Panic context:
> 
version: 0.4.1990-standalone (913371fb0 2024-06-08)
request: textDocument/inlayHint InlayHintParams {
    work_done_progress_params: WorkDoneProgressParams {
        work_done_token: None,
    },
    text_document: TextDocumentIdentifier {
        uri: Url {
            scheme: "file",
            cannot_be_a_base: false,
            username: "",
            password: None,
            host: None,
            port: None,
            path: "/c%3A/Users/Danny/source/rust/projects/swyh-rs/src/utils/audiodevices.rs",
            query: None,
            fragment: None,
        },
    },
    range: Range {
        start: Position {
            line: 203,
            character: 0,
        },
        end: Position {
            line: 299,
            character: 0,
        },
    },
}

thread 'Worker' panicked at crates\hir\src\semantics.rs:1516:13:


Failed to lookup [email protected] in this Semantics.
Make sure to use only query nodes, derived from this instance of Semantics.
root node:   [email protected]
known nodes: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]


   0: std::panicking::begin_panic_handler
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\panicking.rs:72
   2: hir::semantics::SemanticsImpl::find_file
   3: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
   4: <alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<T,I>>::spec_extend
   5: ide::inlay_hints::param_name::hints
   6: ide::inlay_hints::hints
   7: ide::inlay_hints::inlay_hints
   8: std::panicking::try
   9: rust_analyzer::handlers::request::handle_inlay_hints
  10: std::panicking::try
  11: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\panicking.rs:72
   2: hir::semantics::SemanticsImpl::find_file
[Error - 10:32:44 PM] Request textDocument/inlayHint failed.
  Message: request handler panicked: 

Failed to lookup [email protected] in this Semantics.
Make sure to use only query nodes, derived from this instance of Semantics.
root node:   [email protected]
known nodes: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]


  Code: -32603 
   3: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
   4: <alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<T,I>>::spec_extend
   5: ide::inlay_hints::param_name::hints
   6: ide::inlay_hints::hints
   7: ide::inlay_hints::inlay_hints
   8: std::panicking::try
   9: rust_analyzer::handlers::request::handle_inlay_hints
  10: std::panicking::try
  11: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 10:32:44 PM] Request textDocument/inlayHint failed.
  Message: request handler panicked: 

Failed to lookup [email protected] in this Semantics.
Make sure to use only query nodes, derived from this instance of Semantics.
root node:   [email protected]
known nodes: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]


  Code: -32603 
@dheijl dheijl added the C-bug Category: bug label Jun 9, 2024
@culxttes
Copy link

I've been getting the same error since I did the update

@rubin55
Copy link

rubin55 commented Jun 10, 2024

Can confirm, have the same issue, which started after I upgraded to v0.3.1992 of the VSCode rust-analyzer extension. Reverting back to the VSCode rust-analyzer extension with version v0.3.1983 fixed it for me.

@lnicola
Copy link
Member

lnicola commented Jun 11, 2024

A new stable release is now out (v0.3.1995), fixing this and #17378.

lnicola pushed a commit to lnicola/rust that referenced this issue Jun 23, 2024
fix: Remove extra parse cache from Semantics again

Should fix rust-lang/rust-analyzer#17376, specifically 30c04d5aa9523140f0f2daa07bc461534fb09b95

The recent changes here were heavily triggering what I realized in rust-lang/rust-analyzer#17367 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants