mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Merge #3367
3367: Fix highlighting of const patterns r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
c692e07b4f
13 changed files with 143 additions and 70 deletions
|
@ -17,8 +17,8 @@ use crate::{
|
|||
db::HirDatabase,
|
||||
source_analyzer::{resolve_hir_path, ReferenceDescriptor, SourceAnalyzer},
|
||||
source_binder::{ChildContainer, SourceBinder},
|
||||
Function, HirFileId, InFile, Local, MacroDef, Module, Name, Origin, Path, PathResolution,
|
||||
ScopeDef, StructField, Trait, Type, TypeParam, VariantDef,
|
||||
Function, HirFileId, InFile, Local, MacroDef, Module, ModuleDef, Name, Origin, Path,
|
||||
PathResolution, ScopeDef, StructField, Trait, Type, TypeParam, VariantDef,
|
||||
};
|
||||
use hir_expand::ExpansionInfo;
|
||||
use ra_prof::profile;
|
||||
|
@ -129,6 +129,10 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> {
|
|||
self.analyze(path.syntax()).resolve_path(self.db, path)
|
||||
}
|
||||
|
||||
pub fn resolve_bind_pat_to_const(&self, pat: &ast::BindPat) -> Option<ModuleDef> {
|
||||
self.analyze(pat.syntax()).resolve_bind_pat_to_const(self.db, pat)
|
||||
}
|
||||
|
||||
// FIXME: use this instead?
|
||||
// pub fn resolve_name_ref(&self, name_ref: &ast::NameRef) -> Option<???>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue