diff options
Diffstat (limited to 'crates')
16 files changed, 19 insertions, 22 deletions
diff --git a/crates/ra_project_model/Cargo.toml b/crates/project_model/Cargo.toml index 52f2d57b3..8d8d09387 100644 --- a/crates/ra_project_model/Cargo.toml +++ b/crates/project_model/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | 2 | name = "project_model" |
3 | name = "ra_project_model" | 3 | version = "0.0.0" |
4 | version = "0.1.0" | ||
5 | authors = ["rust-analyzer developers"] | ||
6 | license = "MIT OR Apache-2.0" | 4 | license = "MIT OR Apache-2.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | edition = "2018" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
@@ -11,8 +11,10 @@ doctest = false | |||
11 | [dependencies] | 11 | [dependencies] |
12 | log = "0.4.8" | 12 | log = "0.4.8" |
13 | rustc-hash = "1.1.0" | 13 | rustc-hash = "1.1.0" |
14 | |||
15 | cargo_metadata = "0.11.1" | 14 | cargo_metadata = "0.11.1" |
15 | serde = { version = "1.0.106", features = ["derive"] } | ||
16 | serde_json = "1.0.48" | ||
17 | anyhow = "1.0.26" | ||
16 | 18 | ||
17 | arena = { path = "../arena" } | 19 | arena = { path = "../arena" } |
18 | cfg = { path = "../cfg" } | 20 | cfg = { path = "../cfg" } |
@@ -21,8 +23,3 @@ toolchain = { path = "../toolchain" } | |||
21 | ra_proc_macro = { path = "../ra_proc_macro" } | 23 | ra_proc_macro = { path = "../ra_proc_macro" } |
22 | paths = { path = "../paths" } | 24 | paths = { path = "../paths" } |
23 | stdx = { path = "../stdx" } | 25 | stdx = { path = "../stdx" } |
24 | |||
25 | serde = { version = "1.0.106", features = ["derive"] } | ||
26 | serde_json = "1.0.48" | ||
27 | |||
28 | anyhow = "1.0.26" | ||
diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs index abf8dca96..abf8dca96 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/project_model/src/cargo_workspace.rs | |||
diff --git a/crates/ra_project_model/src/cfg_flag.rs b/crates/project_model/src/cfg_flag.rs index e92962cf6..e92962cf6 100644 --- a/crates/ra_project_model/src/cfg_flag.rs +++ b/crates/project_model/src/cfg_flag.rs | |||
diff --git a/crates/ra_project_model/src/lib.rs b/crates/project_model/src/lib.rs index ee42198f3..ee42198f3 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/project_model/src/lib.rs | |||
diff --git a/crates/ra_project_model/src/project_json.rs b/crates/project_model/src/project_json.rs index e3f3163f6..e3f3163f6 100644 --- a/crates/ra_project_model/src/project_json.rs +++ b/crates/project_model/src/project_json.rs | |||
diff --git a/crates/ra_project_model/src/sysroot.rs b/crates/project_model/src/sysroot.rs index 8239797b6..8239797b6 100644 --- a/crates/ra_project_model/src/sysroot.rs +++ b/crates/project_model/src/sysroot.rs | |||
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 440b1cd13..c6102bf27 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml | |||
@@ -37,7 +37,7 @@ lsp-server = "0.3.3" | |||
37 | flycheck = { path = "../flycheck" } | 37 | flycheck = { path = "../flycheck" } |
38 | ra_ide = { path = "../ra_ide" } | 38 | ra_ide = { path = "../ra_ide" } |
39 | profile = { path = "../profile" } | 39 | profile = { path = "../profile" } |
40 | ra_project_model = { path = "../ra_project_model" } | 40 | project_model = { path = "../project_model" } |
41 | syntax = { path = "../syntax" } | 41 | syntax = { path = "../syntax" } |
42 | text_edit = { path = "../text_edit" } | 42 | text_edit = { path = "../text_edit" } |
43 | vfs = { path = "../vfs" } | 43 | vfs = { path = "../vfs" } |
diff --git a/crates/rust-analyzer/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs index f177f8709..bade31ca2 100644 --- a/crates/rust-analyzer/src/bin/main.rs +++ b/crates/rust-analyzer/src/bin/main.rs | |||
@@ -6,7 +6,7 @@ mod args; | |||
6 | use std::{convert::TryFrom, process}; | 6 | use std::{convert::TryFrom, process}; |
7 | 7 | ||
8 | use lsp_server::Connection; | 8 | use lsp_server::Connection; |
9 | use ra_project_model::ProjectManifest; | 9 | use project_model::ProjectManifest; |
10 | use rust_analyzer::{ | 10 | use rust_analyzer::{ |
11 | cli, | 11 | cli, |
12 | config::{Config, LinkedProject}, | 12 | config::{Config, LinkedProject}, |
diff --git a/crates/rust-analyzer/src/cargo_target_spec.rs b/crates/rust-analyzer/src/cargo_target_spec.rs index 9c7a9cce6..5ba30dbad 100644 --- a/crates/rust-analyzer/src/cargo_target_spec.rs +++ b/crates/rust-analyzer/src/cargo_target_spec.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | //! See `CargoTargetSpec` | 1 | //! See `CargoTargetSpec` |
2 | 2 | ||
3 | use cfg::CfgExpr; | 3 | use cfg::CfgExpr; |
4 | use project_model::{self, TargetKind}; | ||
4 | use ra_ide::{FileId, RunnableKind, TestId}; | 5 | use ra_ide::{FileId, RunnableKind, TestId}; |
5 | use ra_project_model::{self, TargetKind}; | ||
6 | use vfs::AbsPathBuf; | 6 | use vfs::AbsPathBuf; |
7 | 7 | ||
8 | use crate::{global_state::GlobalStateSnapshot, Result}; | 8 | use crate::{global_state::GlobalStateSnapshot, Result}; |
diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs index a43bf2244..f6cb144c6 100644 --- a/crates/rust-analyzer/src/cli/load_cargo.rs +++ b/crates/rust-analyzer/src/cli/load_cargo.rs | |||
@@ -4,9 +4,9 @@ use std::{path::Path, sync::Arc}; | |||
4 | 4 | ||
5 | use anyhow::Result; | 5 | use anyhow::Result; |
6 | use crossbeam_channel::{unbounded, Receiver}; | 6 | use crossbeam_channel::{unbounded, Receiver}; |
7 | use project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace}; | ||
7 | use ra_db::CrateGraph; | 8 | use ra_db::CrateGraph; |
8 | use ra_ide::{AnalysisChange, AnalysisHost}; | 9 | use ra_ide::{AnalysisChange, AnalysisHost}; |
9 | use ra_project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace}; | ||
10 | use vfs::{loader::Handle, AbsPath, AbsPathBuf}; | 10 | use vfs::{loader::Handle, AbsPath, AbsPathBuf}; |
11 | 11 | ||
12 | use crate::reload::{ProjectFolders, SourceRootConfig}; | 12 | use crate::reload::{ProjectFolders, SourceRootConfig}; |
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 70b4512d0..bfc84147c 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs | |||
@@ -11,8 +11,8 @@ use std::{ffi::OsString, path::PathBuf}; | |||
11 | 11 | ||
12 | use flycheck::FlycheckConfig; | 12 | use flycheck::FlycheckConfig; |
13 | use lsp_types::ClientCapabilities; | 13 | use lsp_types::ClientCapabilities; |
14 | use project_model::{CargoConfig, ProjectJson, ProjectJsonData, ProjectManifest}; | ||
14 | use ra_ide::{AssistConfig, CompletionConfig, HoverConfig, InlayHintsConfig}; | 15 | use ra_ide::{AssistConfig, CompletionConfig, HoverConfig, InlayHintsConfig}; |
15 | use ra_project_model::{CargoConfig, ProjectJson, ProjectJsonData, ProjectManifest}; | ||
16 | use serde::Deserialize; | 16 | use serde::Deserialize; |
17 | use vfs::AbsPathBuf; | 17 | use vfs::AbsPathBuf; |
18 | 18 | ||
diff --git a/crates/rust-analyzer/src/global_state.rs b/crates/rust-analyzer/src/global_state.rs index 8c115c8a6..2e8b708d0 100644 --- a/crates/rust-analyzer/src/global_state.rs +++ b/crates/rust-analyzer/src/global_state.rs | |||
@@ -9,9 +9,9 @@ use crossbeam_channel::{unbounded, Receiver, Sender}; | |||
9 | use flycheck::FlycheckHandle; | 9 | use flycheck::FlycheckHandle; |
10 | use lsp_types::{SemanticTokens, Url}; | 10 | use lsp_types::{SemanticTokens, Url}; |
11 | use parking_lot::{Mutex, RwLock}; | 11 | use parking_lot::{Mutex, RwLock}; |
12 | use project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; | ||
12 | use ra_db::{CrateId, VfsPath}; | 13 | use ra_db::{CrateId, VfsPath}; |
13 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; | 14 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId}; |
14 | use ra_project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target}; | ||
15 | use rustc_hash::FxHashMap; | 15 | use rustc_hash::FxHashMap; |
16 | 16 | ||
17 | use crate::{ | 17 | use crate::{ |
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 86e7833f2..4b5ca7eec 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs | |||
@@ -18,11 +18,11 @@ use lsp_types::{ | |||
18 | SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, SymbolTag, | 18 | SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, SymbolTag, |
19 | TextDocumentIdentifier, Url, WorkspaceEdit, | 19 | TextDocumentIdentifier, Url, WorkspaceEdit, |
20 | }; | 20 | }; |
21 | use project_model::TargetKind; | ||
21 | use ra_ide::{ | 22 | use ra_ide::{ |
22 | FileId, FilePosition, FileRange, HoverAction, HoverGotoTypeData, NavigationTarget, Query, | 23 | FileId, FilePosition, FileRange, HoverAction, HoverGotoTypeData, NavigationTarget, Query, |
23 | RangeInfo, Runnable, RunnableKind, SearchScope, TextEdit, | 24 | RangeInfo, Runnable, RunnableKind, SearchScope, TextEdit, |
24 | }; | 25 | }; |
25 | use ra_project_model::TargetKind; | ||
26 | use serde::{Deserialize, Serialize}; | 26 | use serde::{Deserialize, Serialize}; |
27 | use serde_json::to_value; | 27 | use serde_json::to_value; |
28 | use stdx::{format_to, split_once}; | 28 | use stdx::{format_to, split_once}; |
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 32962b088..9a779cb14 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -21,7 +21,7 @@ use crate::{ | |||
21 | lsp_utils::{apply_document_changes, is_canceled, notification_is, Progress}, | 21 | lsp_utils::{apply_document_changes, is_canceled, notification_is, Progress}, |
22 | Result, | 22 | Result, |
23 | }; | 23 | }; |
24 | use ra_project_model::ProjectWorkspace; | 24 | use project_model::ProjectWorkspace; |
25 | use vfs::ChangeKind; | 25 | use vfs::ChangeKind; |
26 | 26 | ||
27 | pub fn main_loop(config: Config, connection: Connection) -> Result<()> { | 27 | pub fn main_loop(config: Config, connection: Connection) -> Result<()> { |
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs index 611c9a89f..640417dc6 100644 --- a/crates/rust-analyzer/src/reload.rs +++ b/crates/rust-analyzer/src/reload.rs | |||
@@ -2,9 +2,9 @@ | |||
2 | use std::{mem, sync::Arc}; | 2 | use std::{mem, sync::Arc}; |
3 | 3 | ||
4 | use flycheck::FlycheckHandle; | 4 | use flycheck::FlycheckHandle; |
5 | use project_model::{ProcMacroClient, ProjectWorkspace}; | ||
5 | use ra_db::{CrateGraph, SourceRoot, VfsPath}; | 6 | use ra_db::{CrateGraph, SourceRoot, VfsPath}; |
6 | use ra_ide::AnalysisChange; | 7 | use ra_ide::AnalysisChange; |
7 | use ra_project_model::{ProcMacroClient, ProjectWorkspace}; | ||
8 | use vfs::{file_set::FileSetConfig, AbsPath, AbsPathBuf, ChangeKind}; | 8 | use vfs::{file_set::FileSetConfig, AbsPath, AbsPathBuf, ChangeKind}; |
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
@@ -98,14 +98,14 @@ impl GlobalState { | |||
98 | .iter() | 98 | .iter() |
99 | .map(|project| match project { | 99 | .map(|project| match project { |
100 | LinkedProject::ProjectManifest(manifest) => { | 100 | LinkedProject::ProjectManifest(manifest) => { |
101 | ra_project_model::ProjectWorkspace::load( | 101 | project_model::ProjectWorkspace::load( |
102 | manifest.clone(), | 102 | manifest.clone(), |
103 | &cargo_config, | 103 | &cargo_config, |
104 | with_sysroot, | 104 | with_sysroot, |
105 | ) | 105 | ) |
106 | } | 106 | } |
107 | LinkedProject::InlineJsonProject(it) => { | 107 | LinkedProject::InlineJsonProject(it) => { |
108 | Ok(ra_project_model::ProjectWorkspace::Json { project: it.clone() }) | 108 | Ok(project_model::ProjectWorkspace::Json { project: it.clone() }) |
109 | } | 109 | } |
110 | }) | 110 | }) |
111 | .collect::<Vec<_>>(); | 111 | .collect::<Vec<_>>(); |
diff --git a/crates/rust-analyzer/tests/heavy_tests/support.rs b/crates/rust-analyzer/tests/heavy_tests/support.rs index 15866fbb1..5bafeba79 100644 --- a/crates/rust-analyzer/tests/heavy_tests/support.rs +++ b/crates/rust-analyzer/tests/heavy_tests/support.rs | |||
@@ -12,7 +12,7 @@ use lsp_types::{ | |||
12 | notification::Exit, request::Shutdown, TextDocumentIdentifier, Url, WorkDoneProgress, | 12 | notification::Exit, request::Shutdown, TextDocumentIdentifier, Url, WorkDoneProgress, |
13 | }; | 13 | }; |
14 | use lsp_types::{ProgressParams, ProgressParamsValue}; | 14 | use lsp_types::{ProgressParams, ProgressParamsValue}; |
15 | use ra_project_model::ProjectManifest; | 15 | use project_model::ProjectManifest; |
16 | use rust_analyzer::{ | 16 | use rust_analyzer::{ |
17 | config::{ClientCapsConfig, Config, FilesConfig, FilesWatcher, LinkedProject}, | 17 | config::{ClientCapsConfig, Config, FilesConfig, FilesWatcher, LinkedProject}, |
18 | main_loop, | 18 | main_loop, |