~xerool/fennel-ls

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH 1/2] Compile 'fennel-ls' before running tests

Rudolf Adamkovič <rudolf@adamkovic.org>
Details
Message ID
<20240615225050.7419-1-rudolf@adamkovic.org>
DKIM signature
pass
Download raw message
Patch: +1 -1
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index e262162..62bb69b 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,7 @@ selfcheck:
install: $(EXE)
	mkdir -p $(DESTDIR)$(BINDIR) && cp $< $(DESTDIR)$(BINDIR)/

test:
test: $(EXE)
	TESTING=1 $(FENNEL) $(FENNELFLAGS) test/init.fnl

ci:
-- 
2.45.1

[PATCH 2/2] Format '--check' errors so that tooling can detect them

Rudolf Adamkovič <rudolf@adamkovic.org>
Details
Message ID
<20240615225050.7419-2-rudolf@adamkovic.org>
In-Reply-To
<20240615225050.7419-1-rudolf@adamkovic.org> (view parent)
DKIM signature
pass
Download raw message
Patch: +21 -2
---
 src/fennel-ls.fnl |  2 +-
 test/check.fnl    | 18 ++++++++++++++++++
 test/init.fnl     |  3 ++-
 3 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 test/check.fnl

diff --git a/src/fennel-ls.fnl b/src/fennel-ls.fnl
index 4629fe6..9981218 100644
--- a/src/fennel-ls.fnl
+++ b/src/fennel-ls.fnl
@@ -20,7 +20,7 @@
      (let [file (files.get-by-uri server (.. "file://" filename))]
        (lint.check server file)
        (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
                    ;; 1-indexing for this.
                    (+ (or start.line 0) 1) (or start.character "?") message)))
diff --git a/test/check.fnl b/test/check.fnl
new file mode 100644
index 0000000..ce510bc
--- /dev/null
+++ b/test/check.fnl
@@ -0,0 +1,18 @@
(local faith (require :faith))

;; TODO refactor fennel-ls.check to avoid running end-to-end
;; (but keep/write at least some end-to-end tests)
(fn test-check []
  (let [input-file-name (os.tmpname)]
    (doto (io.open input-file-name :w)
      (: :write "(local x 1)")
      (: :close))
    (let [output-file (io.popen (.. "./fennel-ls --check "
                                    input-file-name)
                                :r)]
      (faith.= (.. input-file-name ":1:7: unused definition: x\n")
               (output-file:read :*a) )
      (os.remove input-file-name))
    nil))

{: test-check}
diff --git a/test/init.fnl b/test/init.fnl
index 439a242..4fd7b6c 100644
--- a/test/init.fnl
+++ b/test/init.fnl
@@ -24,4 +24,5 @@
   :test.lint
   :test.code-action
   :test.rename
   :test.misc])
   :test.misc
   :test.check])
-- 
2.45.1

Re: [PATCH 2/2] Format '--check' errors so that tooling can detect them

Details
Message ID
<-1UiU8qGg5J6Y2HK2GM9cN6SzUgKuLCHxcu6H0sI0jhTOAPH8cTixLw0OHwAdwTZw975ruO8lCo_OCrtFsuvfWZiPAoW1X1KwEvo5LkpNJw=@protonmail.com>
In-Reply-To
<20240615225050.7419-2-rudolf@adamkovic.org> (view parent)
DKIM signature
pass
Download raw message
Thank you very much!

I've applied both of these.

XeroOl
Reply to thread Export thread (mbox)