Skip to content

Commit

Permalink
feat: use lsp-defcustom to declare settings for lsp-magik (#4525)
Browse files Browse the repository at this point in the history
* [lsp-magik] Use lsp-defcustom to declare settings

* [lsp-magik] Mark new settings for the next-release

---------

Co-authored-by: Sebastiaan Speck <sebastiaan.speck@keronic.com>
  • Loading branch information
sebastiaanspeck and krn-sebastiaan authored Aug 15, 2024
1 parent 99e4c30 commit 168bf21
Showing 1 changed file with 37 additions and 39 deletions.
76 changes: 37 additions & 39 deletions clients/lsp-magik.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,77 +58,89 @@
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))

(defcustom lsp-magik-java-home nil
(lsp-defcustom lsp-magik-java-home nil
"Path to Java Runtime, Java 17 minimum."
:type `string
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.0")
:lsp-path "magik.javaHome")

(defcustom lsp-magik-product-dirs []
(lsp-defcustom lsp-magik-product-dirs []
"Paths to (compiled, containing a libs/ directory) products."
:type `lsp-string-vector
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.1")
:lsp-path "magik.productDirs")

(defcustom lsp-magik-lint-override-config-file nil
(lsp-defcustom lsp-magik-lint-override-config-file nil
"Override path to magiklintrc.properties."
:type 'string
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.0")
:lsp-path "magik.lint.overrideConfigFile")

(defcustom lsp-magik-typing-type-database-paths []
(lsp-defcustom lsp-magik-typing-type-database-paths []
"Paths to type databases."
:type `lsp-string-vector
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.0")
:lsp-path "magik.typing.typeDatabasePaths")

(defcustom lsp-magik-typing-show-typing-inlay-hints nil
(lsp-defcustom lsp-magik-typing-show-typing-inlay-hints nil
"Show typing inlay hints."
:type `boolean
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.1")
:lsp-path "magik.typing.showTypingInlayHints")

(defcustom lsp-magik-typing-show-argument-inlay-hints nil
(lsp-defcustom lsp-magik-typing-show-argument-inlay-hints nil
"Show (certain) argument name inlay hints."
:type `boolean
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.1")
:lsp-path "magik.typing.showArgumentInlayHints")

(defcustom lsp-magik-typing-enable-checks nil
(lsp-defcustom lsp-magik-typing-enable-checks nil
"Enable typing checks."
:type `boolean
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.0")
:lsp-path "magik.typing.enableChecks")

(defcustom lsp-magik-typing-index-global-usages t
(lsp-defcustom lsp-magik-typing-index-global-usages t
"Enable indexing of usages of globals by methods."
:type `boolean
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.1")
:lsp-path "magik.typing.indexGlobalUsages")

(defcustom lsp-magik-typing-index-method-usages nil
(lsp-defcustom lsp-magik-typing-index-method-usages nil
"Enable indexing of usages of methods by methods."
:type `boolean
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.1")
:lsp-path "magik.typing.indexMethodUsages")

(defcustom lsp-magik-typing-index-slot-usages t
(lsp-defcustom lsp-magik-typing-index-slot-usages t
"Enable indexing of usages of slots by methods."
:type `boolean
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.1")
:lsp-path "magik.typing.indexSlotUsages")

(defcustom lsp-magik-typing-index-condition-usages t
(lsp-defcustom lsp-magik-typing-index-condition-usages t
"Enable indexing of usages of conditions by methods."
:type `boolean
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.1")
:lsp-path "magik.typing.indexConditionUsages")

(defcustom lsp-magik-typing-cache-indexed-definitions-method-usages t
(lsp-defcustom lsp-magik-typing-cache-indexed-definitions-method-usages t
"Store and load the indexed definitions in the workspace folders."
:type `boolean
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.1")
:lsp-path "magik.typing.cacheIndexedDefinitions")

(defcustom lsp-magik-java-path (lambda ()
(cond ((eq system-type 'windows-nt)
Expand All @@ -138,7 +150,7 @@
"Path to Java Runtime, Java 11 minimum."
:type 'string
:group `lsp-magik
:package-version '(lsp-mode . "9.0.0"))
:package-version '(lsp-mode . "9.0.1"))

(lsp-register-client
(make-lsp-client
Expand All @@ -157,20 +169,6 @@
(lsp--set-configuration (lsp-configuration-section "magik"))))
:server-id 'magik))

(lsp-register-custom-settings
`(("magik.javaHome" lsp-magik-java-home)
("magik.productDirs" lsp-magik-product-dirs)
("magik.lint.overrideConfigFile" lsp-magik-lint-override-config-file)
("magik.typing.typeDatabasePaths" lsp-magik-typing-type-database-paths)
("magik.typing.showTypingInlayHints" lsp-magik-typing-show-typing-inlay-hints)
("magik.typing.showArgumentInlayHints" lsp-magik-typing-show-argument-inlay-hints)
("magik.typing.enableChecks" lsp-magik-typing-enable-checks)
("magik.typing.indexGlobalUsages" lsp-magik-typing-index-global-usages)
("magik.typing.indexMethodUsages" lsp-magik-typing-index-method-usages)
("magik.typing.indexSlotUsages" lsp-magik-typing-index-slot-usages)
("magik.typing.indexConditionUsages" lsp-magik-typing-index-condition-usages)
("magik.typing.cacheIndexedDefinitions" lsp-magik-typing-cache-indexed-definitions)))

(lsp-consistency-check lsp-magik)

(provide 'lsp-magik)
Expand Down

0 comments on commit 168bf21

Please sign in to comment.