Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 3d558d0

Browse files
committed
Move rls-data crate
Based on rust-dev-tools/rls-data@31a0711
1 parent ef3ac14 commit 3d558d0

File tree

6 files changed

+465
-1
lines changed

6 files changed

+465
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ path = "rls/src/main.rs"
2222

2323
[dependencies]
2424
rls-analysis = "0.16.12"
25+
rls-data = { version = "0.18.2", features = ["serialize-serde", "serialize-rustc"] }
2526

2627
cargo = { git = "https://github.com/rust-lang/cargo", rev = "4e74e2fc0908524d17735c768067117d3e84ee9c" }
2728
cargo_metadata = "0.7"
@@ -39,7 +40,6 @@ racer = { version = "=2.1.18", default-features = false }
3940
rand = "0.6"
4041
rayon = "1"
4142
rls-blacklist = "0.1.3"
42-
rls-data = { version = "0.18.2", features = ["serialize-serde", "serialize-rustc"] }
4343
rls-rustc = "0.5.0"
4444
rls-span = { version = "0.4", features = ["serialize-serde"] }
4545
rls-vfs = "0.7"

rls-data/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target/
2+
**/*.rs.bk
3+
4+
Cargo.lock

rls-data/Cargo.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "rls-data"
3+
version = "0.18.2"
4+
authors = ["Nick Cameron <[email protected]>"]
5+
description = "Data structures used by the RLS and Rust compiler"
6+
license = "Apache-2.0/MIT"
7+
repository = "https://github.com/rust-dev-tools/rls-data"
8+
categories = ["development-tools"]
9+
10+
[dependencies]
11+
rls-span = "0.4.1"
12+
rustc-serialize = { version = "0.3", optional = true }
13+
serde = { version = "1.0", optional = true }
14+
serde_derive = { version = "1.0", optional = true }
15+
16+
[features]
17+
default = ["serialize-rustc"]
18+
borrows=[]
19+
serialize-rustc = ["rustc-serialize", "rls-span/serialize-rustc"]
20+
serialize-serde = ["serde", "serde_derive", "rls-span/serialize-serde"]

rls-data/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RLS-data
2+
3+
Data structures used by the RLS and the Rust compiler.
4+
5+
These are used by the save-analysis functionality in the compiler
6+
(`rustc -Zsave-analysis`). In that use, the compiler translates info in its
7+
internal data structures to these data structures then serialises them as JSON.
8+
Clients (such as the RLS) can use this crate when deserialising.
9+
10+
The data can also be passed directly from compiler to client if the compiler is
11+
used as a library.

rls-data/src/config.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// at http://rust-lang.org/COPYRIGHT.
3+
//
4+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7+
// option. This file may not be copied, modified, or distributed
8+
// except according to those terms.
9+
10+
/// Used to configure save-analysis.
11+
#[cfg_attr(feature = "serialize-serde", derive(Serialize, Deserialize))]
12+
#[cfg_attr(feature = "serialize-rustc", derive(RustcDecodable, RustcEncodable))]
13+
#[derive(Debug, Clone, Default)]
14+
pub struct Config {
15+
/// File to output save-analysis data to.
16+
pub output_file: Option<String>,
17+
/// Include all documentation for items. (If `false`, only includes the
18+
/// summary (first paragraph) for each item).
19+
pub full_docs: bool,
20+
/// If true only includes data for public items in a crate (useful for
21+
/// library crates).
22+
pub pub_only: bool,
23+
/// If true only includes data for items reachable from the crate root.
24+
pub reachable_only: bool,
25+
/// True if and only if the analysed crate is part of the standard Rust distro.
26+
pub distro_crate: bool,
27+
/// Include signature information.
28+
pub signatures: bool,
29+
/// Include experimental borrow data.
30+
pub borrow_data: bool,
31+
}

0 commit comments

Comments
 (0)