add apply ssr assist

This commit is contained in:
Josh Mcguigan 2021-03-08 21:11:28 -08:00
parent a9b1e5cde1
commit 09307be75b
4 changed files with 300 additions and 1 deletions

View file

@ -41,6 +41,7 @@ mod parent_module;
mod references;
mod fn_references;
mod runnables;
mod ssr;
mod status;
mod syntax_highlighting;
mod syntax_tree;
@ -51,6 +52,7 @@ mod doc_links;
use std::sync::Arc;
use cfg::CfgOptions;
use ide_db::base_db::{
salsa::{self, ParallelDatabase},
CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath,
@ -502,7 +504,11 @@ impl Analysis {
resolve: bool,
frange: FileRange,
) -> Cancelable<Vec<Assist>> {
self.with_db(|db| Assist::get(db, config, resolve, frange))
self.with_db(|db| {
let mut acc = Assist::get(db, config, resolve, frange);
ssr::add_ssr_assist(db, &mut acc, resolve, frange);
acc
})
}
/// Computes the set of diagnostics for the given file.