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