You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnmain(){
あ // Typing "あ" here causes a panic.}fnあい(){}
Expected Behavior
Rust Analyzer should handle the input without errors.
Actual Behavior
Rust Analyzer panics with the following error message:
Panic context:
>
version: 0.3.2257-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/kazune/workspace/hoge/src/main.rs",
query: None,
fragment: None,
},
},
position: Position {
line: 1,
character: 5,
},
},
work_done_progress_params: WorkDoneProgressParams {
work_done_token: None,
},
partial_result_params: PartialResultParams {
partial_result_token: None,
},
context: Some(
CompletionContext {
trigger_kind: Invoked,
trigger_character: None,
},
),
}
thread 'Worker' panicked at crates/hir-def/src/import_map.rs:323:41:
byte index 1 is not a char boundary; it is inside 'あ' (bytes 0..3) of `あい`
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::str::slice_error_fail_rt
3: core::str::slice_error_fail
4: hir_def::import_map::SearchMode::check
5: ide_db::symbol_index::Query::search_maps
6: ide_db::items_locator::items_with_name
7: ide_db::imports::import_assets::ImportAssets::search_for
8: ide_db::imports::import_assets::ImportAssets::search_for_imports
9: ide_completion::completions::flyimport::import_on_the_fly_path
10: ide_completion::completions::complete_name_ref
11: ide_completion::completions
12: ide::Analysis::completions
13: rust_analyzer::handlers::request::handle_completion
14: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 10:10:50 AM] Request textDocument/completion failed.
Message: request handler panicked: byte index 1 is not a char boundary; it is inside 'あ' (bytes 0..3) of `あい`
Code: -32603
Additional Information
The error appears to be related to how Rust Analyzer handles Unicode input, specifically in the context of Japanese characters. The error suggests a boundary issue with UTF-8 characters.
Please let me know if further details or logs are needed. Thank you for your support!
The text was updated successfully, but these errors were encountered:
rust-analyzer version: 0.3.2257-standalone
rustc version: rustc 1.83.0 (90b35a623 2024-11-26)
editor or extension: VSCode
Code Snippet to Reproduce
Expected Behavior
Rust Analyzer should handle the input without errors.
Actual Behavior
Rust Analyzer panics with the following error message:
Additional Information
The error appears to be related to how Rust Analyzer handles Unicode input, specifically in the context of Japanese characters. The error suggests a boundary issue with UTF-8 characters.
Please let me know if further details or logs are needed. Thank you for your support!
The text was updated successfully, but these errors were encountered: