diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-01-20 08:19:51 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-01-20 08:19:51 +0100 |
commit | 0b3d016face8a4c77d9d6d9821af174d4d6caa3b (patch) | |
tree | 32be73b1ae9092f68be498547e58eedd6b3fd904 | |
parent | 9514cc453c40b6d17c5175fb8fe701d0662444b1 (diff) | |
download | ghdl-0b3d016face8a4c77d9d6d9821af174d4d6caa3b.tar.gz ghdl-0b3d016face8a4c77d9d6d9821af174d4d6caa3b.tar.bz2 ghdl-0b3d016face8a4c77d9d6d9821af174d4d6caa3b.zip |
pyGHDL/lsp: check initialization error
-rw-r--r-- | pyGHDL/lsp/workspace.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pyGHDL/lsp/workspace.py b/pyGHDL/lsp/workspace.py index 980289806..023844e81 100644 --- a/pyGHDL/lsp/workspace.py +++ b/pyGHDL/lsp/workspace.py @@ -30,6 +30,10 @@ class ProjectError(Exception): self.msg = msg +class InitError(Exception): + pass + + class Workspace(object): def __init__(self, root_uri, server): self._root_uri = root_uri @@ -52,7 +56,9 @@ class Workspace(object): libghdl.errorout.Enable_Warning(errorout.Msgid.Warnid_Unused, True) self.read_project() self.set_options_from_project() - libghdl.analyze_init() + if libghdl.analyze_init_status() != 0: + log.error("cannot initialize libghdl") + raise InitError self._diags_set = set() # Documents with at least one diagnostic. self.read_files_from_project() self.gather_diagnostics(None) |