From 0b3d016face8a4c77d9d6d9821af174d4d6caa3b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 20 Jan 2021 08:19:51 +0100 Subject: pyGHDL/lsp: check initialization error --- pyGHDL/lsp/workspace.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pyGHDL/lsp') 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) -- cgit v1.2.3