-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Typing a. in an indented string literal wrapped inside of indoc, results in a textDocument/completion failure.
Output > Rust Analyzer Language Server
Panic context: > version: 0.3.1325-standalone request: textDocument/completion CompletionParams { text_document_position: TextDocumentPositionParams { text_document: TextDocumentIdentifier { uri: Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/home/jan/dev/ra-completion-fail/src/main.rs", query: None, fragment: None, }, }, position: Position { line: 8, character: 10, }, }, work_done_progress_params: WorkDoneProgressParams { work_done_token: None, }, partial_result_params: PartialResultParams { partial_result_token: None, }, context: Some( CompletionContext { trigger_kind: TriggerCharacter, trigger_character: Some( ".", ), }, ), }
thread 'Worker' panicked at 'Bad offset: range 0..5 offset 12', /github/home/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/rowan-0.15.10/src/cursor.rs:751:9
stack backtrace:
0: rust_begin_unwind
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
2: rowan::cursor::SyntaxNode::token_at_offset
3: ide_completion::context::analysis::expand_and_analyze
4: ide_completion::context::CompletionContext::new
5: ide_completion::completions
6: std::panicking::try
7: rust_analyzer::handlers::handle_completion
8: std::panicking::try
9: ::call_box
note: Some details are omitted, run withRUST_BACKTRACE=fullfor a verbose backtrace.
[Error - 1:02:23 PM] Request textDocument/completion failed.
Message: request handler panicked: Bad offset: range 0..5 offset 12
Code: -32603
Minimal reproducible example is available in this repository, but the code is just:
use indoc::indoc;
fn main() {
// delete the `.` and type it again
indoc! {
"
a.
"
};
}Not sure if it's relevant, but the following does not fail:
use indoc::indoc;
fn main() {
// no failure when retyping the `.`
indoc! {
"a."
}
}rust-analyzer version: 0.3.1325-standalone (using vscode plugin)
rustc version: rustc 1.66.0 (69f9c33d7 2022-12-12)
relevant settings: none