mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-08-16 14:40:23 +03:00
Fixed Javascript injections for Clojure
This commit is contained in:
parent
10c6eb0b0c
commit
bd5d1f69ae
@ -34,20 +34,17 @@ exports.activate = function() {
|
||||
coverShallowerScopes: true
|
||||
});
|
||||
|
||||
const checkFormCall = (specialFormText, node) => {
|
||||
let parent = node.parent
|
||||
let grandparent = parent?.parent
|
||||
return grandparent?.type === 'list_lit' &&
|
||||
grandparent.children[1].text === specialFormText &&
|
||||
grandparent.children[2].id === parent.id
|
||||
}
|
||||
|
||||
atom.grammars.addInjectionPoint('source.clojure', {
|
||||
type: 'str_content',
|
||||
language: (node) => checkFormCall('js*', node) && 'javascript',
|
||||
content: notDisChild,
|
||||
includeChildren: true,
|
||||
languageScope: 'source.js',
|
||||
coverShallowerScopes: true
|
||||
type: 'list_lit',
|
||||
language(node) {
|
||||
if(node.children[1].text === 'js*') {
|
||||
return 'javascript'
|
||||
}
|
||||
},
|
||||
content(node) {
|
||||
if(node.children[2].type === 'str_lit') {
|
||||
return node.children[2].children[1];
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user