rename diagnostic to lint

This commit is contained in:
XeroOl 2024-03-28 23:01:20 -05:00
parent 0fd6a48ed2
commit b5750b1a8a
5 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
(local dispatch (require :fennel-ls.dispatch)) (local dispatch (require :fennel-ls.dispatch))
(local json-rpc (require :fennel-ls.json-rpc)) (local json-rpc (require :fennel-ls.json-rpc))
(local state (require :fennel-ls.state)) (local state (require :fennel-ls.state))
(local diagnostics (require :fennel-ls.diagnostics)) (local lint (require :fennel-ls.lint))
(λ check [filenames] (λ check [filenames]
(let [server (doto {} (let [server (doto {}
@ -15,7 +15,7 @@
(var should-err? false) (var should-err? false)
(each [_ filename (ipairs filenames)] (each [_ filename (ipairs filenames)]
(let [file (state.get-by-uri server (.. "file://" filename))] (let [file (state.get-by-uri server (.. "file://" filename))]
(diagnostics.check server file) (lint.check server file)
(each [_ {: message :range {: start}} (ipairs file.diagnostics)] (each [_ {: message :range {: start}} (ipairs file.diagnostics)]
(print (: "%s:%s:%s %s" :format filename (print (: "%s:%s:%s %s" :format filename
;; LSP line numbers are zero-indexed, but Emacs and Vim both use ;; LSP line numbers are zero-indexed, but Emacs and Vim both use

View File

@ -5,7 +5,7 @@ Every time the client sends a message, it gets handled by a function in the corr
(ie, a textDocument/didChange notification will call notifications.textDocument/didChange (ie, a textDocument/didChange notification will call notifications.textDocument/didChange
and a textDocument/defintion request will call requests.textDocument/definition)" and a textDocument/defintion request will call requests.textDocument/definition)"
(local diagnostics (require :fennel-ls.diagnostics)) (local lint (require :fennel-ls.lint))
(local message (require :fennel-ls.message)) (local message (require :fennel-ls.message))
(local state (require :fennel-ls.state)) (local state (require :fennel-ls.state))
(local language (require :fennel-ls.language)) (local language (require :fennel-ls.language))
@ -253,12 +253,12 @@ Every time the client sends a message, it gets handled by a function in the corr
(λ notifications.textDocument/didChange [self send {: contentChanges :textDocument {: uri}}] (λ notifications.textDocument/didChange [self send {: contentChanges :textDocument {: uri}}]
(local file (state.get-by-uri self uri)) (local file (state.get-by-uri self uri))
(state.set-uri-contents self uri (utils.apply-changes file.text contentChanges self.position-encoding)) (state.set-uri-contents self uri (utils.apply-changes file.text contentChanges self.position-encoding))
(diagnostics.check self file) (lint.check self file)
(send (message.diagnostics file))) (send (message.diagnostics file)))
(λ notifications.textDocument/didOpen [self send {:textDocument {: languageId : text : uri}}] (λ notifications.textDocument/didOpen [self send {:textDocument {: languageId : text : uri}}]
(local file (state.set-uri-contents self uri text)) (local file (state.set-uri-contents self uri text))
(diagnostics.check self file) (lint.check self file)
(send (message.diagnostics file)) (send (message.diagnostics file))
(set file.open? true)) (set file.open? true))

View File

@ -20,7 +20,7 @@
:test.hover :test.hover
:test.completion :test.completion
:test.references :test.references
:test.diagnostic :test.lint
:test.code-action :test.code-action
:test.rename :test.rename
:test.misc]) :test.misc])