rename "check" to add-lint-diagnostics
This commit is contained in:
parent
ea46f368be
commit
4bfa344b0e
@ -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
|
||||
|
||||
@ -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))
|
||||
|
||||
|
||||
@ -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}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user