Skip to content

Commit

Permalink
Fixing defcustom warnings + 1 wrong usage of eq (#4377)
Browse files Browse the repository at this point in the history
* treewide: replace :type list to alist for Action Alist vars

All variables whose types being fixed in this commit are used as an
arg to `(display-buffer-in-side-window)` function. From the docs it
seems that the type of the key and value in this parameter is
completely arbitrary, and since `alist` type-definition allows
omitting the arg we do that.

Fixes a couple of byte-compilation warnings like:

    ‘list’ without arguments

* lsp-asm.el: fix two :type definitions

Fixes warnings:
    lsp-asm.el:38:10: Warning: in defcustom for ‘lsp-asm-active-modes’: ‘list’ without arguments
    lsp-ido.el:64:10: Warning: in defcustom for ‘lsp-ido-symbol-kind-to-string’: ‘vector’ without arguments

* lsp-headerline.el: fix wrong usage of (eq) for comparison to ""

`(eq)` does not care about object content, the author probably meant
to use (equal). Either way, there's a special func for string
emptiness, let's use it.

Fixes a warning:
    lsp-headerline.el:400:14: Warning: ‘eq’ called with literal string that may never match (arg 2)
  • Loading branch information
Hi-Angel authored Mar 18, 2024
1 parent 782e1dc commit 9e5a15c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clients/lsp-asm.el
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
(defcustom lsp-asm-active-modes
'( asm-mode fasm-mode masm-mode nasm-mode gas-mode)
"List of major mode that work with asm-lsp."
:type 'list
:type '(list symbol)
:group 'lsp-asm)

(defcustom lsp-asm-home-url
Expand Down
4 changes: 2 additions & 2 deletions clients/lsp-clojure.el
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@
(defcustom lsp-clojure-test-tree-position-params nil
"The optional test tree position params.
Defaults to side following treemacs default."
:type 'list
:type 'alist
:group 'lsp-clojure)

(defcustom lsp-clojure-project-tree-position-params nil
"The optional project tree position params.
Defaults to side following treemacs default."
:type 'list
:type 'alist
:group 'lsp-clojure)

;; Internal
Expand Down
4 changes: 2 additions & 2 deletions clients/lsp-terraform.el
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ language server."
(defcustom lsp-terraform-ls-providers-position-params nil
"The optional providers tree position params.
Defaults to side following treemacs default."
:type 'list
:type 'alist
:group 'lsp-terraform-ls
:package-version '(lsp-mode . "8.0.1"))

(defcustom lsp-terraform-ls-module-calls-position-params nil
"The optional module calls tree position params.
Defaults to side following treemacs default."
:type 'list
:type 'alist
:group 'lsp-terraform-ls
:package-version '(lsp-mode . "8.0.1"))

Expand Down
2 changes: 1 addition & 1 deletion lsp-headerline.el
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ PATH is the current folder to be checked."
(_ (lsp-log "'%s' is not a valid entry for `lsp-headerline-breadcrumb-segments'"
(symbol-name segment))
""))))
(if (eq segment-string "")
(if (string-empty-p segment-string)
""
(concat (lsp-headerline--arrow-icon)
" "
Expand Down
2 changes: 1 addition & 1 deletion lsp-ido.el
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"TPar"] ; TypeParameter - 26
"A vector of 26 items representing the SymbolKind."
:group 'lsp-ido
:type 'vector)
:type '(vector string))

(defcustom lsp-ido-show-symbol-filename
t
Expand Down

0 comments on commit 9e5a15c

Please sign in to comment.