mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
fix: flyimport triggers on enum variant declarations
This commit is contained in:
parent
766b52b598
commit
5666046ec9
4 changed files with 38 additions and 0 deletions
|
@ -45,6 +45,7 @@ pub(crate) enum ImmediateLocation {
|
|||
StmtList,
|
||||
ItemList,
|
||||
TypeBound,
|
||||
Variant,
|
||||
/// Fake file ast node
|
||||
Attribute(ast::Attr),
|
||||
/// Fake file ast node
|
||||
|
@ -213,6 +214,7 @@ pub(crate) fn determine_location(
|
|||
ast::SourceFile(_it) => ImmediateLocation::ItemList,
|
||||
ast::ItemList(_it) => ImmediateLocation::ItemList,
|
||||
ast::RefExpr(_it) => ImmediateLocation::RefExpr,
|
||||
ast::Variant(_it) => ImmediateLocation::Variant,
|
||||
ast::RecordField(it) => if it.ty().map_or(false, |it| it.syntax().text_range().contains(offset)) {
|
||||
return None;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue