small changes
This commit is contained in:
parent
54014ff625
commit
b11b5b7962
@ -6,7 +6,6 @@ packages:
|
||||
- lua5.3
|
||||
- lua5.4
|
||||
- luajit
|
||||
- luarocks
|
||||
sources:
|
||||
- https://git.sr.ht/~xerool/fennel-ls
|
||||
tasks:
|
||||
|
||||
9
Makefile
9
Makefile
@ -48,7 +48,7 @@ install: $(EXE)
|
||||
mkdir -p $(DESTDIR)$(BINDIR) && cp $< $(DESTDIR)$(BINDIR)/
|
||||
|
||||
test: $(EXE)
|
||||
$(FENNEL) $(FENNELFLAGS) test/init.fnl
|
||||
TESTING=1 $(FENNEL) $(FENNELFLAGS) test/init.fnl
|
||||
|
||||
ci:
|
||||
$(MAKE) test LUA=lua5.1
|
||||
@ -63,9 +63,12 @@ ci:
|
||||
$(MAKE) FENNEL=./old-fennel deps
|
||||
diff -r deps old-deps
|
||||
diff -r fennel old-fennel
|
||||
rm -rf old-deps
|
||||
rm -f old-fennel
|
||||
|
||||
# luarocks
|
||||
luarocks install rockspecs/fennel-ls-scm-4.rockspec --dev --tree my-test-tree
|
||||
# test that luarocks builds properly
|
||||
sudo apt install luarocks
|
||||
luarocks install rockspecs/fennel-ls-scm-4.rockspec --dev --local
|
||||
|
||||
clean:
|
||||
rm -f $(EXE)
|
||||
|
||||
@ -159,13 +159,14 @@ WARNING: this is only used in the test code, not in the real language server"
|
||||
word))))
|
||||
|
||||
(fn multi-sym-base [symbol]
|
||||
(local symbol (tostring symbol))
|
||||
(if (or (= symbol ".")
|
||||
(= symbol "..")
|
||||
(= symbol "...")
|
||||
(= symbol ":")
|
||||
(= symbol "?."))
|
||||
(tostring symbol)
|
||||
(pick-values 1 (: (tostring symbol) :match "[^.:]*"))))
|
||||
symbol
|
||||
(pick-values 1 (symbol:match "[^.:]*"))))
|
||||
|
||||
(λ type= [val typ]
|
||||
(= (type val) typ))
|
||||
|
||||
@ -3,22 +3,22 @@
|
||||
(local {: create-client-with-files} (require :test.utils))
|
||||
|
||||
(fn find [diagnostics e]
|
||||
"returns the index of the diagnostic "
|
||||
(accumulate [result nil
|
||||
i d (ipairs diagnostics)
|
||||
&until result]
|
||||
(if (and (or (= e.message nil)
|
||||
(if (= (type e.message) "function")
|
||||
(e.message d.message)
|
||||
(= e.message d.message)))
|
||||
(or (= e.code nil)
|
||||
(= e.code d.code))
|
||||
(or (= e.range nil)
|
||||
(and (= e.range.start.line d.range.start.line)
|
||||
(= e.range.start.character d.range.start.character)
|
||||
(= e.range.end.line d.range.end.line)
|
||||
(= e.range.end.character d.range.end.character))))
|
||||
i)))
|
||||
"returns the index of the diagnostic that matches `e`"
|
||||
(accumulate [result nil
|
||||
i d (ipairs diagnostics)
|
||||
&until result]
|
||||
(if (and (or (= e.message nil)
|
||||
(if (= (type e.message) "function")
|
||||
(e.message d.message)
|
||||
(= e.message d.message)))
|
||||
(or (= e.code nil)
|
||||
(= e.code d.code))
|
||||
(or (= e.range nil)
|
||||
(and (= e.range.start.line d.range.start.line)
|
||||
(= e.range.start.character d.range.start.character)
|
||||
(= e.range.end.line d.range.end.line)
|
||||
(= e.range.end.character d.range.end.character))))
|
||||
i)))
|
||||
|
||||
(fn check [file-contents expected unexpected]
|
||||
(let [{: diagnostics} (create-client-with-files file-contents)]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user