fix diagnostics indent

This commit is contained in:
XeroOl 2024-02-16 23:00:51 -06:00
parent ea89ecad9f
commit d8f0d396a9

View File

@ -36,17 +36,16 @@ the `file.diagnostics` field, filling it with diagnostics."
(λ unnecessary-method [self file colon call] (λ unnecessary-method [self file colon call]
"a call to the : builtin that could just be a multisym" "a call to the : builtin that could just be a multisym"
(if (sym? colon ":") (if (and (sym? colon ":")
(let [receiver (. call 2) (sym? (. call 2))
method (. call 3)] (. file.lexical call))
(if (and (sym? receiver) (let [method (. call 3)]
(. file.lexical call) (if (and (= :string (type method))
(= :string (type method))
(not (method:find "^[0-9]")) (not (method:find "^[0-9]"))
(not (method:find "[^!$%*+-/0-9<=>?A-Z\\^_a-z|\128-\255]"))) (not (method:find "[^!$%*+-/0-9<=>?A-Z\\^_a-z|\128-\255]")))
(case (message.ast->range self file call) (case (message.ast->range self file call)
range {: range range {: range
:message (.. "unnecessary : call: use (" (tostring receiver) ":" method ")") :message (.. "unnecessary : call: use (" (tostring (. call 2)) ":" method ")")
:severity message.severity.WARN :severity message.severity.WARN
:code 303 :code 303
:codeDescription "unnecessary-method"}))))) :codeDescription "unnecessary-method"})))))