Rename ra_cfg -> cfg

This commit is contained in:
Aleksey Kladov 2020-08-13 10:19:09 +02:00
parent 5734cc8586
commit 68c2238725
22 changed files with 39 additions and 39 deletions

30
Cargo.lock generated
View file

@ -112,6 +112,16 @@ version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518"
[[package]]
name = "cfg"
version = "0.0.0"
dependencies = [
"mbe",
"rustc-hash",
"syntax",
"tt",
]
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "0.1.10" version = "0.1.10"
@ -955,22 +965,12 @@ dependencies = [
"text_edit", "text_edit",
] ]
[[package]]
name = "ra_cfg"
version = "0.1.0"
dependencies = [
"mbe",
"rustc-hash",
"syntax",
"tt",
]
[[package]] [[package]]
name = "ra_db" name = "ra_db"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cfg",
"profile", "profile",
"ra_cfg",
"rustc-hash", "rustc-hash",
"salsa", "salsa",
"stdx", "stdx",
@ -1012,6 +1012,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anymap", "anymap",
"arena", "arena",
"cfg",
"drop_bomb", "drop_bomb",
"either", "either",
"expect", "expect",
@ -1022,7 +1023,6 @@ dependencies = [
"mbe", "mbe",
"once_cell", "once_cell",
"profile", "profile",
"ra_cfg",
"ra_db", "ra_db",
"ra_hir_expand", "ra_hir_expand",
"rustc-hash", "rustc-hash",
@ -1082,6 +1082,7 @@ dependencies = [
name = "ra_ide" name = "ra_ide"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cfg",
"either", "either",
"expect", "expect",
"indexmap", "indexmap",
@ -1090,7 +1091,6 @@ dependencies = [
"oorandom", "oorandom",
"profile", "profile",
"ra_assists", "ra_assists",
"ra_cfg",
"ra_db", "ra_db",
"ra_fmt", "ra_fmt",
"ra_hir", "ra_hir",
@ -1141,9 +1141,9 @@ dependencies = [
"anyhow", "anyhow",
"arena", "arena",
"cargo_metadata", "cargo_metadata",
"cfg",
"log", "log",
"paths", "paths",
"ra_cfg",
"ra_db", "ra_db",
"ra_proc_macro", "ra_proc_macro",
"rustc-hash", "rustc-hash",
@ -1240,6 +1240,7 @@ name = "rust-analyzer"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cfg",
"crossbeam-channel", "crossbeam-channel",
"env_logger", "env_logger",
"expect", "expect",
@ -1256,7 +1257,6 @@ dependencies = [
"pico-args", "pico-args",
"proc_macro_srv", "proc_macro_srv",
"profile", "profile",
"ra_cfg",
"ra_db", "ra_db",
"ra_hir", "ra_hir",
"ra_hir_def", "ra_hir_def",

View file

@ -1,9 +1,9 @@
[package] [package]
edition = "2018" name = "cfg"
name = "ra_cfg" 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

View file

@ -1,4 +1,4 @@
//! ra_cfg defines conditional compiling options, `cfg` attibute parser and evaluator //! cfg defines conditional compiling options, `cfg` attibute parser and evaluator
mod cfg_expr; mod cfg_expr;

View file

@ -13,7 +13,7 @@ salsa = "0.15.2"
rustc-hash = "1.1.0" rustc-hash = "1.1.0"
syntax = { path = "../syntax" } syntax = { path = "../syntax" }
ra_cfg = { path = "../ra_cfg" } cfg = { path = "../cfg" }
profile = { path = "../profile" } profile = { path = "../profile" }
tt = { path = "../tt" } tt = { path = "../tt" }
test_utils = { path = "../test_utils" } test_utils = { path = "../test_utils" }

View file

@ -59,7 +59,7 @@
//! ``` //! ```
use std::{str::FromStr, sync::Arc}; use std::{str::FromStr, sync::Arc};
use ra_cfg::CfgOptions; use cfg::CfgOptions;
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use test_utils::{extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER}; use test_utils::{extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER};
use vfs::{file_set::FileSet, VfsPath}; use vfs::{file_set::FileSet, VfsPath};

View file

@ -8,7 +8,7 @@
use std::{fmt, iter::FromIterator, ops, str::FromStr, sync::Arc}; use std::{fmt, iter::FromIterator, ops, str::FromStr, sync::Arc};
use ra_cfg::CfgOptions; use cfg::CfgOptions;
use rustc_hash::{FxHashMap, FxHashSet}; use rustc_hash::{FxHashMap, FxHashSet};
use syntax::SmolStr; use syntax::SmolStr;
use tt::TokenExpander; use tt::TokenExpander;

View file

@ -29,7 +29,7 @@ profile = { path = "../profile" }
hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" }
test_utils = { path = "../test_utils" } test_utils = { path = "../test_utils" }
mbe = { path = "../mbe" } mbe = { path = "../mbe" }
ra_cfg = { path = "../ra_cfg" } cfg = { path = "../cfg" }
tt = { path = "../tt" } tt = { path = "../tt" }
[dev-dependencies] [dev-dependencies]

View file

@ -23,7 +23,7 @@ use crate::{
EnumId, HasModule, LocalEnumVariantId, LocalFieldId, Lookup, ModuleId, StructId, UnionId, EnumId, HasModule, LocalEnumVariantId, LocalFieldId, Lookup, ModuleId, StructId, UnionId,
VariantId, VariantId,
}; };
use ra_cfg::CfgOptions; use cfg::CfgOptions;
/// Note that we use `StructData` for unions as well! /// Note that we use `StructData` for unions as well!
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq)]

View file

@ -5,7 +5,7 @@ use std::{ops, sync::Arc};
use either::Either; use either::Either;
use hir_expand::{hygiene::Hygiene, AstId, InFile}; use hir_expand::{hygiene::Hygiene, AstId, InFile};
use mbe::ast_to_token_tree; use mbe::ast_to_token_tree;
use ra_cfg::{CfgExpr, CfgOptions}; use cfg::{CfgExpr, CfgOptions};
use syntax::{ use syntax::{
ast::{self, AstNode, AttrsOwner}, ast::{self, AstNode, AttrsOwner},
SmolStr, SmolStr,

View file

@ -9,7 +9,7 @@ use arena::{map::ArenaMap, Arena};
use drop_bomb::DropBomb; use drop_bomb::DropBomb;
use either::Either; use either::Either;
use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId}; use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId};
use ra_cfg::CfgOptions; use cfg::CfgOptions;
use ra_db::CrateId; use ra_db::CrateId;
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use syntax::{ast, AstNode, AstPtr}; use syntax::{ast, AstNode, AstPtr};

View file

@ -11,7 +11,7 @@ use hir_expand::{
proc_macro::ProcMacroExpander, proc_macro::ProcMacroExpander,
HirFileId, MacroCallId, MacroDefId, MacroDefKind, HirFileId, MacroCallId, MacroDefId, MacroDefKind,
}; };
use ra_cfg::CfgOptions; use cfg::CfgOptions;
use ra_db::{CrateId, FileId, ProcMacroId}; use ra_db::{CrateId, FileId, ProcMacroId};
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;
use syntax::ast; use syntax::ast;

View file

@ -25,7 +25,7 @@ syntax = { path = "../syntax" }
text_edit = { path = "../text_edit" } text_edit = { path = "../text_edit" }
ra_db = { path = "../ra_db" } ra_db = { path = "../ra_db" }
ra_ide_db = { path = "../ra_ide_db" } ra_ide_db = { path = "../ra_ide_db" }
ra_cfg = { path = "../ra_cfg" } cfg = { path = "../cfg" }
ra_fmt = { path = "../ra_fmt" } ra_fmt = { path = "../ra_fmt" }
profile = { path = "../profile" } profile = { path = "../profile" }
test_utils = { path = "../test_utils" } test_utils = { path = "../test_utils" }

View file

@ -47,7 +47,7 @@ mod typing;
use std::sync::Arc; use std::sync::Arc;
use ra_cfg::CfgOptions; use cfg::CfgOptions;
use ra_db::{ use ra_db::{
salsa::{self, ParallelDatabase}, salsa::{self, ParallelDatabase},
CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath, CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath,

View file

@ -1,7 +1,7 @@
//! FIXME: write short doc here //! FIXME: write short doc here
use std::sync::Arc; use std::sync::Arc;
use ra_cfg::CfgOptions; use cfg::CfgOptions;
use ra_db::{CrateName, FileSet, SourceRoot, VfsPath}; use ra_db::{CrateName, FileSet, SourceRoot, VfsPath};
use test_utils::{ use test_utils::{
extract_annotations, extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER, extract_annotations, extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER,

View file

@ -63,7 +63,7 @@ pub(crate) fn crate_for(db: &RootDatabase, file_id: FileId) -> Vec<CrateId> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use ra_cfg::CfgOptions; use cfg::CfgOptions;
use ra_db::Env; use ra_db::Env;
use test_utils::mark; use test_utils::mark;

View file

@ -2,7 +2,7 @@ use std::fmt;
use hir::{AsAssocItem, Attrs, HirFileId, InFile, Semantics}; use hir::{AsAssocItem, Attrs, HirFileId, InFile, Semantics};
use itertools::Itertools; use itertools::Itertools;
use ra_cfg::CfgExpr; use cfg::CfgExpr;
use ra_ide_db::RootDatabase; use ra_ide_db::RootDatabase;
use syntax::{ use syntax::{
ast::{self, AstNode, AttrsOwner, DocCommentsOwner, ModuleItemOwner, NameOwner}, ast::{self, AstNode, AttrsOwner, DocCommentsOwner, ModuleItemOwner, NameOwner},

View file

@ -15,7 +15,7 @@ rustc-hash = "1.1.0"
cargo_metadata = "0.11.1" cargo_metadata = "0.11.1"
arena = { path = "../arena" } arena = { path = "../arena" }
ra_cfg = { path = "../ra_cfg" } cfg = { path = "../cfg" }
ra_db = { path = "../ra_db" } ra_db = { path = "../ra_db" }
toolchain = { path = "../toolchain" } toolchain = { path = "../toolchain" }
ra_proc_macro = { path = "../ra_proc_macro" } ra_proc_macro = { path = "../ra_proc_macro" }

View file

@ -3,7 +3,7 @@
//! rustc main.rs --cfg foo --cfg 'feature="bar"' //! rustc main.rs --cfg foo --cfg 'feature="bar"'
use std::str::FromStr; use std::str::FromStr;
use ra_cfg::CfgOptions; use cfg::CfgOptions;
use stdx::split_once; use stdx::split_once;
#[derive(Clone, Eq, PartialEq, Debug)] #[derive(Clone, Eq, PartialEq, Debug)]

View file

@ -13,7 +13,7 @@ use std::{
use anyhow::{bail, Context, Result}; use anyhow::{bail, Context, Result};
use paths::{AbsPath, AbsPathBuf}; use paths::{AbsPath, AbsPathBuf};
use ra_cfg::CfgOptions; use cfg::CfgOptions;
use ra_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId}; use ra_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId};
use rustc_hash::{FxHashMap, FxHashSet}; use rustc_hash::{FxHashMap, FxHashSet};

View file

@ -42,7 +42,7 @@ syntax = { path = "../syntax" }
text_edit = { path = "../text_edit" } text_edit = { path = "../text_edit" }
vfs = { path = "../vfs" } vfs = { path = "../vfs" }
vfs-notify = { path = "../vfs-notify" } vfs-notify = { path = "../vfs-notify" }
ra_cfg = { path = "../ra_cfg" } cfg = { path = "../cfg" }
toolchain = { path = "../toolchain" } toolchain = { path = "../toolchain" }
# This should only be used in CLI # This should only be used in CLI

View file

@ -1,6 +1,6 @@
//! See `CargoTargetSpec` //! See `CargoTargetSpec`
use ra_cfg::CfgExpr; use cfg::CfgExpr;
use ra_ide::{FileId, RunnableKind, TestId}; use ra_ide::{FileId, RunnableKind, TestId};
use ra_project_model::{self, TargetKind}; use ra_project_model::{self, TargetKind};
use vfs::AbsPathBuf; use vfs::AbsPathBuf;
@ -178,7 +178,7 @@ mod tests {
use super::*; use super::*;
use mbe::ast_to_token_tree; use mbe::ast_to_token_tree;
use ra_cfg::CfgExpr; use cfg::CfgExpr;
use syntax::{ use syntax::{
ast::{self, AstNode}, ast::{self, AstNode},
SmolStr, SmolStr,