Skip to content

Commit

Permalink
Fixed injection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioszabo committed Sep 21, 2023
1 parent d28f28d commit 09ee95b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/language-clojure/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
4 changes: 4 additions & 0 deletions packages/language-clojure/spec/fixtures/tokens.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 09ee95b

Please sign in to comment.