From 4bfa344b0e8c6fae63512d15f8f3c3cc012f4d6a Mon Sep 17 00:00:00 2001 From: XeroOl Date: Sat, 28 Dec 2024 14:06:41 -0600 Subject: [PATCH] rename "check" to add-lint-diagnostics --- src/fennel-ls.fnl | 2 +- src/fennel-ls/handlers.fnl | 4 ++-- src/fennel-ls/lint.fnl | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fennel-ls.fnl b/src/fennel-ls.fnl index 4453418..2ee59e2 100644 --- a/src/fennel-ls.fnl +++ b/src/fennel-ls.fnl @@ -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 diff --git a/src/fennel-ls/handlers.fnl b/src/fennel-ls/handlers.fnl index dabb196..d7082e1 100644 --- a/src/fennel-ls/handlers.fnl +++ b/src/fennel-ls/handlers.fnl @@ -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)) diff --git a/src/fennel-ls/lint.fnl b/src/fennel-ls/lint.fnl index 580cbcf..21c55ad 100644 --- a/src/fennel-ls/lint.fnl +++ b/src/fennel-ls/lint.fnl @@ -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}