Make some stuff public so that they can be reused by other tools

This commit is contained in:
Pavan Kumar Sunkara 2020-04-24 21:57:10 +02:00
parent 530a35f3f9
commit 9f0a7eb97b
6 changed files with 7 additions and 10 deletions

View file

@ -176,14 +176,10 @@ impl AnalysisHost {
pub fn request_cancellation(&mut self) {
self.db.request_cancellation();
}
pub fn raw_database(
&self,
) -> &(impl hir::db::HirDatabase + salsa::Database + ra_db::SourceDatabaseExt) {
pub fn raw_database(&self) -> &RootDatabase {
&self.db
}
pub fn raw_database_mut(
&mut self,
) -> &mut (impl hir::db::HirDatabase + salsa::Database + ra_db::SourceDatabaseExt) {
pub fn raw_database_mut(&mut self) -> &mut RootDatabase {
&mut self.db
}
}

View file

@ -35,7 +35,7 @@ pub enum ProjectWorkspace {
/// `PackageRoot` describes a package root folder.
/// Which may be an external dependency, or a member of
/// the current workspace.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct PackageRoot {
/// Path to the root folder
path: PathBuf,

View file

@ -21,7 +21,7 @@ pub struct TextEdit {
indels: Vec<Indel>,
}
#[derive(Debug, Default)]
#[derive(Debug, Default, Clone)]
pub struct TextEditBuilder {
indels: Vec<Indel>,
}

View file

@ -16,6 +16,7 @@ use ra_syntax::{AstNode, SourceFile};
pub use analysis_bench::{analysis_bench, BenchWhat, Position};
pub use analysis_stats::analysis_stats;
pub use diagnostics::diagnostics;
pub use load_cargo::load_cargo;
#[derive(Clone, Copy)]
pub enum Verbosity {

View file

@ -22,7 +22,7 @@ fn vfs_root_to_id(r: ra_vfs::VfsRoot) -> SourceRootId {
SourceRootId(r.0)
}
pub(crate) fn load_cargo(
pub fn load_cargo(
root: &Path,
load_out_dirs_from_check: bool,
with_proc_macro: bool,

View file

@ -11,7 +11,7 @@ export function ssr(ctx: Ctx): Cmd {
const options: vscode.InputBoxOptions = {
value: "() ==>> ()",
prompt: "EnteR request, for example 'Foo($a:expr) ==> Foo::new($a)' ",
prompt: "Enter request, for example 'Foo($a:expr) ==> Foo::new($a)' ",
validateInput: async (x: string) => {
try {
await client.sendRequest(ra.ssr, { query: x, parseOnly: true });