From 5b0198457e4e6570677b3e443cda0ba73d63343b Mon Sep 17 00:00:00 2001 From: Troy Brown Date: Sun, 7 Apr 2024 20:57:58 -0400 Subject: [PATCH] Add support for GNAT Project. (#4417) --- CHANGELOG.org | 1 + clients/lsp-ada.el | 11 +++++++++++ docs/lsp-clients.json | 9 +++++++++ lsp-mode.el | 4 ++++ mkdocs.yml | 1 + 5 files changed, 26 insertions(+) diff --git a/CHANGELOG.org b/CHANGELOG.org index 56a398534a..0ad6b3d9bb 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -1,5 +1,6 @@ * Changelog ** Unreleased 9.0.1 + * Add support for GNAT Project (~gpr-mode~, ~gpr-ts-mode~). ** 9.0.0 * Add language server config for QML (Qt Modeling Language) using qmlls. diff --git a/clients/lsp-ada.el b/clients/lsp-ada.el index b8941de898..c11e4feb2b 100644 --- a/clients/lsp-ada.el +++ b/clients/lsp-ada.el @@ -178,6 +178,17 @@ :synchronize-sections '("ada") :environment-fn 'lsp-ada--environment)) +(lsp-register-client + (make-lsp-client :new-connection (lsp-stdio-connection + (lambda () (list (lsp-package-path 'ada-ls) + "--language-gpr"))) + :major-modes '(gpr-mode gpr-ts-mode) + :priority -1 + :download-server-fn (lambda (_client callback error-callback _update?) + (lsp-package-ensure 'ada-ls callback error-callback)) + :server-id 'gpr-ls + :environment-fn #'lsp-ada--environment)) + (lsp-consistency-check lsp-ada) (provide 'lsp-ada) diff --git a/docs/lsp-clients.json b/docs/lsp-clients.json index 7ec9cdb880..1f76f9816d 100644 --- a/docs/lsp-clients.json +++ b/docs/lsp-clients.json @@ -364,6 +364,15 @@ "installation-url": "https://github.com/nametake/golangci-lint-langserver#installation", "debugger": "Not available" }, + { + "name": "gpr", + "full-name": "GNAT Project", + "server-name": "ada_language_server", + "server-url": "https://github.com/AdaCore/ada_language_server", + "installation-url": "https://github.com/AdaCore/ada_language_server#install", + "lsp-install-server": "gpr-ls", + "debugger": "Not available" + }, { "name": "grammarly", "full-name": "Grammarly", diff --git a/lsp-mode.el b/lsp-mode.el index f01d5fe43f..3cec3aa8f9 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -800,6 +800,8 @@ Changes take effect only when a new session is started." ("^yang\\.settings$" . "jsonc") (ada-mode . "ada") (ada-ts-mode . "ada") + (gpr-mode . "gpr") + (gpr-ts-mode . "gpr") (awk-mode . "awk") (awk-ts-mode . "awk") (nxml-mode . "xml") @@ -6008,6 +6010,8 @@ Request codeAction/resolve for more info if server supports." (erlang-mode . erlang-indent-level) ; Erlang (ess-mode . ess-indent-offset) ; ESS (R) (go-ts-mode . go-ts-mode-indent-offset) + (gpr-mode . gpr-indent-offset) ; GNAT Project + (gpr-ts-mode . gpr-ts-mode-indent-offset) (hack-mode . hack-indent-offset) ; Hack (java-mode . c-basic-offset) ; Java (java-ts-mode . java-ts-mode-indent-offset) diff --git a/mkdocs.yml b/mkdocs.yml index c9369004b6..fee9b0ec2e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -81,6 +81,7 @@ nav: - GDScript: page/lsp-gdscript.md - Gleam: page/lsp-gleam.md - GLSL: page/lsp-glsl.md + - GNAT Project: page/lsp-gpr.md - Go (gopls): manual-language-docs/lsp-gopls.md - Grammarly: page/lsp-grammarly.md - GraphQL: page/lsp-graphql.md