Rename ra_assists -> assists

This commit is contained in:
Aleksey Kladov 2020-08-13 17:33:38 +02:00
parent ae3abd6e57
commit fc34403018
57 changed files with 34 additions and 35 deletions

36
Cargo.lock generated
View file

@ -46,6 +46,23 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"
[[package]]
name = "assists"
version = "0.0.0"
dependencies = [
"base_db",
"either",
"hir",
"ide_db",
"itertools",
"profile",
"rustc-hash",
"stdx",
"syntax",
"test_utils",
"text_edit",
]
[[package]] [[package]]
name = "atty" name = "atty"
version = "0.2.14" version = "0.2.14"
@ -1102,27 +1119,11 @@ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]]
name = "ra_assists"
version = "0.1.0"
dependencies = [
"base_db",
"either",
"hir",
"ide_db",
"itertools",
"profile",
"rustc-hash",
"stdx",
"syntax",
"test_utils",
"text_edit",
]
[[package]] [[package]]
name = "ra_ide" name = "ra_ide"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"assists",
"base_db", "base_db",
"cfg", "cfg",
"either", "either",
@ -1134,7 +1135,6 @@ dependencies = [
"log", "log",
"oorandom", "oorandom",
"profile", "profile",
"ra_assists",
"rustc-hash", "rustc-hash",
"ssr", "ssr",
"stdx", "stdx",

View file

@ -1,9 +1,9 @@
[package] [package]
edition = "2018" name = "assists"
name = "ra_assists" version = "0.0.0"
version = "0.1.0"
authors = ["rust-analyzer developers"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
authors = ["rust-analyzer developers"]
edition = "2018"
[lib] [lib]
doctest = false doctest = false
@ -14,7 +14,6 @@ itertools = "0.9.0"
either = "1.5.3" either = "1.5.3"
stdx = { path = "../stdx" } stdx = { path = "../stdx" }
syntax = { path = "../syntax" } syntax = { path = "../syntax" }
text_edit = { path = "../text_edit" } text_edit = { path = "../text_edit" }
profile = { path = "../profile" } profile = { path = "../profile" }

View file

@ -1,4 +1,4 @@
//! `ra_assists` crate provides a bunch of code assists, also known as code //! `assists` crate provides a bunch of code assists, also known as code
//! actions (in LSP) or intentions (in IntelliJ). //! actions (in LSP) or intentions (in IntelliJ).
//! //!
//! An assist is a micro-refactoring, which is automatically activated in //! An assist is a micro-refactoring, which is automatically activated in

View file

@ -1,5 +1,5 @@
//! This module contains an import search funcionality that is provided to the ra_assists module. //! This module contains an import search funcionality that is provided to the assists module.
//! Later, this should be moved away to a separate crate that is accessible from the ra_assists module. //! Later, this should be moved away to a separate crate that is accessible from the assists module.
use hir::{Crate, MacroDef, ModuleDef, Semantics}; use hir::{Crate, MacroDef, ModuleDef, Semantics};
use syntax::{ast, AstNode, SyntaxKind::NAME}; use syntax::{ast, AstNode, SyntaxKind::NAME};

View file

@ -28,7 +28,7 @@ ide_db = { path = "../ide_db" }
cfg = { path = "../cfg" } cfg = { path = "../cfg" }
profile = { path = "../profile" } profile = { path = "../profile" }
test_utils = { path = "../test_utils" } test_utils = { path = "../test_utils" }
ra_assists = { path = "../ra_assists" } assists = { path = "../assists" }
ssr = { path = "../ssr" } ssr = { path = "../ssr" }
# ra_ide should depend only on the top-level `hir` package. if you need # ra_ide should depend only on the top-level `hir` package. if you need

View file

@ -1,5 +1,5 @@
//! FIXME: write short doc here //! FIXME: write short doc here
use ra_assists::utils::TryEnum; use assists::utils::TryEnum;
use syntax::{ use syntax::{
ast::{self, AstNode}, ast::{self, AstNode},
TextRange, TextSize, TextRange, TextSize,

View file

@ -31,8 +31,8 @@
//! } //! }
//! ``` //! ```
use assists::utils::get_missing_assoc_items;
use hir::{self, Docs, HasSource}; use hir::{self, Docs, HasSource};
use ra_assists::utils::get_missing_assoc_items;
use syntax::{ use syntax::{
ast::{self, edit, Impl}, ast::{self, edit, Impl},
AstNode, SyntaxKind, SyntaxNode, TextRange, T, AstNode, SyntaxKind, SyntaxNode, TextRange, T,

View file

@ -1,5 +1,5 @@
use assists::utils::extract_trivial_expression;
use itertools::Itertools; use itertools::Itertools;
use ra_assists::utils::extract_trivial_expression;
use syntax::{ use syntax::{
algo::{find_covering_element, non_trivia_sibling}, algo::{find_covering_element, non_trivia_sibling},
ast::{self, AstNode, AstToken}, ast::{self, AstNode, AstToken},

View file

@ -80,6 +80,7 @@ pub use crate::{
}, },
}; };
pub use assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist};
pub use base_db::{ pub use base_db::{
Canceled, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot, Canceled, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot,
SourceRootId, SourceRootId,
@ -93,7 +94,6 @@ pub use ide_db::{
symbol_index::Query, symbol_index::Query,
RootDatabase, RootDatabase,
}; };
pub use ra_assists::{Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist};
pub use ssr::SsrError; pub use ssr::SsrError;
pub use text_edit::{Indel, TextEdit}; pub use text_edit::{Indel, TextEdit};
@ -478,7 +478,7 @@ impl Analysis {
config: &AssistConfig, config: &AssistConfig,
frange: FileRange, frange: FileRange,
) -> Cancelable<Vec<ResolvedAssist>> { ) -> Cancelable<Vec<ResolvedAssist>> {
self.with_db(|db| ra_assists::Assist::resolved(db, config, frange)) self.with_db(|db| assists::Assist::resolved(db, config, frange))
} }
/// Computes unresolved assists (aka code actions aka intentions) for the given /// Computes unresolved assists (aka code actions aka intentions) for the given

View file

@ -56,7 +56,7 @@ In particular, `cargo xtask codegen` generates:
2. [`ast/generated`](https://github.com/rust-analyzer/rust-analyzer/blob/a0be39296d2925972cacd9fbf8b5fb258fad6947/crates/ra_syntax/src/ast/generated.rs) 2. [`ast/generated`](https://github.com/rust-analyzer/rust-analyzer/blob/a0be39296d2925972cacd9fbf8b5fb258fad6947/crates/ra_syntax/src/ast/generated.rs)
-- AST data structure. -- AST data structure.
3. [`doc_tests/generated`](https://github.com/rust-analyzer/rust-analyzer/blob/a0be39296d2925972cacd9fbf8b5fb258fad6947/crates/ra_assists/src/doc_tests/generated.rs), 3. [`doc_tests/generated`](https://github.com/rust-analyzer/rust-analyzer/blob/a0be39296d2925972cacd9fbf8b5fb258fad6947/crates/assists/src/doc_tests/generated.rs),
[`test_data/parser/inline`](https://github.com/rust-analyzer/rust-analyzer/tree/a0be39296d2925972cacd9fbf8b5fb258fad6947/crates/ra_syntax/test_data/parser/inline) [`test_data/parser/inline`](https://github.com/rust-analyzer/rust-analyzer/tree/a0be39296d2925972cacd9fbf8b5fb258fad6947/crates/ra_syntax/test_data/parser/inline)
-- tests for assists and the parser. -- tests for assists and the parser.

View file

@ -32,8 +32,8 @@ const SYNTAX_KINDS: &str = "crates/parser/src/syntax_kind/generated.rs";
const AST_NODES: &str = "crates/syntax/src/ast/generated/nodes.rs"; const AST_NODES: &str = "crates/syntax/src/ast/generated/nodes.rs";
const AST_TOKENS: &str = "crates/syntax/src/ast/generated/tokens.rs"; const AST_TOKENS: &str = "crates/syntax/src/ast/generated/tokens.rs";
const ASSISTS_DIR: &str = "crates/ra_assists/src/handlers"; const ASSISTS_DIR: &str = "crates/assists/src/handlers";
const ASSISTS_TESTS: &str = "crates/ra_assists/src/tests/generated.rs"; const ASSISTS_TESTS: &str = "crates/assists/src/tests/generated.rs";
#[derive(Debug, PartialEq, Eq, Clone, Copy)] #[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum Mode { pub enum Mode {