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

The call can be inside the new thread to avoid crashing RLS if it fails #481

Merged
merged 1 commit into from
Sep 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/actions/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ impl<'a> RequestAction<'a> for FindImpls {
let ctx = ctx.inited();
let file_path = parse_file_path!(&params.text_document.uri, "find_impls")?;
let span = ctx.convert_pos_to_span(file_path, params.position);
let type_id = ctx.analysis.id(&span).expect("Analysis: Getting typeid from span");
let analysis = ctx.analysis.clone();

let handle = thread::spawn(move || {
let type_id = analysis.id(&span)?;
let result = analysis.find_impls(type_id).map(|spans| {
spans.into_iter().map(|x| ls_util::rls_to_location(&x)).collect()
});
Expand Down