diff options
| author | Tristan Gingold <tgingold@free.fr> | 2022-06-26 06:23:00 +0200 | 
|---|---|---|
| committer | Tristan Gingold <tgingold@free.fr> | 2022-06-26 06:23:00 +0200 | 
| commit | 6f24a701e13f81e1f788cc2695a885c7d2ccd22a (patch) | |
| tree | d7a96f4f1dbfb481dfa86e827045736b152d2598 | |
| parent | d0e40cd550e584b641525fa99a6a07ac316750aa (diff) | |
| download | ghdl-6f24a701e13f81e1f788cc2695a885c7d2ccd22a.tar.gz ghdl-6f24a701e13f81e1f788cc2695a885c7d2ccd22a.tar.bz2 ghdl-6f24a701e13f81e1f788cc2695a885c7d2ccd22a.zip  | |
pyGHDL/lsp/workspace.py: handle entity_aspect_entity
Fix ghdl/ghdl-language-server#28
| -rw-r--r-- | pyGHDL/lsp/workspace.py | 18 | 
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)  | 
