mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Add TODO and hyperlink injections to YAML comments
This commit is contained in:
parent
e2da555079
commit
70b34cd67a
23
packages/language-yaml/lib/main.js
Normal file
23
packages/language-yaml/lib/main.js
Normal file
@ -0,0 +1,23 @@
|
||||
exports.activate = () => {
|
||||
const HYPERLINK_PATTERN = /\bhttps?:/
|
||||
const TODO_PATTERN = /\b(TODO|FIXME|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|DEBUG|OPTIMIZE|WARNING)\b/;
|
||||
|
||||
atom.grammars.addInjectionPoint('source.yaml', {
|
||||
type: 'comment',
|
||||
language: (node) => {
|
||||
return HYPERLINK_PATTERN.test(node.text) ? 'hyperlink' : undefined;
|
||||
},
|
||||
content: (node) => node,
|
||||
languageScope: null
|
||||
});
|
||||
|
||||
atom.grammars.addInjectionPoint('source.yaml', {
|
||||
type: 'comment',
|
||||
language: (node) => {
|
||||
return TODO_PATTERN.test(node.text) ? 'todo' : undefined;
|
||||
},
|
||||
content: (node) => node,
|
||||
languageScope: null
|
||||
});
|
||||
|
||||
};
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "language-yaml",
|
||||
"version": "0.32.0",
|
||||
"main": "lib/main",
|
||||
"description": "YAML language support in Atom",
|
||||
"engines": {
|
||||
"atom": "*",
|
||||
|
Loading…
Reference in New Issue
Block a user