mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Merge ra_vfs_glob and ra_lsp_server
This commit is contained in:
parent
659b0e73cf
commit
2c9b91ad32
10 changed files with 12 additions and 26 deletions
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -1102,6 +1102,7 @@ dependencies = [
|
|||
"crossbeam-channel",
|
||||
"either",
|
||||
"env_logger",
|
||||
"globset",
|
||||
"itertools",
|
||||
"jod-thread",
|
||||
"log",
|
||||
|
@ -1120,7 +1121,6 @@ dependencies = [
|
|||
"ra_syntax",
|
||||
"ra_text_edit",
|
||||
"ra_vfs",
|
||||
"ra_vfs_glob",
|
||||
"rand",
|
||||
"relative-path",
|
||||
"rustc-hash",
|
||||
|
@ -1227,14 +1227,6 @@ dependencies = [
|
|||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ra_vfs_glob"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"globset",
|
||||
"ra_vfs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.7.3"
|
||||
|
|
|
@ -12,6 +12,7 @@ anyhow = "1.0"
|
|||
crossbeam-channel = "0.4"
|
||||
either = "1.5"
|
||||
env_logger = { version = "0.7.1", default-features = false }
|
||||
globset = "0.4.4"
|
||||
itertools = "0.8.0"
|
||||
jod-thread = "0.1.0"
|
||||
log = "0.4.3"
|
||||
|
@ -33,7 +34,6 @@ ra_project_model = { path = "../ra_project_model" }
|
|||
ra_syntax = { path = "../ra_syntax" }
|
||||
ra_text_edit = { path = "../ra_text_edit" }
|
||||
ra_vfs = "0.5.0"
|
||||
ra_vfs_glob = { path = "../ra_vfs_glob" }
|
||||
|
||||
# This should only be used in CLI
|
||||
ra_db = { path = "../ra_db" }
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
//! Command like parsing for rust-analyzer.
|
||||
//!
|
||||
//! If run started args, we run the LSP server loop. With a subcommand, we do a
|
||||
//! one-time batch processing.
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use pico_args::Arguments;
|
||||
use ra_lsp_server::cli::{BenchWhat, Position, Verbosity};
|
||||
|
|
|
@ -7,9 +7,10 @@ use ra_db::{CrateGraph, FileId, SourceRootId};
|
|||
use ra_ide::{AnalysisChange, AnalysisHost, FeatureFlags};
|
||||
use ra_project_model::{get_rustc_cfg_options, PackageRoot, ProjectWorkspace};
|
||||
use ra_vfs::{RootEntry, Vfs, VfsChange, VfsTask, Watch};
|
||||
use ra_vfs_glob::RustPackageFilterBuilder;
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use crate::vfs_glob::RustPackageFilterBuilder;
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
fn vfs_file_to_id(f: ra_vfs::VfsFile) -> FileId {
|
||||
|
|
|
@ -23,6 +23,7 @@ macro_rules! print {
|
|||
};
|
||||
}
|
||||
|
||||
mod vfs_glob;
|
||||
mod caps;
|
||||
mod cargo_target_spec;
|
||||
mod conv;
|
||||
|
|
|
@ -135,7 +135,7 @@ pub fn main_loop(
|
|||
let globs = config
|
||||
.exclude_globs
|
||||
.iter()
|
||||
.map(|glob| ra_vfs_glob::Glob::new(glob))
|
||||
.map(|glob| crate::vfs_glob::Glob::new(glob))
|
||||
.collect::<std::result::Result<Vec<_>, _>>()?;
|
||||
|
||||
if config.use_client_watching {
|
||||
|
|
|
@ -19,12 +19,12 @@ use ra_ide::{
|
|||
};
|
||||
use ra_project_model::{get_rustc_cfg_options, ProjectWorkspace};
|
||||
use ra_vfs::{LineEndings, RootEntry, Vfs, VfsChange, VfsFile, VfsRoot, VfsTask, Watch};
|
||||
use ra_vfs_glob::{Glob, RustPackageFilterBuilder};
|
||||
use relative_path::RelativePathBuf;
|
||||
|
||||
use crate::{
|
||||
diagnostics::{CheckFixes, DiagnosticCollection},
|
||||
main_loop::pending_requests::{CompletedRequest, LatestRequests},
|
||||
vfs_glob::{Glob, RustPackageFilterBuilder},
|
||||
LspError, Result,
|
||||
};
|
||||
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
[package]
|
||||
edition = "2018"
|
||||
name = "ra_vfs_glob"
|
||||
version = "0.1.0"
|
||||
authors = ["rust-analyzer developers"]
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
ra_vfs = "0.5.0"
|
||||
globset = "0.4.4"
|
|
@ -73,7 +73,6 @@ fn no_docs_comments() {
|
|||
}
|
||||
|
||||
let whitelist = [
|
||||
"ra_cli",
|
||||
"ra_db",
|
||||
"ra_hir",
|
||||
"ra_hir_expand",
|
||||
|
|
Loading…
Reference in a new issue