Rename ra_env -> ra_toolchain

This commit is contained in:
Aleksey Kladov 2020-05-08 12:25:36 +02:00
parent 8295a9340c
commit 6713be0b13
9 changed files with 23 additions and 21 deletions

20
Cargo.lock generated
View file

@ -957,14 +957,6 @@ dependencies = [
"test_utils", "test_utils",
] ]
[[package]]
name = "ra_env"
version = "0.1.0"
dependencies = [
"anyhow",
"home",
]
[[package]] [[package]]
name = "ra_flycheck" name = "ra_flycheck"
version = "0.1.0" version = "0.1.0"
@ -975,7 +967,7 @@ dependencies = [
"jod-thread", "jod-thread",
"log", "log",
"lsp-types", "lsp-types",
"ra_env", "ra_toolchain",
"serde_json", "serde_json",
] ]
@ -1180,8 +1172,8 @@ dependencies = [
"ra_arena", "ra_arena",
"ra_cfg", "ra_cfg",
"ra_db", "ra_db",
"ra_env",
"ra_proc_macro", "ra_proc_macro",
"ra_toolchain",
"rustc-hash", "rustc-hash",
"serde", "serde",
"serde_json", "serde_json",
@ -1213,6 +1205,14 @@ dependencies = [
"text-size", "text-size",
] ]
[[package]]
name = "ra_toolchain"
version = "0.1.0"
dependencies = [
"anyhow",
"home",
]
[[package]] [[package]]
name = "ra_tt" name = "ra_tt"
version = "0.1.0" version = "0.1.0"

View file

@ -14,7 +14,7 @@ log = "0.4.8"
cargo_metadata = "0.9.1" cargo_metadata = "0.9.1"
serde_json = "1.0.48" serde_json = "1.0.48"
jod-thread = "0.1.1" jod-thread = "0.1.1"
ra_env = { path = "../ra_env" } ra_toolchain = { path = "../ra_toolchain" }
[dev-dependencies] [dev-dependencies]
insta = "0.16.0" insta = "0.16.0"

View file

@ -16,7 +16,7 @@ use lsp_types::{
CodeAction, CodeActionOrCommand, Diagnostic, Url, WorkDoneProgress, WorkDoneProgressBegin, CodeAction, CodeActionOrCommand, Diagnostic, Url, WorkDoneProgress, WorkDoneProgressBegin,
WorkDoneProgressEnd, WorkDoneProgressReport, WorkDoneProgressEnd, WorkDoneProgressReport,
}; };
use ra_env::get_path_for_executable; use ra_toolchain::get_path_for_executable;
use crate::conv::{map_rust_diagnostic_to_lsp, MappedRustDiagnostic}; use crate::conv::{map_rust_diagnostic_to_lsp, MappedRustDiagnostic};

View file

@ -16,7 +16,7 @@ cargo_metadata = "0.9.1"
ra_arena = { path = "../ra_arena" } ra_arena = { path = "../ra_arena" }
ra_cfg = { path = "../ra_cfg" } ra_cfg = { path = "../ra_cfg" }
ra_db = { path = "../ra_db" } ra_db = { path = "../ra_db" }
ra_env = { path = "../ra_env" } ra_toolchain = { path = "../ra_toolchain" }
ra_proc_macro = { path = "../ra_proc_macro" } ra_proc_macro = { path = "../ra_proc_macro" }
serde = { version = "1.0.106", features = ["derive"] } serde = { version = "1.0.106", features = ["derive"] }

View file

@ -11,7 +11,7 @@ use anyhow::{Context, Result};
use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId}; use cargo_metadata::{BuildScript, CargoOpt, Message, MetadataCommand, PackageId};
use ra_arena::{Arena, Idx}; use ra_arena::{Arena, Idx};
use ra_db::Edition; use ra_db::Edition;
use ra_env::get_path_for_executable; use ra_toolchain::get_path_for_executable;
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
/// `CargoWorkspace` represents the logical structure of, well, a Cargo /// `CargoWorkspace` represents the logical structure of, well, a Cargo

View file

@ -14,7 +14,7 @@ use std::{
use anyhow::{bail, Context, Result}; use anyhow::{bail, Context, Result};
use ra_cfg::CfgOptions; use ra_cfg::CfgOptions;
use ra_db::{CrateGraph, CrateName, Edition, Env, ExternSource, ExternSourceId, FileId}; use ra_db::{CrateGraph, CrateName, Edition, Env, ExternSource, ExternSourceId, FileId};
use ra_env::get_path_for_executable; use ra_toolchain::get_path_for_executable;
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use serde_json::from_reader; use serde_json::from_reader;

View file

@ -1,14 +1,14 @@
//! FIXME: write short doc here //! FIXME: write short doc here
use anyhow::{bail, Context, Result};
use std::{ use std::{
env, ops, env, ops,
path::{Path, PathBuf}, path::{Path, PathBuf},
process::{Command, Output}, process::{Command, Output},
}; };
use anyhow::{bail, Context, Result};
use ra_arena::{Arena, Idx}; use ra_arena::{Arena, Idx};
use ra_env::get_path_for_executable; use ra_toolchain::get_path_for_executable;
#[derive(Default, Debug, Clone)] #[derive(Default, Debug, Clone)]
pub struct Sysroot { pub struct Sysroot {

View file

@ -1,6 +1,6 @@
[package] [package]
edition = "2018" edition = "2018"
name = "ra_env" name = "ra_toolchain"
version = "0.1.0" version = "0.1.0"
authors = ["rust-analyzer developers"] authors = ["rust-analyzer developers"]

View file

@ -1,11 +1,13 @@
//! This crate contains a single public function //! This crate contains a single public function
//! [`get_path_for_executable`](fn.get_path_for_executable.html). //! [`get_path_for_executable`](fn.get_path_for_executable.html).
//! See docs there for more information. //! See docs there for more information.
use std::{
env,
path::{Path, PathBuf},
process::Command,
};
use anyhow::{bail, Result}; use anyhow::{bail, Result};
use std::env;
use std::path::{Path, PathBuf};
use std::process::Command;
/// Return a `PathBuf` to use for the given executable. /// Return a `PathBuf` to use for the given executable.
/// ///