aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-06-26 06:23:00 +0200
committerTristan Gingold <tgingold@free.fr>2022-06-26 06:23:00 +0200
commit6f24a701e13f81e1f788cc2695a885c7d2ccd22a (patch)
treed7a96f4f1dbfb481dfa86e827045736b152d2598 /pyGHDL
parentd0e40cd550e584b641525fa99a6a07ac316750aa (diff)
downloadghdl-6f24a701e13f81e1f788cc2695a885c7d2ccd22a.tar.gz
ghdl-6f24a701e13f81e1f788cc2695a885c7d2ccd22a.tar.bz2
ghdl-6f24a701e13f81e1f788cc2695a885c7d2ccd22a.zip
pyGHDL/lsp/workspace.py: handle entity_aspect_entity
Fix ghdl/ghdl-language-server#28
Diffstat (limited to 'pyGHDL')
-rw-r--r--pyGHDL/lsp/workspace.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/pyGHDL/lsp/workspace.py b/pyGHDL/lsp/workspace.py
index 3b75a6493..92d9cffa8 100644
--- a/pyGHDL/lsp/workspace.py
+++ b/pyGHDL/lsp/workspace.py
@@ -475,12 +475,20 @@ class Workspace(object):
while lists.Is_Valid(byref(deps_it)):
el = lists.Get_Element(byref(deps_it))
if nodes.Get_Kind(el) == nodes.Iir_Kind.Design_Unit:
- if res.get(el, None):
- res[el].append(units)
- else:
- res[el] = [units]
+ ent = el
+ elif nodes.Get_Kind(el) == nodes.Iir_Kind.Entity_Aspect_Entity:
+ # Extract design unit from entity aspect
+ # Do not care about the architecture.
+ ent = nodes.Get_Entity_Name(el)
+ ent = nodes.Get_Named_Entity(ent);
+ ent = nodes.Get_Design_Unit(ent)
else:
- assert False
+ assert False, pyutils.kind_image(nodes.Get_Kind(el))
+ assert nodes.Get_Kind(ent) == nodes.Iir_Kind.Design_Unit
+ if res.get(ent, None):
+ res[ent].append(units)
+ else:
+ res[ent] = [units]
lists.Next(byref(deps_it))
units = nodes.Get_Chain(units)
files = nodes.Get_Chain(files)