Skip to content

Commit 978c5f4

Browse files
committed
Add file subtype
1 parent 99e9619 commit 978c5f4

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

vhdl_lang/src/analysis/declarative.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ impl<'a> AnalyzeContext<'a> {
318318
self.analyze_expression(region, expr, diagnostics)?;
319319
}
320320

321-
if subtype.is_some() {
322-
region.add(ident.clone(), NamedEntityKind::File, diagnostics);
321+
if let Some(subtype) = subtype {
322+
region.add(ident.clone(), NamedEntityKind::File(subtype), diagnostics);
323323
}
324324
}
325325
Declaration::Component(ref mut component) => {

vhdl_lang/src/analysis/named_entity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub enum NamedEntityKind {
9191
base_object: ObjectEnt,
9292
type_mark: TypeEnt,
9393
},
94-
File,
94+
File(Subtype),
9595
InterfaceFile(TypeEnt),
9696
Component(Region<'static>),
9797
Attribute,
@@ -154,7 +154,7 @@ impl NamedEntityKind {
154154
NonObjectAlias(..) => "alias",
155155
ObjectAlias { .. } => "object alias",
156156
ExternalAlias { .. } => "external alias",
157-
File => "file",
157+
File(..) => "file",
158158
InterfaceFile(..) => "file",
159159
ElementDeclaration(..) => "element declaration",
160160
Component(..) => "component",

vhdl_lang/src/analysis/semantic.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,8 @@ impl NamedEntity {
13971397
NamedEntityKind::DeferredConstant(ref subtype) => subtype.base_type(),
13981398
NamedEntityKind::ElementDeclaration(ref subtype) => subtype.base_type(),
13991399
NamedEntityKind::PhysicalLiteral(ref base_type) => base_type,
1400-
1400+
NamedEntityKind::InterfaceFile(ref file) => file.base_type(),
1401+
NamedEntityKind::File(ref file) => file.base_type(),
14011402
// Ignore now to avoid false positives
14021403
NamedEntityKind::LoopParameter => return true,
14031404
_ => {

0 commit comments

Comments
 (0)