mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 05:38:46 +00:00
Rename ra_project_model -> project_model
This commit is contained in:
parent
b5cb16fb90
commit
eac24d52e6
18 changed files with 40 additions and 43 deletions
40
Cargo.lock
generated
40
Cargo.lock
generated
|
@ -938,6 +938,25 @@ dependencies = [
|
||||||
"perf-event",
|
"perf-event",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "project_model"
|
||||||
|
version = "0.0.0"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"arena",
|
||||||
|
"cargo_metadata",
|
||||||
|
"cfg",
|
||||||
|
"log",
|
||||||
|
"paths",
|
||||||
|
"ra_db",
|
||||||
|
"ra_proc_macro",
|
||||||
|
"rustc-hash",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"stdx",
|
||||||
|
"toolchain",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.7"
|
version = "1.0.7"
|
||||||
|
@ -1134,25 +1153,6 @@ dependencies = [
|
||||||
"tt",
|
"tt",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ra_project_model"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"arena",
|
|
||||||
"cargo_metadata",
|
|
||||||
"cfg",
|
|
||||||
"log",
|
|
||||||
"paths",
|
|
||||||
"ra_db",
|
|
||||||
"ra_proc_macro",
|
|
||||||
"rustc-hash",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"stdx",
|
|
||||||
"toolchain",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ra_ssr"
|
name = "ra_ssr"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -1257,13 +1257,13 @@ dependencies = [
|
||||||
"pico-args",
|
"pico-args",
|
||||||
"proc_macro_srv",
|
"proc_macro_srv",
|
||||||
"profile",
|
"profile",
|
||||||
|
"project_model",
|
||||||
"ra_db",
|
"ra_db",
|
||||||
"ra_hir",
|
"ra_hir",
|
||||||
"ra_hir_def",
|
"ra_hir_def",
|
||||||
"ra_hir_ty",
|
"ra_hir_ty",
|
||||||
"ra_ide",
|
"ra_ide",
|
||||||
"ra_ide_db",
|
"ra_ide_db",
|
||||||
"ra_project_model",
|
|
||||||
"ra_ssr",
|
"ra_ssr",
|
||||||
"rayon",
|
"rayon",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
[package]
|
[package]
|
||||||
edition = "2018"
|
name = "project_model"
|
||||||
name = "ra_project_model"
|
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
|
||||||
|
@ -11,8 +11,10 @@ doctest = false
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log = "0.4.8"
|
log = "0.4.8"
|
||||||
rustc-hash = "1.1.0"
|
rustc-hash = "1.1.0"
|
||||||
|
|
||||||
cargo_metadata = "0.11.1"
|
cargo_metadata = "0.11.1"
|
||||||
|
serde = { version = "1.0.106", features = ["derive"] }
|
||||||
|
serde_json = "1.0.48"
|
||||||
|
anyhow = "1.0.26"
|
||||||
|
|
||||||
arena = { path = "../arena" }
|
arena = { path = "../arena" }
|
||||||
cfg = { path = "../cfg" }
|
cfg = { path = "../cfg" }
|
||||||
|
@ -21,8 +23,3 @@ toolchain = { path = "../toolchain" }
|
||||||
ra_proc_macro = { path = "../ra_proc_macro" }
|
ra_proc_macro = { path = "../ra_proc_macro" }
|
||||||
paths = { path = "../paths" }
|
paths = { path = "../paths" }
|
||||||
stdx = { path = "../stdx" }
|
stdx = { path = "../stdx" }
|
||||||
|
|
||||||
serde = { version = "1.0.106", features = ["derive"] }
|
|
||||||
serde_json = "1.0.48"
|
|
||||||
|
|
||||||
anyhow = "1.0.26"
|
|
|
@ -37,7 +37,7 @@ lsp-server = "0.3.3"
|
||||||
flycheck = { path = "../flycheck" }
|
flycheck = { path = "../flycheck" }
|
||||||
ra_ide = { path = "../ra_ide" }
|
ra_ide = { path = "../ra_ide" }
|
||||||
profile = { path = "../profile" }
|
profile = { path = "../profile" }
|
||||||
ra_project_model = { path = "../ra_project_model" }
|
project_model = { path = "../project_model" }
|
||||||
syntax = { path = "../syntax" }
|
syntax = { path = "../syntax" }
|
||||||
text_edit = { path = "../text_edit" }
|
text_edit = { path = "../text_edit" }
|
||||||
vfs = { path = "../vfs" }
|
vfs = { path = "../vfs" }
|
||||||
|
|
|
@ -6,7 +6,7 @@ mod args;
|
||||||
use std::{convert::TryFrom, process};
|
use std::{convert::TryFrom, process};
|
||||||
|
|
||||||
use lsp_server::Connection;
|
use lsp_server::Connection;
|
||||||
use ra_project_model::ProjectManifest;
|
use project_model::ProjectManifest;
|
||||||
use rust_analyzer::{
|
use rust_analyzer::{
|
||||||
cli,
|
cli,
|
||||||
config::{Config, LinkedProject},
|
config::{Config, LinkedProject},
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
//! See `CargoTargetSpec`
|
//! See `CargoTargetSpec`
|
||||||
|
|
||||||
use cfg::CfgExpr;
|
use cfg::CfgExpr;
|
||||||
|
use project_model::{self, TargetKind};
|
||||||
use ra_ide::{FileId, RunnableKind, TestId};
|
use ra_ide::{FileId, RunnableKind, TestId};
|
||||||
use ra_project_model::{self, TargetKind};
|
|
||||||
use vfs::AbsPathBuf;
|
use vfs::AbsPathBuf;
|
||||||
|
|
||||||
use crate::{global_state::GlobalStateSnapshot, Result};
|
use crate::{global_state::GlobalStateSnapshot, Result};
|
||||||
|
|
|
@ -4,9 +4,9 @@ use std::{path::Path, sync::Arc};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use crossbeam_channel::{unbounded, Receiver};
|
use crossbeam_channel::{unbounded, Receiver};
|
||||||
|
use project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace};
|
||||||
use ra_db::CrateGraph;
|
use ra_db::CrateGraph;
|
||||||
use ra_ide::{AnalysisChange, AnalysisHost};
|
use ra_ide::{AnalysisChange, AnalysisHost};
|
||||||
use ra_project_model::{CargoConfig, ProcMacroClient, ProjectManifest, ProjectWorkspace};
|
|
||||||
use vfs::{loader::Handle, AbsPath, AbsPathBuf};
|
use vfs::{loader::Handle, AbsPath, AbsPathBuf};
|
||||||
|
|
||||||
use crate::reload::{ProjectFolders, SourceRootConfig};
|
use crate::reload::{ProjectFolders, SourceRootConfig};
|
||||||
|
|
|
@ -11,8 +11,8 @@ use std::{ffi::OsString, path::PathBuf};
|
||||||
|
|
||||||
use flycheck::FlycheckConfig;
|
use flycheck::FlycheckConfig;
|
||||||
use lsp_types::ClientCapabilities;
|
use lsp_types::ClientCapabilities;
|
||||||
|
use project_model::{CargoConfig, ProjectJson, ProjectJsonData, ProjectManifest};
|
||||||
use ra_ide::{AssistConfig, CompletionConfig, HoverConfig, InlayHintsConfig};
|
use ra_ide::{AssistConfig, CompletionConfig, HoverConfig, InlayHintsConfig};
|
||||||
use ra_project_model::{CargoConfig, ProjectJson, ProjectJsonData, ProjectManifest};
|
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use vfs::AbsPathBuf;
|
use vfs::AbsPathBuf;
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||||
use flycheck::FlycheckHandle;
|
use flycheck::FlycheckHandle;
|
||||||
use lsp_types::{SemanticTokens, Url};
|
use lsp_types::{SemanticTokens, Url};
|
||||||
use parking_lot::{Mutex, RwLock};
|
use parking_lot::{Mutex, RwLock};
|
||||||
|
use project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target};
|
||||||
use ra_db::{CrateId, VfsPath};
|
use ra_db::{CrateId, VfsPath};
|
||||||
use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId};
|
use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FileId};
|
||||||
use ra_project_model::{CargoWorkspace, ProcMacroClient, ProjectWorkspace, Target};
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -18,11 +18,11 @@ use lsp_types::{
|
||||||
SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, SymbolTag,
|
SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, SymbolTag,
|
||||||
TextDocumentIdentifier, Url, WorkspaceEdit,
|
TextDocumentIdentifier, Url, WorkspaceEdit,
|
||||||
};
|
};
|
||||||
|
use project_model::TargetKind;
|
||||||
use ra_ide::{
|
use ra_ide::{
|
||||||
FileId, FilePosition, FileRange, HoverAction, HoverGotoTypeData, NavigationTarget, Query,
|
FileId, FilePosition, FileRange, HoverAction, HoverGotoTypeData, NavigationTarget, Query,
|
||||||
RangeInfo, Runnable, RunnableKind, SearchScope, TextEdit,
|
RangeInfo, Runnable, RunnableKind, SearchScope, TextEdit,
|
||||||
};
|
};
|
||||||
use ra_project_model::TargetKind;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_json::to_value;
|
use serde_json::to_value;
|
||||||
use stdx::{format_to, split_once};
|
use stdx::{format_to, split_once};
|
||||||
|
|
|
@ -21,7 +21,7 @@ use crate::{
|
||||||
lsp_utils::{apply_document_changes, is_canceled, notification_is, Progress},
|
lsp_utils::{apply_document_changes, is_canceled, notification_is, Progress},
|
||||||
Result,
|
Result,
|
||||||
};
|
};
|
||||||
use ra_project_model::ProjectWorkspace;
|
use project_model::ProjectWorkspace;
|
||||||
use vfs::ChangeKind;
|
use vfs::ChangeKind;
|
||||||
|
|
||||||
pub fn main_loop(config: Config, connection: Connection) -> Result<()> {
|
pub fn main_loop(config: Config, connection: Connection) -> Result<()> {
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
use std::{mem, sync::Arc};
|
use std::{mem, sync::Arc};
|
||||||
|
|
||||||
use flycheck::FlycheckHandle;
|
use flycheck::FlycheckHandle;
|
||||||
|
use project_model::{ProcMacroClient, ProjectWorkspace};
|
||||||
use ra_db::{CrateGraph, SourceRoot, VfsPath};
|
use ra_db::{CrateGraph, SourceRoot, VfsPath};
|
||||||
use ra_ide::AnalysisChange;
|
use ra_ide::AnalysisChange;
|
||||||
use ra_project_model::{ProcMacroClient, ProjectWorkspace};
|
|
||||||
use vfs::{file_set::FileSetConfig, AbsPath, AbsPathBuf, ChangeKind};
|
use vfs::{file_set::FileSetConfig, AbsPath, AbsPathBuf, ChangeKind};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -98,14 +98,14 @@ impl GlobalState {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|project| match project {
|
.map(|project| match project {
|
||||||
LinkedProject::ProjectManifest(manifest) => {
|
LinkedProject::ProjectManifest(manifest) => {
|
||||||
ra_project_model::ProjectWorkspace::load(
|
project_model::ProjectWorkspace::load(
|
||||||
manifest.clone(),
|
manifest.clone(),
|
||||||
&cargo_config,
|
&cargo_config,
|
||||||
with_sysroot,
|
with_sysroot,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
LinkedProject::InlineJsonProject(it) => {
|
LinkedProject::InlineJsonProject(it) => {
|
||||||
Ok(ra_project_model::ProjectWorkspace::Json { project: it.clone() })
|
Ok(project_model::ProjectWorkspace::Json { project: it.clone() })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
|
@ -12,7 +12,7 @@ use lsp_types::{
|
||||||
notification::Exit, request::Shutdown, TextDocumentIdentifier, Url, WorkDoneProgress,
|
notification::Exit, request::Shutdown, TextDocumentIdentifier, Url, WorkDoneProgress,
|
||||||
};
|
};
|
||||||
use lsp_types::{ProgressParams, ProgressParamsValue};
|
use lsp_types::{ProgressParams, ProgressParamsValue};
|
||||||
use ra_project_model::ProjectManifest;
|
use project_model::ProjectManifest;
|
||||||
use rust_analyzer::{
|
use rust_analyzer::{
|
||||||
config::{ClientCapsConfig, Config, FilesConfig, FilesWatcher, LinkedProject},
|
config::{ClientCapsConfig, Config, FilesConfig, FilesWatcher, LinkedProject},
|
||||||
main_loop,
|
main_loop,
|
||||||
|
|
|
@ -198,7 +198,7 @@ impl TidyDocs {
|
||||||
"mbe",
|
"mbe",
|
||||||
"parser",
|
"parser",
|
||||||
"profile",
|
"profile",
|
||||||
"ra_project_model",
|
"project_model",
|
||||||
"syntax",
|
"syntax",
|
||||||
"tt",
|
"tt",
|
||||||
"ra_hir_ty",
|
"ra_hir_ty",
|
||||||
|
|
Loading…
Reference in a new issue