From dfa42610f7664b6384a69c25daa08e07702a2617 Mon Sep 17 00:00:00 2001 From: XeroOl Date: Wed, 30 Jul 2025 14:54:37 -0500 Subject: [PATCH] fix __pairs on older lua --- src/fennel-ls/compiler.fnl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fennel-ls/compiler.fnl b/src/fennel-ls/compiler.fnl index 90a1f72..bfe141c 100644 --- a/src/fennel-ls/compiler.fnl +++ b/src/fennel-ls/compiler.fnl @@ -17,7 +17,11 @@ identifiers are declared / referenced in which places." (local print print) (local compiler-env (make-compiler-env)) -(local compiler-globals (icollect [k (pairs compiler-env)] k)) +(local compiler-globals + (let [pairs (case (getmetatable compiler-env) + {:__pairs mtpairs} mtpairs + _ pairs)] + (icollect [k (pairs compiler-env)] k))) (set compiler-env._G._FENNEL_LS true) (local nil* (sym :nil))