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