aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-01-20 08:19:51 +0100
committerTristan Gingold <tgingold@free.fr>2021-01-20 08:19:51 +0100
commit0b3d016face8a4c77d9d6d9821af174d4d6caa3b (patch)
tree32be73b1ae9092f68be498547e58eedd6b3fd904 /pyGHDL
parent9514cc453c40b6d17c5175fb8fe701d0662444b1 (diff)
downloadghdl-0b3d016face8a4c77d9d6d9821af174d4d6caa3b.tar.gz
ghdl-0b3d016face8a4c77d9d6d9821af174d4d6caa3b.tar.bz2
ghdl-0b3d016face8a4c77d9d6d9821af174d4d6caa3b.zip
pyGHDL/lsp: check initialization error
Diffstat (limited to 'pyGHDL')
-rw-r--r--pyGHDL/lsp/workspace.py8
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)