rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.31k stars 1.62k forks source link

Easy panic requesting code actions ("Can't find CONST_ARG@129..130 in AstIdMap:") #18523

Closed krobelus closed 4 days ago

krobelus commented 4 days ago

rust-analyzer version: rust-analyzer 1 (30e71b609b 2024-11-10)

rustc version: rustc 1.82.0 (f6e511eec 2024-10-15)

editor or extension: reproduced with both Kakoune and Neovim

relevant settings: none

repository link (if public, optional): https://github.com/kakoune-lsp/kakoune-lsp

  1. git clone https://github.com/kakoune-lsp/kakoune-lsp
  2. Open src/main.rs in your editor
  3. Navigate to the bottom of the file, select the line pid_files: Option<[TemporaryFile; 2]>, and move the cursor to the TemporaryFile part.
  4. Request code actions (this happens automatically in kakoune-lsp)
  5. See the LSP log (:LspLog in Neovim or :buffer *debug* in Kakoune)
crash log ``` LSP: INFO Language server stderr: request: textDocument/codeAction CodeActionParams { LSP: INFO Language server stderr: Panic context: LSP: INFO Language server stderr: > LSP: INFO Language server stderr: version: 1.82.0 (f6e511e 2024-10-15) LSP: INFO Language server stderr: text_document: TextDocumentIdentifier { LSP: INFO Language server stderr: uri: Url { LSP: INFO Language server stderr: scheme: "file", LSP: INFO Language server stderr: cannot_be_a_base: false, LSP: INFO Language server stderr: username: "", LSP: INFO Language server stderr: password: None, LSP: INFO Language server stderr: host: None, LSP: INFO Language server stderr: port: None, LSP: INFO Language server stderr: path: "/home/johannes/git/kakoune-lsp/src/main.rs", LSP: INFO Language server stderr: query: None, LSP: INFO Language server stderr: fragment: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: range: Range { LSP: INFO Language server stderr: start: Position { LSP: INFO Language server stderr: line: 667, LSP: INFO Language server stderr: character: 5, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: end: Position { LSP: INFO Language server stderr: line: 667, LSP: INFO Language server stderr: character: 5, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: context: CodeActionContext { LSP: INFO Language server stderr: diagnostics: [], LSP: INFO Language server stderr: only: None, LSP: INFO Language server stderr: trigger_kind: Some( LSP: INFO Language server stderr: Automatic, LSP: INFO Language server stderr: ), LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: work_done_progress_params: WorkDoneProgressParams { LSP: INFO Language server stderr: work_done_token: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: partial_result_params: PartialResultParams { LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: partial_result_token: None, LSP: INFO Language server stderr: } LSP: INFO Language server stderr: LSP: INFO Language server stderr: thread 'Worker' panicked at crates/span/src/ast_id.rs:226:21: LSP: INFO Language server stderr: [SyntaxNodePtr { kind: SOURCE_FILE, range: 0..490 }, SyntaxNodePtr { kind: USE, range: 0..14 }, SyntaxNodePtr { kind: IMPL, range: 16..489 }, SyntaxNodePtr { kind: FN, range: 57..217 }, SyntaxNodePtr { kind: FN, range: 223..338 }, SyntaxNodePtr { kind: FN, range: 344..487 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 116..217 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 299..338 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 443..487 }] LSP: INFO Language server stderr: Can't find CONST_ARG@129..130 in AstIdMap: LSP: INFO Language server stderr: stack backtrace: LSP: INFO Language server stderr: 0: 0x7906123ce6ea - ::fmt::h304520fd6a30aa07 LSP: INFO Language server stderr: 1: 0x790612c19525 - core::fmt::write::hf5713710ce10ff22 LSP: INFO Language server stderr: 2: 0x790613a34d91 - std::io::Write::write_fmt::hda708db57927dacf LSP: INFO Language server stderr: 3: 0x7906123d0dbb - std::panicking::default_hook::{{closure}}::he1ad87607d0c11c5 LSP: INFO Language server stderr: 4: 0x7906123d0a2e - std::panicking::default_hook::h81c8cd2e7c59ee33 LSP: INFO Language server stderr: 5: 0x5aa6c7b37b62 - ::init::{closure#0} LSP: INFO Language server stderr: 6: 0x7906123d16d7 - std::panicking::rust_panic_with_hook::had2118629c312a4a LSP: INFO Language server stderr: 7: 0x7906123d1397 - std::panicking::begin_panic_handler::{{closure}}::h7fa5985d111bafa2 LSP: INFO Language server stderr: 8: 0x7906123ceb99 - std::sys::backtrace::__rust_end_short_backtrace::h704d151dbefa09c5 LSP: INFO Language server stderr: 9: 0x7906123d1064 - rust_begin_unwind LSP: INFO Language server stderr: 10: 0x79060fa58413 - core::panicking::panic_fmt::h3eea515d05f7a35e LSP: INFO Language server stderr: 11: 0x5aa6c7a839a2 - ::erased_ast_id LSP: INFO Language server stderr: 12: 0x5aa6c7868d8d - ::from_const_arg LSP: INFO Language server stderr: 13: 0x5aa6c7865bb0 - ::from_ast LSP: INFO Language server stderr: 14: 0x5aa6c7847e02 - hir_def[d35e1fdf92332a79]::path::lower::lower_generic_args LSP: INFO Language server stderr: 15: 0x5aa6c7848a79 - ::from_src LSP: INFO Language server stderr: 16: 0x5aa6c73f4f80 - ::speculative_resolve LSP: ERRO Error response from server rust-analyzer: Failure { jsonrpc: Some(V2), error: Error { code: InternalError, message: "request handler panicked: Can't find CONST_ARG@129..130 in AstIdMap:\n[SyntaxNodePtr { kind: SOURCE_FILE, range: 0..490 }, SyntaxNodePtr { kind: USE, range: 0..14 }, SyntaxNodePtr { kind: IMPL, range: 16..489 }, SyntaxNodePtr { kind: FN, range: 57..217 }, SyntaxNodePtr { kind: FN, range: 223..338 }, SyntaxNodePtr { kind: FN, range: 344..487 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 116..217 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 299..338 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 443..487 }]", data: None }, id: Num(48) } LSP: INFO Language server stderr: 17: 0x5aa6c7339345 - > :: LSP: INFO Language server stderr: version: 1.82.0 (f6e511e 2024-10-15) LSP: ERRO Error response from server rust-analyzer: Failure { jsonrpc: Some(V2), error: Error { code: InternalError, message: "request handler panicked: Can't find CONST_ARG@129..130 in AstIdMap:\n[SyntaxNodePtr { kind: SOURCE_FILE, range: 0..490 }, SyntaxNodePtr { kind: USE, range: 0..14 }, SyntaxNodePtr { kind: IMPL, range: 16..489 }, SyntaxNodePtr { kind: FN, range: 57..217 }, SyntaxNodePtr { kind: FN, range: 223..338 }, SyntaxNodePtr { kind: FN, range: 344..487 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 116..217 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 299..338 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 443..487 }]", data: None }, id: Num(50) } LSP: INFO Language server stderr: request: textDocument/codeAction CodeActionParams { LSP: INFO Language server stderr: text_document: TextDocumentIdentifier { LSP: INFO Language server stderr: uri: Url { LSP: INFO Language server stderr: scheme: "file", LSP: INFO Language server stderr: cannot_be_a_base: false, LSP: INFO Language server stderr: username: "", LSP: INFO Language server stderr: password: None, LSP: INFO Language server stderr: host: None, LSP: INFO Language server stderr: port: None, LSP: INFO Language server stderr: path: "/home/johannes/git/kakoune-lsp/src/main.rs", LSP: INFO Language server stderr: query: None, LSP: INFO Language server stderr: fragment: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: range: Range { LSP: INFO Language server stderr: start: Position { LSP: INFO Language server stderr: line: 667, LSP: INFO Language server stderr: character: 5, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: end: Position { LSP: INFO Language server stderr: line: 667, LSP: INFO Language server stderr: character: 12, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: context: CodeActionContext { LSP: INFO Language server stderr: diagnostics: [], LSP: INFO Language server stderr: only: None, LSP: INFO Language server stderr: trigger_kind: Some( LSP: INFO Language server stderr: Automatic, LSP: INFO Language server stderr: ), LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: work_done_progress_params: WorkDoneProgressParams { LSP: INFO Language server stderr: work_done_token: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: partial_result_token: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: partial_result_params: PartialResultParams { LSP: INFO Language server stderr: LSP: INFO Language server stderr: }transform_path LSP: INFO Language server stderr: LSP: INFO Language server stderr: 18: 0x5aa6c7338a98 - ::apply LSP: INFO Language server stderr: 19: 0x5aa6c7336c75 - ::apply LSP: INFO Language server stderr: 20: 0x5aa6c722e963 - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::transform_impl LSP: INFO Language server stderr: 21: 0x5aa6c722c9a6 - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::generate_impl LSP: INFO Language server stderr: 22: 0x5aa6c722843b - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::generate_delegate_trait LSP: INFO Language server stderr: 23: 0x5aa6c71ca9ba - ide_assists[8cbd7b71de7124c8]::assists LSP: INFO Language server stderr: 24: 0x5aa6c6ed2389 - ::assists_with_fixes LSP: INFO Language server stderr: 25: 0x5aa6c6b7d176 - rust_analyzer[f220135fed6c73a2]::handlers::request::handle_code_action LSP: INFO Language server stderr: 26: 0x5aa6c69ff06c - <::spawn<>::spawn<::on_with_thread_intent::{closure#0}>::{closure#0}>::{closure#0} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} LSP: INFO Language server stderr: 27: 0x5aa6c7b34845 - std[5204e9590b4985ef]::sys::backtrace::__rust_begin_short_backtrace::<::spawn<::new::{closure#0}, ()>::{closure#0}, ()> LSP: INFO Language server stderr: 28: 0x5aa6c7b359e8 - <::spawn_unchecked_<::spawn<::new::{closure#0}, ()>::{closure#0}, ()>::{closure#1} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} LSP: INFO Language server stderr: 29: 0x790613a77d2b - std::sys::pal::unix::thread::Thread::new::thread_start::hcdbd1049068002f4 LSP: INFO Language server stderr: 30: 0x790614e8639d - LSP: INFO Language server stderr: 31: 0x790614f0b49c - LSP: INFO Language server stderr: 32: 0x0 - LSP: INFO Language server stderr: thread 'Worker' panicked at crates/span/src/ast_id.rs:226:21: LSP: INFO Language server stderr: Can't find CONST_ARG@129..130 in AstIdMap: LSP: INFO Language server stderr: [SyntaxNodePtr { kind: SOURCE_FILE, range: 0..490 }, SyntaxNodePtr { kind: USE, range: 0..14 }, SyntaxNodePtr { kind: IMPL, range: 16..489 }, SyntaxNodePtr { kind: FN, range: 57..217 }, SyntaxNodePtr { kind: FN, range: 223..338 }, SyntaxNodePtr { kind: FN, range: 344..487 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 116..217 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 299..338 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 443..487 }] LSP: INFO Language server stderr: stack backtrace: LSP: INFO Language server stderr: 0: 0x7906123ce6ea - ::fmt::h304520fd6a30aa07 LSP: INFO Language server stderr: 1: 0x790612c19525 - core::fmt::write::hf5713710ce10ff22 LSP: INFO Language server stderr: 2: 0x790613a34d91 - std::io::Write::write_fmt::hda708db57927dacf LSP: INFO Language server stderr: 3: 0x7906123d0dbb - std::panicking::default_hook::{{closure}}::he1ad87607d0c11c5 LSP: INFO Language server stderr: 4: 0x7906123d0a2e - std::panicking::default_hook::h81c8cd2e7c59ee33 LSP: INFO Language server stderr: 5: 0x5aa6c7b37b62 - ::init::{closure#0} LSP: INFO Language server stderr: 6: 0x7906123d16d7 - std::panicking::rust_panic_with_hook::had2118629c312a4a LSP: INFO Language server stderr: 7: 0x7906123d1397 - std::panicking::begin_panic_handler::{{closure}}::h7fa5985d111bafa2 LSP: INFO Language server stderr: 8: 0x7906123ceb99 - std::sys::backtrace::__rust_end_short_backtrace::h704d151dbefa09c5 LSP: INFO Language server stderr: 9: 0x7906123d1064 - rust_begin_unwind LSP: INFO Language server stderr: 10: 0x79060fa58413 - core::panicking::panic_fmt::h3eea515d05f7a35e LSP: INFO Language server stderr: 11: 0x5aa6c7a839a2 - ::erased_ast_id LSP: INFO Language server stderr: 12: 0x5aa6c7868d8d - ::from_const_arg LSP: INFO Language server stderr: 13: 0x5aa6c7865bb0 - ::from_ast LSP: INFO Language server stderr: 14: 0x5aa6c7847e02 - hir_def[d35e1fdf92332a79]::path::lower::lower_generic_args LSP: INFO Language server stderr: 15: 0x5aa6c7848a79 - ::from_src LSP: INFO Language server stderr: 16: 0x5aa6c73f4f80 - ::speculative_resolve LSP: INFO Language server stderr: 17: 0x5aa6c7339345 - ::transform_path LSP: INFO Language server stderr: 18: 0x5aa6c7338a98 - ::apply LSP: INFO Language server stderr: 19: 0x5aa6c7336c75 - ::apply LSP: INFO Language server stderr: 20: 0x5aa6c722e963 - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::transform_impl LSP: INFO Language server stderr: 21: 0x5aa6c722c9a6 - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::generate_impl LSP: INFO Language server stderr: 22: 0x5aa6c722843b - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::generate_delegate_trait LSP: INFO Language server stderr: 23: 0x5aa6c71ca9ba - ide_assists[8cbd7b71de7124c8]::assists LSP: INFO Language server stderr: 24: 0x5aa6c6ed2389 - ::assists_with_fixes LSP: INFO Language server stderr: 26: 0x5aa6c69ff06c - <::spawn<>::spawn<::on_with_thread_intent::{closure#0}>::{closure#0}>::{closure#0} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} LSP: INFO Language server stderr: 27: 0x5aa6c7b34845 - std[5204e9590b4985ef]::sys::backtrace::__rust_begin_short_backtrace::<::spawn<::new::{closure#0}, ()>::{closure#0}, ()> LSP: INFO Language server stderr: 25: 0x5aa6c6b7d176 - rust_analyzer[f220135fed6c73a2]::handlers::request::handle_code_action LSP: INFO Language server stderr: 28: 0x5aa6c7b359e8 - <::spawn_unchecked_<::spawn<::new::{closure#0}, ()>::{closure#0}, ()>::{closure#1} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} LSP: INFO Language server stderr: 30: 0x790614e8639d - LSP: INFO Language server stderr: 29: 0x790613a77d2b - std::sys::pal::unix::thread::Thread::new::thread_start::hcdbd1049068002f4 LSP: INFO Language server stderr: 31: 0x790614f0b49c - LSP: INFO Language server stderr: 32: 0x0 - LSP: INFO Language server stderr: Panic context: LSP: INFO Language server stderr: text_document: TextDocumentIdentifier { LSP: INFO Language server stderr: > LSP: INFO Language server stderr: request: textDocument/codeAction CodeActionParams { LSP: INFO Language server stderr: version: 1.82.0 (f6e511e 2024-10-15) LSP: INFO Language server stderr: uri: Url { LSP: INFO Language server stderr: cannot_be_a_base: false, LSP: INFO Language server stderr: scheme: "file", LSP: ERRO Error response from server rust-analyzer: Failure { jsonrpc: Some(V2), error: Error { code: InternalError, message: "request handler panicked: Can't find CONST_ARG@129..130 in AstIdMap:\n[SyntaxNodePtr { kind: SOURCE_FILE, range: 0..490 }, SyntaxNodePtr { kind: USE, range: 0..14 }, SyntaxNodePtr { kind: IMPL, range: 16..489 }, SyntaxNodePtr { kind: FN, range: 57..217 }, SyntaxNodePtr { kind: FN, range: 223..338 }, SyntaxNodePtr { kind: FN, range: 344..487 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 116..217 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 299..338 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 443..487 }]", data: None }, id: Num(52) } LSP: INFO Language server stderr: username: "", LSP: INFO Language server stderr: host: None, LSP: INFO Language server stderr: password: None, LSP: INFO Language server stderr: port: None, LSP: INFO Language server stderr: path: "/home/johannes/git/kakoune-lsp/src/main.rs", LSP: INFO Language server stderr: query: None, LSP: INFO Language server stderr: fragment: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: range: Range { LSP: INFO Language server stderr: start: Position { LSP: INFO Language server stderr: line: 667, LSP: INFO Language server stderr: character: 13, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: end: Position { LSP: INFO Language server stderr: line: 667, LSP: INFO Language server stderr: character: 13, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: context: CodeActionContext { LSP: INFO Language server stderr: diagnostics: [], LSP: INFO Language server stderr: trigger_kind: Some( LSP: INFO Language server stderr: only: None, LSP: INFO Language server stderr: Automatic, LSP: INFO Language server stderr: ), LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: work_done_progress_params: WorkDoneProgressParams { LSP: INFO Language server stderr: work_done_token: None, LSP: INFO Language server stderr: partial_result_params: PartialResultParams { LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: partial_result_token: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: } LSP: INFO Language server stderr: LSP: INFO Language server stderr: thread 'Worker' panicked at crates/span/src/ast_id.rs:226:21: LSP: INFO Language server stderr: Can't find CONST_ARG@129..130 in AstIdMap: LSP: INFO Language server stderr: [SyntaxNodePtr { kind: SOURCE_FILE, range: 0..490 }, SyntaxNodePtr { kind: USE, range: 0..14 }, SyntaxNodePtr { kind: IMPL, range: 16..489 }, SyntaxNodePtr { kind: FN, range: 57..217 }, SyntaxNodePtr { kind: FN, range: 223..338 }, SyntaxNodePtr { kind: FN, range: 344..487 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 116..217 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 299..338 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 443..487 }] LSP: INFO Language server stderr: stack backtrace: LSP: INFO Language server stderr: 0: 0x7906123ce6ea - ::fmt::h304520fd6a30aa07 LSP: INFO Language server stderr: 1: 0x790612c19525 - core::fmt::write::hf5713710ce10ff22 LSP: INFO Language server stderr: 2: 0x790613a34d91 - std::io::Write::write_fmt::hda708db57927dacf LSP: INFO Language server stderr: 3: 0x7906123d0dbb - std::panicking::default_hook::{{closure}}::he1ad87607d0c11c5 LSP: INFO Language server stderr: 4: 0x7906123d0a2e - std::panicking::default_hook::h81c8cd2e7c59ee33 LSP: INFO Language server stderr: 5: 0x5aa6c7b37b62 - ::init::{closure#0} LSP: INFO Language server stderr: 6: 0x7906123d16d7 - std::panicking::rust_panic_with_hook::had2118629c312a4a LSP: INFO Language server stderr: 7: 0x7906123d1397 - std::panicking::begin_panic_handler::{{closure}}::h7fa5985d111bafa2 LSP: INFO Language server stderr: 8: 0x7906123ceb99 - std::sys::backtrace::__rust_end_short_backtrace::h704d151dbefa09c5 LSP: INFO Language server stderr: 9: 0x7906123d1064 - rust_begin_unwind LSP: INFO Language server stderr: 10: 0x79060fa58413 - core::panicking::panic_fmt::h3eea515d05f7a35e LSP: INFO Language server stderr: 11: 0x5aa6c7a839a2 - ::erased_ast_id LSP: INFO Language server stderr: 12: 0x5aa6c7868d8d - ::from_const_arg LSP: INFO Language server stderr: 13: 0x5aa6c7865bb0 - ::from_ast LSP: INFO Language server stderr: 14: 0x5aa6c7847e02 - hir_def[d35e1fdf92332a79]::path::lower::lower_generic_args LSP: INFO Language server stderr: 15: 0x5aa6c7848a79 - ::from_src LSP: INFO Language server stderr: 16: 0x5aa6c73f4f80 - ::speculative_resolve LSP: INFO Language server stderr: 17: 0x5aa6c7339345 - ::transform_path LSP: INFO Language server stderr: 18: 0x5aa6c7338a98 - ::apply LSP: INFO Language server stderr: 19: 0x5aa6c7336c75 - ::apply LSP: INFO Language server stderr: 20: 0x5aa6c722e963 - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::transform_impl LSP: INFO Language server stderr: 21: 0x5aa6c722c9a6 - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::generate_impl LSP: INFO Language server stderr: 22: 0x5aa6c722843b - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::generate_delegate_trait LSP: INFO Language server stderr: 23: 0x5aa6c71ca9ba - ide_assists[8cbd7b71de7124c8]::assists LSP: INFO Language server stderr: 24: 0x5aa6c6ed2389 - ::assists_with_fixes LSP: INFO Language server stderr: 25: 0x5aa6c6b7d176 - rust_analyzer[f220135fed6c73a2]::handlers::request::handle_code_action LSP: INFO Language server stderr: 26: 0x5aa6c69ff06c - <::spawn<>::spawn<::on_with_thread_intent::{closure#0}>::{closure#0}>::{closure#0} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} LSP: INFO Language server stderr: 27: 0x5aa6c7b34845 - std[5204e9590b4985ef]::sys::backtrace::__rust_begin_short_backtrace::<::spawn<::new::{closure#0}, ()>::{closure#0}, ()> LSP: INFO Language server stderr: 28: 0x5aa6c7b359e8 - <::spawn_unchecked_<::spawn<::new::{closure#0}, ()>::{closure#0}, ()>::{closure#1} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} LSP: INFO Language server stderr: 29: 0x790613a77d2b - std::sys::pal::unix::thread::Thread::new::thread_start::hcdbd1049068002f4 LSP: INFO Language server stderr: 30: 0x790614e8639d - LSP: INFO Language server stderr: 31: 0x790614f0b49c - LSP: INFO Language server stderr: 32: 0x0 - LSP: INFO Language server stderr: Panic context: LSP: INFO Language server stderr: > LSP: INFO Language server stderr: request: textDocument/codeAction CodeActionParams { LSP: INFO Language server stderr: version: 1.82.0 (f6e511e 2024-10-15) LSP: INFO Language server stderr: uri: Url { LSP: INFO Language server stderr: text_document: TextDocumentIdentifier { LSP: ERRO Error response from server rust-analyzer: Failure { jsonrpc: Some(V2), error: Error { code: InternalError, message: "request handler panicked: Can't find CONST_ARG@129..130 in AstIdMap:\n[SyntaxNodePtr { kind: SOURCE_FILE, range: 0..490 }, SyntaxNodePtr { kind: USE, range: 0..14 }, SyntaxNodePtr { kind: IMPL, range: 16..489 }, SyntaxNodePtr { kind: FN, range: 57..217 }, SyntaxNodePtr { kind: FN, range: 223..338 }, SyntaxNodePtr { kind: FN, range: 344..487 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 116..217 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 299..338 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 443..487 }]", data: None }, id: Num(54) } LSP: INFO Language server stderr: username: "", LSP: INFO Language server stderr: cannot_be_a_base: false, LSP: INFO Language server stderr: password: None, LSP: INFO Language server stderr: scheme: "file", LSP: INFO Language server stderr: host: None, LSP: INFO Language server stderr: port: None, LSP: INFO Language server stderr: path: "/home/johannes/git/kakoune-lsp/src/main.rs", LSP: INFO Language server stderr: query: None, LSP: INFO Language server stderr: fragment: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: range: Range { LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: start: Position { LSP: INFO Language server stderr: line: 667, LSP: INFO Language server stderr: character: 14, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: end: Position { LSP: INFO Language server stderr: line: 667, LSP: INFO Language server stderr: character: 20, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: context: CodeActionContext { LSP: INFO Language server stderr: diagnostics: [], LSP: INFO Language server stderr: only: None, LSP: INFO Language server stderr: trigger_kind: Some( LSP: INFO Language server stderr: ), LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: work_done_progress_params: WorkDoneProgressParams { LSP: INFO Language server stderr: Automatic, LSP: INFO Language server stderr: work_done_token: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: partial_result_params: PartialResultParams { LSP: INFO Language server stderr: partial_result_token: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: LSP: INFO Language server stderr: } LSP: INFO Language server stderr: thread 'Worker' panicked at crates/span/src/ast_id.rs:226:21: LSP: INFO Language server stderr: Can't find CONST_ARG@129..130 in AstIdMap: LSP: INFO Language server stderr: stack backtrace: LSP: INFO Language server stderr: [SyntaxNodePtr { kind: SOURCE_FILE, range: 0..490 }, SyntaxNodePtr { kind: USE, range: 0..14 }, SyntaxNodePtr { kind: IMPL, range: 16..489 }, SyntaxNodePtr { kind: FN, range: 57..217 }, SyntaxNodePtr { kind: FN, range: 223..338 }, SyntaxNodePtr { kind: FN, range: 344..487 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 116..217 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 299..338 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 443..487 }] LSP: INFO Language server stderr: 0: 0x7906123ce6ea - ::fmt::h304520fd6a30aa07 LSP: INFO Language server stderr: 1: 0x790612c19525 - core::fmt::write::hf5713710ce10ff22 LSP: INFO Language server stderr: 2: 0x790613a34d91 - std::io::Write::write_fmt::hda708db57927dacf LSP: INFO Language server stderr: 3: 0x7906123d0dbb - std::panicking::default_hook::{{closure}}::he1ad87607d0c11c5 LSP: INFO Language server stderr: 4: 0x7906123d0a2e - std::panicking::default_hook::h81c8cd2e7c59ee33 LSP: INFO Language server stderr: 5: 0x5aa6c7b37b62 - ::init::{closure#0} LSP: INFO Language server stderr: 6: 0x7906123d16d7 - std::panicking::rust_panic_with_hook::had2118629c312a4a LSP: INFO Language server stderr: 7: 0x7906123d1397 - std::panicking::begin_panic_handler::{{closure}}::h7fa5985d111bafa2 LSP: INFO Language server stderr: 8: 0x7906123ceb99 - std::sys::backtrace::__rust_end_short_backtrace::h704d151dbefa09c5 LSP: INFO Language server stderr: 9: 0x7906123d1064 - rust_begin_unwind LSP: INFO Language server stderr: 10: 0x79060fa58413 - core::panicking::panic_fmt::h3eea515d05f7a35e LSP: INFO Language server stderr: 11: 0x5aa6c7a839a2 - ::erased_ast_id LSP: INFO Language server stderr: 12: 0x5aa6c7868d8d - ::from_const_arg LSP: INFO Language server stderr: 13: 0x5aa6c7865bb0 - ::from_ast LSP: INFO Language server stderr: 14: 0x5aa6c7847e02 - hir_def[d35e1fdf92332a79]::path::lower::lower_generic_args LSP: INFO Language server stderr: 15: 0x5aa6c7848a79 - ::from_src LSP: INFO Language server stderr: 16: 0x5aa6c73f4f80 - ::speculative_resolve LSP: INFO Language server stderr: 17: 0x5aa6c7339345 - ::transform_path LSP: INFO Language server stderr: 18: 0x5aa6c7338a98 - ::apply LSP: INFO Language server stderr: 19: 0x5aa6c7336c75 - ::apply LSP: INFO Language server stderr: 20: 0x5aa6c722e963 - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::transform_impl LSP: INFO Language server stderr: 21: 0x5aa6c722c9a6 - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::generate_impl LSP: INFO Language server stderr: 22: 0x5aa6c722843b - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::generate_delegate_trait LSP: INFO Language server stderr: 23: 0x5aa6c71ca9ba - ide_assists[8cbd7b71de7124c8]::assists LSP: INFO Language server stderr: 24: 0x5aa6c6ed2389 - ::assists_with_fixes LSP: INFO Language server stderr: 25: 0x5aa6c6b7d176 - rust_analyzer[f220135fed6c73a2]::handlers::request::handle_code_action LSP: INFO Language server stderr: 26: 0x5aa6c69ff06c - <::spawn<>::spawn<::on_with_thread_intent::{closure#0}>::{closure#0}>::{closure#0} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} LSP: INFO Language server stderr: 27: 0x5aa6c7b34845 - std[5204e9590b4985ef]::sys::backtrace::__rust_begin_short_backtrace::<::spawn<::new::{closure#0}, ()>::{closure#0}, ()> LSP: INFO Language server stderr: 28: 0x5aa6c7b359e8 - <::spawn_unchecked_<::spawn<::new::{closure#0}, ()>::{closure#0}, ()>::{closure#1} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} LSP: INFO Language server stderr: 29: 0x790613a77d2b - std::sys::pal::unix::thread::Thread::new::thread_start::hcdbd1049068002f4 LSP: INFO Language server stderr: 30: 0x790614e8639d - LSP: INFO Language server stderr: 31: 0x790614f0b49c - LSP: INFO Language server stderr: 32: 0x0 - LSP: INFO Language server stderr: > LSP: INFO Language server stderr: version: 1.82.0 (f6e511e 2024-10-15) LSP: INFO Language server stderr: text_document: TextDocumentIdentifier { LSP: INFO Language server stderr: Panic context: LSP: INFO Language server stderr: request: textDocument/codeAction CodeActionParams { LSP: ERRO Error response from server rust-analyzer: Failure { jsonrpc: Some(V2), error: Error { code: InternalError, message: "request handler panicked: Can't find CONST_ARG@129..130 in AstIdMap:\n[SyntaxNodePtr { kind: SOURCE_FILE, range: 0..490 }, SyntaxNodePtr { kind: USE, range: 0..14 }, SyntaxNodePtr { kind: IMPL, range: 16..489 }, SyntaxNodePtr { kind: FN, range: 57..217 }, SyntaxNodePtr { kind: FN, range: 223..338 }, SyntaxNodePtr { kind: FN, range: 344..487 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 116..217 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 299..338 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 443..487 }]", data: None }, id: Num(56) } LSP: INFO Language server stderr: uri: Url { LSP: INFO Language server stderr: scheme: "file", LSP: INFO Language server stderr: cannot_be_a_base: false, LSP: INFO Language server stderr: username: "", LSP: INFO Language server stderr: password: None, LSP: INFO Language server stderr: host: None, LSP: INFO Language server stderr: port: None, LSP: INFO Language server stderr: path: "/home/johannes/git/kakoune-lsp/src/main.rs", LSP: INFO Language server stderr: query: None, LSP: INFO Language server stderr: fragment: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: range: Range { LSP: INFO Language server stderr: start: Position { LSP: INFO Language server stderr: line: 667, LSP: INFO Language server stderr: character: 21, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: end: Position { LSP: INFO Language server stderr: line: 667, LSP: INFO Language server stderr: character: 22, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: context: CodeActionContext { LSP: INFO Language server stderr: diagnostics: [], LSP: INFO Language server stderr: only: None, LSP: INFO Language server stderr: trigger_kind: Some( LSP: INFO Language server stderr: Automatic, LSP: INFO Language server stderr: ), LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: work_done_progress_params: WorkDoneProgressParams { LSP: INFO Language server stderr: work_done_token: None, LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: partial_result_token: None, LSP: INFO Language server stderr: partial_result_params: PartialResultParams { LSP: INFO Language server stderr: }, LSP: INFO Language server stderr: } LSP: INFO Language server stderr: LSP: INFO Language server stderr: thread 'Worker' panicked at crates/span/src/ast_id.rs:226:21: LSP: INFO Language server stderr: Can't find CONST_ARG@129..130 in AstIdMap: LSP: INFO Language server stderr: [SyntaxNodePtr { kind: SOURCE_FILE, range: 0..490 }, SyntaxNodePtr { kind: USE, range: 0..14 }, SyntaxNodePtr { kind: IMPL, range: 16..489 }, SyntaxNodePtr { kind: FN, range: 57..217 }, SyntaxNodePtr { kind: FN, range: 223..338 }, SyntaxNodePtr { kind: FN, range: 344..487 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 116..217 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 299..338 }, SyntaxNodePtr { kind: BLOCK_EXPR, range: 443..487 }] LSP: INFO Language server stderr: stack backtrace: LSP: INFO Language server stderr: 0: 0x7906123ce6ea - ::fmt::h304520fd6a30aa07 LSP: INFO Language server stderr: 1: 0x790612c19525 - core::fmt::write::hf5713710ce10ff22 LSP: INFO Language server stderr: 2: 0x790613a34d91 - std::io::Write::write_fmt::hda708db57927dacf LSP: INFO Language server stderr: 3: 0x7906123d0dbb - std::panicking::default_hook::{{closure}}::he1ad87607d0c11c5 LSP: INFO Language server stderr: 4: 0x7906123d0a2e - std::panicking::default_hook::h81c8cd2e7c59ee33 LSP: INFO Language server stderr: 5: 0x5aa6c7b37b62 - ::init::{closure#0} LSP: INFO Language server stderr: 6: 0x7906123d16d7 - std::panicking::rust_panic_with_hook::had2118629c312a4a LSP: INFO Language server stderr: 7: 0x7906123d1397 - std::panicking::begin_panic_handler::{{closure}}::h7fa5985d111bafa2 LSP: INFO Language server stderr: 8: 0x7906123ceb99 - std::sys::backtrace::__rust_end_short_backtrace::h704d151dbefa09c5 LSP: INFO Language server stderr: 9: 0x7906123d1064 - rust_begin_unwind LSP: INFO Language server stderr: 10: 0x79060fa58413 - core::panicking::panic_fmt::h3eea515d05f7a35e LSP: INFO Language server stderr: 11: 0x5aa6c7a839a2 - ::erased_ast_id LSP: INFO Language server stderr: 12: 0x5aa6c7868d8d - ::from_const_arg LSP: INFO Language server stderr: 13: 0x5aa6c7865bb0 - ::from_ast LSP: INFO Language server stderr: 14: 0x5aa6c7847e02 - hir_def[d35e1fdf92332a79]::path::lower::lower_generic_args LSP: INFO Language server stderr: 15: 0x5aa6c7848a79 - ::from_src LSP: INFO Language server stderr: 16: 0x5aa6c73f4f80 - ::speculative_resolve LSP: INFO Language server stderr: 17: 0x5aa6c7339345 - ::transform_path LSP: INFO Language server stderr: 18: 0x5aa6c7338a98 - ::apply LSP: INFO Language server stderr: 19: 0x5aa6c7336c75 - ::apply LSP: INFO Language server stderr: 20: 0x5aa6c722e963 - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::transform_impl LSP: INFO Language server stderr: 21: 0x5aa6c722c9a6 - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::generate_impl LSP: INFO Language server stderr: 22: 0x5aa6c722843b - ide_assists[8cbd7b71de7124c8]::handlers::generate_delegate_trait::generate_delegate_trait LSP: INFO Language server stderr: 23: 0x5aa6c71ca9ba - ide_assists[8cbd7b71de7124c8]::assists LSP: INFO Language server stderr: 24: 0x5aa6c6ed2389 - ::assists_with_fixes LSP: INFO Language server stderr: 25: 0x5aa6c6b7d176 - rust_analyzer[f220135fed6c73a2]::handlers::request::handle_code_action LSP: INFO Language server stderr: 26: 0x5aa6c69ff06c - <::spawn<>::spawn<::on_with_thread_intent::{closure#0}>::{closure#0}>::{closure#0} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} LSP: INFO Language server stderr: 27: 0x5aa6c7b34845 - std[5204e9590b4985ef]::sys::backtrace::__rust_begin_short_backtrace::<::spawn<::new::{closure#0}, ()>::{closure#0}, ()> LSP: INFO Language server stderr: 28: 0x5aa6c7b359e8 - <::spawn_unchecked_<::spawn<::new::{closure#0}, ()>::{closure#0}, ()>::{closure#1} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} LSP: INFO Language server stderr: 30: 0x790614e8639d - LSP: INFO Language server stderr: 29: 0x790613a77d2b - std::sys::pal::unix::thread::Thread::new::thread_start::hcdbd1049068002f4 LSP: INFO Language server stderr: 31: 0x790614f0b49c - LSP: INFO Language server stderr: 32: 0x0 - ```
lnicola commented 4 days ago

Duplicate of #18523.

krobelus commented 4 days ago

I guess you mean one of

17321 (thread 'Worker' panicked at crates/span/src/ast_id.rs:203:21:)

or #17214 (rust-analyzer panics when applying "Implement missing members" quick fix: Can't find CONST_ARG@202..229 in AstIdMap)

lnicola commented 4 days ago

Yeah, sorry, I meant #17321 šŸ¤¦. But you also mixed up the issue titles.