]> git.lizzy.rs Git - rust.git/commitdiff
kill last cancelables
authorAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 15 Jan 2019 18:17:10 +0000 (21:17 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 15 Jan 2019 18:17:10 +0000 (21:17 +0300)
crates/ra_ide_api/src/imp.rs
crates/ra_ide_api/src/lib.rs
crates/ra_ide_api/src/syntax_highlighting.rs

index a21cae62474f907235bc47b87396ee63c486eb0a..61771ed40efd3c3ea0753fe0e09e06dd05c410ce 100644 (file)
@@ -15,7 +15,6 @@
 
 use crate::{
     AnalysisChange,
-    Cancelable,
     CrateId, db, Diagnostic, FileId, FilePosition, FileRange, FileSystemEdit,
     Query, RootChange, SourceChange, SourceFileEdit,
     symbol_index::{LibrarySymbolsQuery, FileSymbol},
@@ -158,7 +157,7 @@ fn find_binding<'a>(
         }
     }
 
-    pub(crate) fn diagnostics(&self, file_id: FileId) -> Cancelable<Vec<Diagnostic>> {
+    pub(crate) fn diagnostics(&self, file_id: FileId) -> Vec<Diagnostic> {
         let syntax = self.source_file(file_id);
 
         let mut res = ra_ide_api_light::diagnostics(&syntax)
@@ -219,7 +218,7 @@ pub(crate) fn diagnostics(&self, file_id: FileId) -> Cancelable<Vec<Diagnostic>>
                 res.push(diag)
             }
         };
-        Ok(res)
+        res
     }
 
     pub(crate) fn assists(&self, frange: FileRange) -> Vec<SourceChange> {
index ea5267ad9e2cc1c824965807778ec6101d0b9a8d..3a0d2dbbea52b7bcceb9826a3ffda9edb2e75a3e 100644 (file)
@@ -429,7 +429,7 @@ pub fn runnables(&self, file_id: FileId) -> Cancelable<Vec<Runnable>> {
     /// Computes syntax highlighting for the given file.
     pub fn highlight(&self, file_id: FileId) -> Cancelable<Vec<HighlightedRange>> {
         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 @@ pub fn assists(&self, frange: FileRange) -> Cancelable<Vec<SourceChange>> {
 
     /// Computes the set of diagnostics for the given file.
     pub fn diagnostics(&self, file_id: FileId) -> Cancelable<Vec<Diagnostic>> {
-        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.
index 480b78dcec7f8fe2675a61b8b0dcf54e333613e4..a4d3ad0058126b4f0da47cc4b8e6c4f4419dc7b8 100644 (file)
@@ -2,11 +2,11 @@
 use ra_db::SyntaxDatabase;
 
 use crate::{
-    FileId, Cancelable, HighlightedRange,
+    FileId, HighlightedRange,
     db::RootDatabase,
 };
 
-pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Cancelable<Vec<HighlightedRange>> {
+pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRange> {
     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<Vec<Hi
             res.extend(mapped_ranges);
         }
     }
-    Ok(res)
+    res
 }
 
 #[cfg(test)]