Skip to content

Commit

Permalink
style: fix common errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 30, 2024
1 parent 56e7e9b commit c7a3fcb
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 101 deletions.
11 changes: 5 additions & 6 deletions clients/lsp-kotlin.el
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ executable with `exec-path'."
"Traces the communication between VSCode and the Kotlin language server."
:type '(choice (const "off")
(const "messages")
(const "verbose")
)
(const "verbose"))
:group 'lsp-kotlin
:package-version '(lsp-mode . "6.1"))

Expand Down Expand Up @@ -240,9 +239,9 @@ Requires lsp-inlay-hints-mode."
(progn
(require 'helm-source)
(helm :sources (helm-make-source
message 'helm-source-sync :candidates items
:action '(("Identity" lambda (_)
(setq lsp-kotlin--helm-result (helm-marked-candidates)))))
message 'helm-source-sync :candidates items
:action '(("Identity" lambda (_)
(setq lsp-kotlin--helm-result (helm-marked-candidates)))))
:buffer "*lsp-kotlin select*"
:prompt message)
lsp-kotlin--helm-result)
Expand Down Expand Up @@ -279,7 +278,7 @@ Requires lsp-inlay-hints-mode."
(-if-let* ((option-items (-map (lambda (x)
(list (lsp-get x :title)
(lsp-get (lsp-get (lsp-get x :edit)
:changes)
:changes)
(intern (concat ":" (lsp--buffer-uri))))))
member-options))
(selected-members (lsp-kotlin--completing-read-multiple "Select overrides" option-items nil)))
Expand Down
28 changes: 13 additions & 15 deletions clients/lsp-lua.el
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
:risky t
:type 'file)

(defcustom lsp-clients-emmy-lua-jar-path (f-join lsp-server-install-dir "EmmyLua-LS-all.jar")
(defcustom lsp-clients-emmy-lua-jar-path
(f-join lsp-server-install-dir "EmmyLua-LS-all.jar")
"Emmy Lua language server jar file."
:group 'lsp-emmy-lua
:version "8.0.0"
Expand Down Expand Up @@ -147,8 +148,7 @@
:type '(choice
(const "Disable")
(const "Both")
(const "Replace")
)
(const "Replace"))
:package-version '(lsp-mode . "8.0.0")
:group 'lsp-lua-language-server)

Expand Down Expand Up @@ -391,13 +391,11 @@ and the language server will provide special support.

(defcustom lsp-lua-runtime-version "Lua 5.4"
"Lua runtime version."
:type '(choice
(const "Lua 5.1")
(const "Lua 5.2")
(const "Lua 5.3")
(const "Lua 5.4")
(const "LuaJIT")
)
:type '(choice (const "Lua 5.1")
(const "Lua 5.2")
(const "Lua 5.3")
(const "Lua 5.4")
(const "LuaJIT"))
:package-version '(lsp-mode . "8.0.0")
:group 'lsp-lua-language-server)

Expand Down Expand Up @@ -690,13 +688,13 @@ and `../lib` ,exclude `../lib/temp`.
"Download the latest version of lua-language-server and extract it to
`lsp-lua-roblox-language-server-download-url'."
(lsp-download-install
(lambda (&rest _)
(lambda (&rest _)
(set-file-modes lsp-lua-roblox-language-server-bin #o0700)
(funcall callback))
error-callback
:url lsp-lua-roblox-server-download-url
:store-path lsp-lua-roblox-server-store-path
:decompress :zip))
error-callback
:url lsp-lua-roblox-server-download-url
:store-path lsp-lua-roblox-server-store-path
:decompress :zip))

(lsp-register-client
(make-lsp-client
Expand Down
5 changes: 2 additions & 3 deletions clients/lsp-markdown.el
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ For a complete list of plugins, check:
For a complete list of plugins, check:
https://github.com/unifiedjs/unified-language-server/blob/main/CONFIGURATION.md#re-using-settings"
:type '(choice
(const "retext-english")
(const "remark-parse"))
:type '(choice (const "retext-english")
(const "remark-parse"))
:group 'lsp-markdown
:package-version '(lsp-mode . "8.0.0"))

Expand Down
24 changes: 11 additions & 13 deletions clients/lsp-perlnavigator.el
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ default to ~/.perlcriticrc. (no aliases, .bat files or ~/)."

(defconst lsp-perlnavigator--log-level-type
'(choice (const "error")
(const "warning")
(const "info")
(const "hint")
(const "none")
))
(const "warning")
(const "info")
(const "hint")
(const "none")))

