diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-28 15:56:07 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-28 15:56:07 +0000 |
commit | c692e07b4ff648fea742c53c0dbad57d6f652068 (patch) | |
tree | d186df8fb298272eaa4ce14d2fccc854413bc566 /crates/ra_hir/src/semantics.rs | |
parent | 93f632ca4e7bb7fd54830e456d629a4948a92337 (diff) | |
parent | 56ce34c6a7ec0b4426d4cb25e10512c7efaf6f06 (diff) |
Merge #3367
3367: Fix highlighting of const patterns r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
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 eecccdae2..178d74be1 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs | |||
@@ -17,8 +17,8 @@ use crate::{ | |||
17 | db::HirDatabase, | 17 | db::HirDatabase, |
18 | source_analyzer::{resolve_hir_path, ReferenceDescriptor, SourceAnalyzer}, | 18 | source_analyzer::{resolve_hir_path, ReferenceDescriptor, SourceAnalyzer}, |
19 | source_binder::{ChildContainer, SourceBinder}, | 19 | source_binder::{ChildContainer, SourceBinder}, |
20 | Function, HirFileId, InFile, Local, MacroDef, Module, Name, Origin, Path, PathResolution, | 20 | Function, HirFileId, InFile, Local, MacroDef, Module, ModuleDef, Name, Origin, Path, |
21 | ScopeDef, StructField, Trait, Type, TypeParam, VariantDef, | 21 | PathResolution, ScopeDef, StructField, Trait, Type, TypeParam, VariantDef, |
22 | }; | 22 | }; |
23 | use hir_expand::ExpansionInfo; | 23 | use hir_expand::ExpansionInfo; |
24 | use ra_prof::profile; | 24 | use ra_prof::profile; |
@@ -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 | ||