diff options
author | Aleksey Kladov <[email protected]> | 2019-05-21 16:57:33 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-05-21 16:57:33 +0100 |
commit | 26463f189ff75e92990375ee5ae08d3903d39e66 (patch) | |
tree | 3bc9913361e9810ed7f9cb5e27f6b19c145431d9 | |
parent | 9f03c0781224faaa6e538094e34f1f6591689800 (diff) |
publish gen_lsp_server 0.2
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | crates/gen_lsp_server/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/traits.rs | 33 |
3 files changed, 20 insertions, 19 deletions
diff --git a/Cargo.lock b/Cargo.lock index 02adbe0a9..d8ada0757 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -487,7 +487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
487 | 487 | ||
488 | [[package]] | 488 | [[package]] |
489 | name = "gen_lsp_server" | 489 | name = "gen_lsp_server" |
490 | version = "0.1.0" | 490 | version = "0.2.0" |
491 | dependencies = [ | 491 | dependencies = [ |
492 | "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", | 492 | "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", |
493 | "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | 493 | "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1165,7 +1165,7 @@ dependencies = [ | |||
1165 | "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | 1165 | "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", |
1166 | "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | 1166 | "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", |
1167 | "flexi_logger 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", | 1167 | "flexi_logger 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", |
1168 | "gen_lsp_server 0.1.0", | 1168 | "gen_lsp_server 0.2.0", |
1169 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", | 1169 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", |
1170 | "lsp-types 0.57.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1170 | "lsp-types 0.57.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1171 | "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1171 | "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", |
diff --git a/crates/gen_lsp_server/Cargo.toml b/crates/gen_lsp_server/Cargo.toml index 34343e2f2..ba8bfdbd3 100644 --- a/crates/gen_lsp_server/Cargo.toml +++ b/crates/gen_lsp_server/Cargo.toml | |||
@@ -1,7 +1,7 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | 2 | edition = "2018" |
3 | name = "gen_lsp_server" | 3 | name = "gen_lsp_server" |
4 | version = "0.1.0" | 4 | version = "0.2.0" |
5 | authors = ["rust-analyzer developers"] | 5 | authors = ["rust-analyzer developers"] |
6 | repository = "https://github.com/rust-analyzer/rust-analyzer" | 6 | repository = "https://github.com/rust-analyzer/rust-analyzer" |
7 | license = "MIT OR Apache-2.0" | 7 | license = "MIT OR Apache-2.0" |
diff --git a/crates/ra_hir/src/ty/traits.rs b/crates/ra_hir/src/ty/traits.rs index f39749cab..908c00209 100644 --- a/crates/ra_hir/src/ty/traits.rs +++ b/crates/ra_hir/src/ty/traits.rs | |||
@@ -78,23 +78,24 @@ pub enum Obligation { | |||
78 | 78 | ||
79 | /// Check using Chalk whether trait is implemented for given parameters including `Self` type. | 79 | /// Check using Chalk whether trait is implemented for given parameters including `Self` type. |
80 | pub(crate) fn implements_query( | 80 | pub(crate) fn implements_query( |
81 | db: &impl HirDatabase, | 81 | _db: &impl HirDatabase, |
82 | krate: Crate, | 82 | _krate: Crate, |
83 | trait_ref: Canonical<TraitRef>, | 83 | _trait_ref: Canonical<TraitRef>, |
84 | ) -> Option<Solution> { | 84 | ) -> Option<Solution> { |
85 | let _p = profile("implements_query"); | 85 | return None; |
86 | let goal: chalk_ir::Goal = trait_ref.value.to_chalk(db).cast(); | 86 | // let _p = profile("implements_query"); |
87 | debug!("goal: {:?}", goal); | 87 | // let goal: chalk_ir::Goal = trait_ref.value.to_chalk(db).cast(); |
88 | let env = chalk_ir::Environment::new(); | 88 | // debug!("goal: {:?}", goal); |
89 | let in_env = chalk_ir::InEnvironment::new(&env, goal); | 89 | // let env = chalk_ir::Environment::new(); |
90 | let parameter = chalk_ir::ParameterKind::Ty(chalk_ir::UniverseIndex::ROOT); | 90 | // let in_env = chalk_ir::InEnvironment::new(&env, goal); |
91 | let canonical = | 91 | // let parameter = chalk_ir::ParameterKind::Ty(chalk_ir::UniverseIndex::ROOT); |
92 | chalk_ir::Canonical { value: in_env, binders: vec![parameter; trait_ref.num_vars] }; | 92 | // let canonical = |
93 | // We currently don't deal with universes (I think / hope they're not yet | 93 | // chalk_ir::Canonical { value: in_env, binders: vec![parameter; trait_ref.num_vars] }; |
94 | // relevant for our use cases?) | 94 | // // We currently don't deal with universes (I think / hope they're not yet |
95 | let u_canonical = chalk_ir::UCanonical { canonical, universes: 1 }; | 95 | // // relevant for our use cases?) |
96 | let solution = solve(db, krate, &u_canonical); | 96 | // let u_canonical = chalk_ir::UCanonical { canonical, universes: 1 }; |
97 | solution.map(|solution| solution_from_chalk(db, solution)) | 97 | // let solution = solve(db, krate, &u_canonical); |
98 | // solution.map(|solution| solution_from_chalk(db, solution)) | ||
98 | } | 99 | } |
99 | 100 | ||
100 | fn solution_from_chalk(db: &impl HirDatabase, solution: chalk_solve::Solution) -> Solution { | 101 | fn solution_from_chalk(db: &impl HirDatabase, solution: chalk_solve::Solution) -> Solution { |