(defcustom lsp-perlnavigator-severity5 "warning"
"Editor Diagnostic severity level for Critic severity 5."
:type lsp-perlnavigator--log-level-type
Expand Down Expand Up @@ -114,11 +114,9 @@ default to ~/.perlcriticrc. (no aliases, .bat files or ~/)."

(defcustom lsp-perlnavigator-trace-server "messages"
"Traces the communication between VS Code and the language server."
:type '(choice
(const "off")
(const "messages")
(const "verbose")
)
:type '(choice (const "off")
(const "messages")
(const "verbose"))
:group 'lsp-perlnavigator
:package-version '(lsp-mode . "9.0.0"))

Expand Down Expand Up @@ -177,9 +175,9 @@ default to ~/.perlcriticrc. (no aliases, .bat files or ~/)."


(defvar lsp-perlnavigator--autoinstall-binary-path
(let ((exe-name (if (eq system-type 'windows-nt) "perlnavigator.exe" "perlnavigator")))
(f-join lsp-perlnavigator-autoinstall-dir "latest" (concat "perlnavigator" lsp-perlnavigator--os-suffix) exe-name))
"The path to the automatically installed language server executable.")
(let ((exe-name (if (eq system-type 'windows-nt) "perlnavigator.exe" "perlnavigator")))
(f-join lsp-perlnavigator-autoinstall-dir "latest" (concat "perlnavigator" lsp-perlnavigator--os-suffix) exe-name))
"The path to the automatically installed language server executable.")

(lsp-dependency
'perlnavigator
Expand Down
8 changes: 3 additions & 5 deletions clients/lsp-php.el
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,9 @@ definitions are found in excluded files/folders."
(lsp-defcustom lsp-intelephense-trace-server "off"
"Traces the communication between VSCode and the intelephense
language server."
:type '(choice
(const "off")
(const "messages")
(const "verbose")
)
:type '(choice (const "off")
(const "messages")
(const "verbose"))
:group 'lsp-intelephense
:package-version '(lsp-mode . "6.1")
:lsp-path "intelephense.trace.server")
Expand Down
10 changes: 4 additions & 6 deletions clients/lsp-purescript.el
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ Passed to the IDE server for source locations."
(lsp-defcustom lsp-purescript-formatter "purty"
"Tool to use to for formatting.
Must be installed and on PATH (or npm installed with addNpmPath set)"
:type '(choice
(const "none")
(const "purty")
(const "purs-tidy")
(const "pose")
)
:type '(choice (const "none")
(const "purty")
(const "purs-tidy")
(const "pose"))
:group 'lsp-purescript
:package-version '(lsp-mode . "9.0.0")
:lsp-path "purescript.formatter")
Expand Down
38 changes: 15 additions & 23 deletions clients/lsp-pwsh.el
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@
Set the generated help style with \='BlockComment\=' or \='LineComment\='.
Disable the feature with \='Disabled\='."
:type
'(choice
(const "Disabled")
(const "BlockComment")
(const "LineComment")
)
'(choice (const "Disabled")
(const "BlockComment")
(const "LineComment"))
:group 'lsp-pwsh
:package-version '(lsp-mode . "6.2"))

Expand Down Expand Up @@ -87,12 +85,10 @@ When disabled, the entire folded region is hidden."
Sets in a way that is compatible with PowerShell syntax.
For more information about the brace styles please refer to https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/81."
:type
'(choice
(const "Custom")
(const "Allman")
(const "OTBS")
(const "Stroustrup")
)
'(choice (const "Custom")
(const "Allman")
(const "OTBS")
(const "Stroustrup"))
:group 'lsp-pwsh
:package-version '(lsp-mode . "6.2"))

Expand All @@ -117,11 +113,9 @@ For more information about the brace styles please refer to https://github.com/P
(defcustom lsp-pwsh-code-formatting-pipeline-indentation-style "NoIndentation"
"Multi-line pipeline style settings."
:type
'(choice
(const "IncreaseIndentationForFirstPipeline")
(const "IncreaseIndentationAfterEveryPipeline")
(const "NoIndentation")
)
'(choice (const "IncreaseIndentationForFirstPipeline")
(const "IncreaseIndentationAfterEveryPipeline")
(const "NoIndentation"))
:group 'lsp-pwsh
:package-version '(lsp-mode . "6.2"))

