From f367914244d6d6ebe07f5879f34aebdc0590472d Mon Sep 17 00:00:00 2001 From: XeroOl Date: Sun, 9 Jul 2023 20:35:04 -0500 Subject: [PATCH] shuffle the macro searcher code a little bit ??? --- src/fennel-ls/searcher.fnl | 2 ++ test/goto-definition-test.fnl | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/fennel-ls/searcher.fnl b/src/fennel-ls/searcher.fnl index 8dd9992..62afc17 100644 --- a/src/fennel-ls/searcher.fnl +++ b/src/fennel-ls/searcher.fnl @@ -20,8 +20,10 @@ I suspect this file may be gone after a bit of refactoring." (-> (.. path sep suffix) ;; delete duplicate ;; windows + (: :gsub "%.\\" "") (: :gsub "\\+" "\\") ;; modern society + (: :gsub "%./" "") (: :gsub "/+" "/") (->> (pick-values 1)))) diff --git a/test/goto-definition-test.fnl b/test/goto-definition-test.fnl index bf3830d..c171f88 100644 --- a/test/goto-definition-test.fnl +++ b/test/goto-definition-test.fnl @@ -52,10 +52,10 @@ (check :goto-definition.fnl 35 19 :goto-definition.fnl 34 20 34 35)) (it "can go to a function in another file when accessed by multisym" - (check :goto-definition.fnl 7 7 :./foo.fnl 2 4 2 13)) + (check :goto-definition.fnl 7 7 :foo.fnl 2 4 2 13)) (it "can go to a function in another file imported via destructuring assignment" ;; WORKS, just needs a test case - (check :goto-definition.fnl 2 11 :./baz.fnl 0 4 0 9)) + (check :goto-definition.fnl 2 11 :baz.fnl 0 4 0 9)) (it "goes further if you go to definition on a binding" (check :goto-definition.fnl 31 12 :goto-definition.fnl 23 4 23 5)) @@ -69,7 +69,7 @@ (check :goto-definition.fnl 45 15 :goto-definition.fnl 40 7 40 13)) (it "works directly on a require/include (require XXX))" - (check :goto-definition.fnl 1 5 :./bar.fnl 0 0 0 2)) + (check :goto-definition.fnl 1 5 :bar.fnl 0 0 0 2)) (it "goes to the last form of `do` and `let`" (check :goto-definition.fnl 47 13 :goto-definition.fnl 47 30 47 52))