From 5e8b31ea4770e3c70dc9917f941e78f39d3b8adb Mon Sep 17 00:00:00 2001 From: XeroOl Date: Tue, 3 Sep 2024 12:17:53 -0500 Subject: [PATCH] use fennel 1.5's native debug tracking --- src/fennel-ls/compiler.fnl | 2 +- test/hover.fnl | 5 +++++ test/init.fnl | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/fennel-ls/compiler.fnl b/src/fennel-ls/compiler.fnl index 270a386..4f9194a 100644 --- a/src/fennel-ls/compiler.fnl +++ b/src/fennel-ls/compiler.fnl @@ -389,7 +389,7 @@ identifiers are declared / referenced in which places." (parsed ast lexical) - ;; This is bad; we mutate fennel.macro-path + ;; This is bad; we have to mutate fennel.macro-path to use fennel's native macro loader (let [old-macro-path fennel.macro-path] (when ?root-uri (set fennel.macro-path diff --git a/test/hover.fnl b/test/hover.fnl index 3b4eaac..2555bf8 100644 --- a/test/hover.fnl +++ b/test/hover.fnl @@ -151,6 +151,11 @@ except that it sets a new message handler `msgh`.") `(,a ,b ,c)) (fo|o print :hello :world)" "```fnl\n(foo a b c)\n```\ndocstring!") + ; (check {:main.fnl "(import-macros cool :cool) + ; (coo|l.=)" + ; :cool.fnl ";; fennel-ls: macro-file + ; {:= (λ [...] ...)}"} + ; "```fnl\n{:= (λ [...] ...)}\n```") nil) (fn test-reader [] diff --git a/test/init.fnl b/test/init.fnl index 5d81964..f0267c1 100644 --- a/test/init.fnl +++ b/test/init.fnl @@ -1,6 +1,9 @@ (local faith (require :faith)) (local fennel (require :fennel)) +(set debug.getinfo (or fennel.getinfo debug.getinfo)) +(set debug.traceback (or fennel.traceback debug.traceback)) + (case (os.getenv "FAITH_TEST") target (let [(module function) (target:match "([^ ]+) ([^ ]+)")] (tset package.loaded module {function (. (require module) function)})