Expand Down Expand Up @@ -186,13 +180,11 @@ associated conditional expression."
Valid values are \='Diagnostic\=', \='Verbose\=', \='Normal\=',
\='Warning\=', and \='Error\='"
:type
'(choice
(const "Diagnostic")
(const "Verbose")
(const "Normal")
(const "Warning")
(const "Error")
)
'(choice (const "Diagnostic")
(const "Verbose")
(const "Normal")
(const "Warning")
(const "Error"))
:group 'lsp-pwsh
:package-version '(lsp-mode . "6.2"))

Expand Down
27 changes: 13 additions & 14 deletions clients/lsp-roslyn.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ Unused on other platforms.")
(defcustom lsp-roslyn-server-log-level "Information"
"Log level for the Roslyn language server."
:type '(choice (const "None")
(const "Trace")
(const "Debug")
(const "Information")
(const "Warning")
(const "Error")
(const "Critical")
)
(const "Trace")
(const "Debug")
(const "Information")
(const "Warning")
(const "Error")
(const "Critical"))
:package-version '(lsp-mode . "8.0.0")
:group 'lsp-roslyn)

Expand Down Expand Up @@ -272,13 +271,13 @@ Assumes it was installed with the server install function."
(is-arm64 (string-match-p "aarch64" system-configuration))
(is-x86 (and (string-match-p "x86" system-configuration) (not is-x64))))
(if-let* ((platform-name (cond
((eq system-type 'gnu/linux) "linux")
((eq system-type 'darwin) "osx")
((eq system-type 'windows-nt) "win")))
(arch-name (cond
(is-x64 "x64")
(is-arm64 "arm64")
(is-x86 "x86"))))
((eq system-type 'gnu/linux) "linux")
((eq system-type 'darwin) "osx")
((eq system-type 'windows-nt) "win")))
(arch-name (cond
(is-x64 "x64")
(is-arm64 "arm64")
(is-x86 "x86"))))
(format "%s-%s" platform-name arch-name)
(error "Unsupported platform: %s (%s)" system-type system-configuration))))

Expand Down
2 changes: 1 addition & 1 deletion clients/lsp-rust.el
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
(defcustom lsp-rust-server 'rust-analyzer
"Choose LSP server."
:type '(choice (const :tag "rls" rls)
(const :tag "rust-analyzer" rust-analyzer))
(const :tag "rust-analyzer" rust-analyzer))
:group 'lsp-rust
:package-version '(lsp-mode . "6.2"))

Expand Down
28 changes: 13 additions & 15 deletions clients/lsp-yaml.el
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
Always: wrap prose if it exceeds the print width.
Never: never wrap the prose.
Preserve: wrap prose as-is."
:type '(choice
(const "always")
(const "never")
(const "preserve"))
:type '(choice (const "always")
(const "never")
(const "preserve"))
:group 'lsp-yaml
:package-version '(lsp-mode . "6.2"))

Expand Down Expand Up @@ -111,9 +110,9 @@
:type 'string
:group 'lsp-yaml)

(defcustom lsp-yaml-schema-store-local-db (expand-file-name
(locate-user-emacs-file
(f-join ".cache" "lsp" "lsp-yaml-schemas.json")))
(defcustom lsp-yaml-schema-store-local-db
(expand-file-name
(locate-user-emacs-file (f-join ".cache" "lsp" "lsp-yaml-schemas.json")))
"Cached database of schema store."
:type 'file
:group 'lsp-yaml)
Expand Down Expand Up @@ -173,16 +172,15 @@ Limited for performance reasons."
callback error-callback))))

(defconst lsp--yaml-schema-extension-type
'(list
(cons 'name string)
(cons 'description string)
(cons 'url string)
(cons 'fileMatch (repeat string))))
'(list (cons 'name string)
(cons 'description string)
(cons 'url string)
(cons 'fileMatch (repeat string))))

(defcustom lsp-yaml-schema-extensions '(((name . "Kubernetes v1.30.3")
(description . "Kubernetes v1.30.3 manifest schema definition")
(url . "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.30.3-standalone-strict/all.json")
(fileMatch . ["*-k8s.yaml" "*-k8s.yml"])))
(description . "Kubernetes v1.30.3 manifest schema definition")
(url . "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.30.3-standalone-strict/all.json")
(fileMatch . ["*-k8s.yaml" "*-k8s.yml"])))
"User defined schemas that extend default schema store.
Used in `lsp-yaml--get-supported-schemas' to supplement schemas provided by
`lsp-yaml-schema-store-uri'."
Expand Down

0 comments on commit c7a3fcb

Please sign in to comment.