Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
Closed
1,026 changes: 524 additions & 502 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ test = false
path = "rls/src/main.rs"

[dependencies]
rls-analysis = "0.17.0"
rls-analysis = {version="0.17.1", path="rls-analysis"}
rls-blacklist = "0.1.3"
rls-data = "0.19"
# FIXME: Release rls-rustc 0.6.0 to crates.io
rls-rustc = { version = "0.6.0", path = "rls-rustc" }
rls-span = "0.5"
rls-vfs = "0.8"

cargo = { git = "https://github.com/rust-lang/cargo", rev = "beb8fcb5248dc2e6aa488af9613216d5ccb31c6a" }
cargo = { git = "https://github.com/rust-lang/cargo", version = "0.37.0"} # rev = "beb8fcb5248dc2e6aa488af9613216d5ccb31c6a" }
cargo_metadata = "0.7"
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "86f73473c8de4598f8ade982dbb9d44f89777c54", optional = true }
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", version = "0.0.212", optional = true }
env_logger = "0.6"
failure = "0.1.1"
home = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion rls-analysis/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rls-analysis"
version = "0.17.0"
version = "0.17.1"
authors = ["Nick Cameron <[email protected]>"]
description = "Library for processing rustc's save-analysis data for the RLS"
license = "Apache-2.0/MIT"
Expand Down
8 changes: 8 additions & 0 deletions rls-analysis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,14 @@ impl<L: AnalysisLoader> AnalysisHost<L> {
})
}

pub fn show_name(&self, span: &Span) -> AResult<String> {
self.with_analysis(|a| {
a.def_id_for_span(span)
.and_then(|id| a.with_defs(id, clone_field!(name)))
.or_else(|| a.with_globs(span, clone_field!(value)))
})
}

pub fn docs(&self, span: &Span) -> AResult<String> {
self.with_analysis(|a| {
a.def_id_for_span(span).and_then(|id| a.with_defs(id, clone_field!(docs)))
Expand Down
Loading