From 61defc86c453e6c33f3cb342f3f179e9c5d81de3 Mon Sep 17 00:00:00 2001 From: Michele Campeotto Date: Sun, 13 Apr 2025 10:01:57 +0200 Subject: [PATCH] Treat .fnlm files as macro files. Now that .fnlm files are in the macro path we should also treat those as macro files without needing the special comment. --- 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 24b02ac..cef90ee 100644 --- a/src/fennel-ls/compiler.fnl +++ b/src/fennel-ls/compiler.fnl @@ -342,8 +342,12 @@ identifiers are declared / referenced in which places." (fn parse-ast [parser] (icollect [ok ast parser &until (not ok)] ast)) + (fn macro-file? [file] + (or (file.uri:match "%.fnlm$") + (= (file.text:sub 1 24) ";; fennel-ls: macro-file"))) + ;; TODO clean up this code. It's awful now that there is error handling - (let [macro-file? (= (file.text:sub 1 24) ";; fennel-ls: macro-file") + (let [macro-file? (macro-file? file) plugin {:name "fennel-ls" :versions ["1.4.1" "1.4.2" "1.5.0" "1.5.1" "1.5.3" "1.5.4"]