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