From 8338acfd3a9a9e5ab099abd5f01b5c43245daf0a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 15 Jan 2019 21:17:10 +0300 Subject: kill last cancelables --- crates/ra_ide_api/src/imp.rs | 5 ++--- crates/ra_ide_api/src/lib.rs | 4 ++-- crates/ra_ide_api/src/syntax_highlighting.rs | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/imp.rs b/crates/ra_ide_api/src/imp.rs index a21cae624..61771ed40 100644 --- a/crates/ra_ide_api/src/imp.rs +++ b/crates/ra_ide_api/src/imp.rs @@ -15,7 +15,6 @@ use ra_syntax::{ use crate::{ AnalysisChange, - Cancelable, CrateId, db, Diagnostic, FileId, FilePosition, FileRange, FileSystemEdit, Query, RootChange, SourceChange, SourceFileEdit, symbol_index::{LibrarySymbolsQuery, FileSymbol}, @@ -158,7 +157,7 @@ impl db::RootDatabase { } } - pub(crate) fn diagnostics(&self, file_id: FileId) -> Cancelable> { + pub(crate) fn diagnostics(&self, file_id: FileId) -> Vec { let syntax = self.source_file(file_id); let mut res = ra_ide_api_light::diagnostics(&syntax) @@ -219,7 +218,7 @@ impl db::RootDatabase { res.push(diag) } }; - Ok(res) + res } pub(crate) fn assists(&self, frange: FileRange) -> Vec { diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index ea5267ad9..3a0d2dbbe 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs @@ -429,7 +429,7 @@ impl Analysis { /// Computes syntax highlighting for the given file. pub fn highlight(&self, file_id: FileId) -> Cancelable> { self.db - .catch_canceled(|db| syntax_highlighting::highlight(db, file_id))? + .catch_canceled(|db| syntax_highlighting::highlight(db, file_id)) } /// Computes completions at the given position. @@ -448,7 +448,7 @@ impl Analysis { /// Computes the set of diagnostics for the given file. pub fn diagnostics(&self, file_id: FileId) -> Cancelable> { - self.with_db(|db| db.diagnostics(file_id))? + self.with_db(|db| db.diagnostics(file_id)) } /// Computes the type of the expression at the given position. diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide_api/src/syntax_highlighting.rs index 480b78dce..a4d3ad005 100644 --- a/crates/ra_ide_api/src/syntax_highlighting.rs +++ b/crates/ra_ide_api/src/syntax_highlighting.rs @@ -2,11 +2,11 @@ use ra_syntax::{ast, AstNode,}; use ra_db::SyntaxDatabase; use crate::{ - FileId, Cancelable, HighlightedRange, + FileId, HighlightedRange, db::RootDatabase, }; -pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Cancelable> { +pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec { let source_file = db.source_file(file_id); let mut res = ra_ide_api_light::highlight(source_file.syntax()); for macro_call in source_file @@ -28,7 +28,7 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Cancelable