rename "check" to add-lint-diagnostics

This commit is contained in:
XeroOl 2024-12-28 14:06:41 -06:00
parent ea46f368be
commit 4bfa344b0e
3 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@
(var should-err? false)
(each [_ filename (ipairs filenames)]
(let [file (files.get-by-uri server (.. "file://" filename))]
(lint.check server file)
(lint.add-lint-diagnostics server file)
(each [_ {: message :range {: start}} (ipairs file.diagnostics)]
(print (: "%s:%s:%s: %s" :format filename
;; LSP line numbers are zero-indexed, but Emacs and Vim both use

View File

@ -264,12 +264,12 @@ Every time the client sends a message, it gets handled by a function in the corr
(λ notifications.textDocument/didChange [server send {: contentChanges :textDocument {: uri}}]
(local file (files.get-by-uri server uri))
(files.set-uri-contents server uri (utils.apply-changes file.text contentChanges server.position-encoding))
(lint.check server file)
(lint.add-lint-diagnostics server file)
(send (message.diagnostics file)))
(λ notifications.textDocument/didOpen [server send {:textDocument {: text : uri}}]
(local file (files.set-uri-contents server uri text))
(lint.check server file)
(lint.add-lint-diagnostics server file)
(send (message.diagnostics file))
(set file.open? true))

View File

@ -211,7 +211,7 @@ the `file.diagnostics` field, filling it with diagnostics."
:code 307
:codeDescription "bad-unpack"}))
check [server file]
add-lint-diagnostics [server file]
"fill up the file.diagnostics table with linting things"
(let [lints server.configuration.lints
diagnostics file.diagnostics]
@ -252,4 +252,4 @@ the `file.diagnostics` field, filling it with diagnostics."
;; (if lints.unnecessary-unary-op))
;; (unnecessary-values file)))
{: check}
{: add-lint-diagnostics}