From 09ee95b9868c12a18de1b26113e1ad48cf1812f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Szabo?= Date: Thu, 21 Sep 2023 18:07:33 -0300 Subject: [PATCH] Fixed injection issue --- packages/language-clojure/lib/main.js | 6 +++--- packages/language-clojure/spec/fixtures/tokens.clj | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/language-clojure/lib/main.js b/packages/language-clojure/lib/main.js index e94e45f674..318f4ab45a 100644 --- a/packages/language-clojure/lib/main.js +++ b/packages/language-clojure/lib/main.js @@ -37,9 +37,9 @@ exports.activate = function() { const checkFormCall = (specialFormText, node) => { let parent = node.parent let grandparent = parent?.parent - return grandparent && - grandparent.children[2].id === parent.id && - grandparent.children[1].text === specialFormText + return grandparent?.type === 'list_lit' && + grandparent.children[1].text === specialFormText && + grandparent.children[2].id === parent.id } atom.grammars.addInjectionPoint('source.clojure', { diff --git a/packages/language-clojure/spec/fixtures/tokens.clj b/packages/language-clojure/spec/fixtures/tokens.clj index 1e2ff8f992..515ca59858 100644 --- a/packages/language-clojure/spec/fixtures/tokens.clj +++ b/packages/language-clojure/spec/fixtures/tokens.clj @@ -179,6 +179,10 @@ error/ ; ^ !keyword.control.conditional.cond ;; Specific stuff +[js* "console.log('abc');", "'foo'"] +; ^ !keyword.control.js.clojure +; ^ !support.class.builtin.console.js + (js* "console.log('abc');", "'foo'") ; ^ keyword.control.js.clojure ; ^ support.class.builtin.console.js