use crate::{
AnalysisChange,
- Cancelable,
CrateId, db, Diagnostic, FileId, FilePosition, FileRange, FileSystemEdit,
Query, RootChange, SourceChange, SourceFileEdit,
symbol_index::{LibrarySymbolsQuery, FileSymbol},
}
}
- 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)
res.push(diag)
}
};
- Ok(res)
+ res
}
pub(crate) fn assists(&self, frange: FileRange) -> Vec<SourceChange> {
/// 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.
/// 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.
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
res.extend(mapped_ranges);
}
}
- Ok(res)
+ res
}
#[cfg(test)]