From 3eb016a369254e58cf92f4bdbf05899e79292745 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Sat, 15 Mar 2025 12:26:15 -0700 Subject: [PATCH] Search for special forms in analyzer. --- src/fennel-ls/analyzer.fnl | 5 +++-- test/lint.fnl | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/fennel-ls/analyzer.fnl b/src/fennel-ls/analyzer.fnl index b84c755..0739e31 100644 --- a/src/fennel-ls/analyzer.fnl +++ b/src/fennel-ls/analyzer.fnl @@ -157,9 +157,10 @@ find the definition `10`, but if `opts.stop-early?` is set, it would find (or (sym? head :fn) (sym? head :lambda) (sym? head :λ)))) - (search-multival server file (. definition (length definition)) stack multival opts) - result result)))))) + result result + _ (case (docs.get-builtin server (tostring (. call 1))) + {:metadata metadata_} {:indeterminate true}))))))) (set search-multival (λ [server file ?ast stack multival opts] diff --git a/test/lint.fnl b/test/lint.fnl index 49058a9..8512e2c 100644 --- a/test/lint.fnl +++ b/test/lint.fnl @@ -111,6 +111,12 @@ field.unknown"} [] [{:code 302}]) + ;; specials are OK too + (check {:unpacker.fnl "(local unpack (or table.unpack _G.unpack)) {: unpack}" + :main.fnl "(local u (require :unpacker)) + (print (u.unpack [:haha :lol]))"} + [] + [{:code 302}]) (check "package.loaded.mymodule io.stderr.write" [] [{:code 302}])