From f6476a6a6f5232a4fc9befa807e4290559174633 Mon Sep 17 00:00:00 2001 From: Jade Abraham Date: Tue, 11 Jun 2024 11:20:00 -0700 Subject: [PATCH 1/3] fix missing line after refactor Signed-off-by: Jade Abraham --- tools/chpl-language-server/src/chpl-language-server.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/chpl-language-server/src/chpl-language-server.py b/tools/chpl-language-server/src/chpl-language-server.py index 494548623ea9..c15d81a64682 100755 --- a/tools/chpl-language-server/src/chpl-language-server.py +++ b/tools/chpl-language-server/src/chpl-language-server.py @@ -173,6 +173,10 @@ def error(msg: str): error("CHPL_HOME not set") return None + chplcheck_path = os.path.join(chpl_home, "tools", "chplcheck", "src") + # Add chplcheck to the path, but load via importlib + sys.path.append(chplcheck_path) + def load_module(module_name: str) -> Optional[ModuleType]: file_path = os.path.join(chplcheck_path, module_name + ".py") spec = importlib.util.spec_from_file_location( From 9974877eedf1f5865848fb98205dcecb1d9a9e0a Mon Sep 17 00:00:00 2001 From: Jade Abraham Date: Tue, 11 Jun 2024 11:20:21 -0700 Subject: [PATCH 2/3] fix docs Signed-off-by: Jade Abraham --- doc/rst/tools/chpl-language-server/chpl-language-server.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/rst/tools/chpl-language-server/chpl-language-server.rst b/doc/rst/tools/chpl-language-server/chpl-language-server.rst index 3917e84549e3..9e7107863606 100644 --- a/doc/rst/tools/chpl-language-server/chpl-language-server.rst +++ b/doc/rst/tools/chpl-language-server/chpl-language-server.rst @@ -79,7 +79,7 @@ syntax highlighting in Emacs): (with-eval-after-load 'eglot (add-to-list 'eglot-server-programs - '(chpl-mode . ("chpl-language-server", "--chplcheck")))) + '(chpl-mode . ("chpl-language-server" "--chplcheck")))) This will enable using the language server with a particular ``.chpl`` file by calling ``M-x eglot``. From 968c10c3f25364a6fff78590044acf41b266df44 Mon Sep 17 00:00:00 2001 From: Jade Abraham Date: Tue, 11 Jun 2024 11:22:43 -0700 Subject: [PATCH 3/3] fix string name Signed-off-by: Jade Abraham --- tools/chpl-language-server/src/chpl-language-server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/chpl-language-server/src/chpl-language-server.py b/tools/chpl-language-server/src/chpl-language-server.py index c15d81a64682..0bc9863104fd 100755 --- a/tools/chpl-language-server/src/chpl-language-server.py +++ b/tools/chpl-language-server/src/chpl-language-server.py @@ -194,7 +194,7 @@ def load_module(module_name: str) -> Optional[ModuleType]: return module mods = [] - for mod in ["main", "config", "lsp", "driver", "rules"]: + for mod in ["chplcheck", "config", "lsp", "driver", "rules"]: m = load_module(mod) if m is None: return None