Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 6396ef9

Browse files
authored
Merge pull request #481 from jonasbb/avoid-crash
The call can be inside the new thread to avoid crashing RLS if it fails
2 parents d4f3736 + 2c32d58 commit 6396ef9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/actions/requests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ impl<'a> RequestAction<'a> for FindImpls {
141141
let ctx = ctx.inited();
142142
let file_path = parse_file_path!(&params.text_document.uri, "find_impls")?;
143143
let span = ctx.convert_pos_to_span(file_path, params.position);
144-
let type_id = ctx.analysis.id(&span).expect("Analysis: Getting typeid from span");
145144
let analysis = ctx.analysis.clone();
146145

147146
let handle = thread::spawn(move || {
147+
let type_id = analysis.id(&span)?;
148148
let result = analysis.find_impls(type_id).map(|spans| {
149149
spans.into_iter().map(|x| ls_util::rls_to_location(&x)).collect()
150150
});

0 commit comments

Comments
 (0)