diff options
author | Aleksey Kladov <[email protected]> | 2020-02-28 15:36:14 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-28 15:38:36 +0000 |
commit | 5ebfcb9cb757ece936f631cf69136e1d38cb6afc (patch) | |
tree | 2fe6a843fb15a62e3177b473e99118778619ca39 /crates/ra_hir/src/semantics.rs | |
parent | 209eb32796c6fd56d1b378690c807cf73ce54235 (diff) |
Fix highlighting of const patterns
Diffstat (limited to 'crates/ra_hir/src/semantics.rs')
-rw-r--r-- | crates/ra_hir/src/semantics.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index c3d8ee1ae..154adedb3 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs | |||
@@ -18,8 +18,8 @@ use crate::{ | |||
18 | db::HirDatabase, | 18 | db::HirDatabase, |
19 | source_analyzer::{resolve_hir_path, ReferenceDescriptor, SourceAnalyzer}, | 19 | source_analyzer::{resolve_hir_path, ReferenceDescriptor, SourceAnalyzer}, |
20 | source_binder::{ChildContainer, SourceBinder}, | 20 | source_binder::{ChildContainer, SourceBinder}, |
21 | Function, HirFileId, InFile, Local, MacroDef, Module, Name, Origin, Path, PathResolution, | 21 | Function, HirFileId, InFile, Local, MacroDef, Module, ModuleDef, Name, Origin, Path, |
22 | ScopeDef, StructField, Trait, Type, TypeParam, VariantDef, | 22 | PathResolution, ScopeDef, StructField, Trait, Type, TypeParam, VariantDef, |
23 | }; | 23 | }; |
24 | use ra_prof::profile; | 24 | use ra_prof::profile; |
25 | 25 | ||
@@ -129,6 +129,10 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { | |||
129 | self.analyze(path.syntax()).resolve_path(self.db, path) | 129 | self.analyze(path.syntax()).resolve_path(self.db, path) |
130 | } | 130 | } |
131 | 131 | ||
132 | pub fn resolve_bind_pat_to_const(&self, pat: &ast::BindPat) -> Option<ModuleDef> { | ||
133 | self.analyze(pat.syntax()).resolve_bind_pat_to_const(self.db, pat) | ||
134 | } | ||
135 | |||
132 | // FIXME: use this instead? | 136 | // FIXME: use this instead? |
133 | // pub fn resolve_name_ref(&self, name_ref: &ast::NameRef) -> Option<???>; | 137 | // pub fn resolve_name_ref(&self, name_ref: &ast::NameRef) -> Option<???>; |
134 | 138 | ||