mirror of
https://gitee.com/ssssssss-team/magic-api.git
synced 2026-06-09 18:32:16 +08:00
增加注释中的TODO、FIXME高亮
This commit is contained in:
@@ -18,8 +18,9 @@ export default {
|
||||
{token: 'string.invalid', foreground: '008000', background: 'FFCCCC'},
|
||||
{token: 'string.escape.invalid', foreground: '008000', background: 'FFCCCC'},
|
||||
{token: 'string.escape', foreground: '000080', fontStyle: 'bold'},
|
||||
{token: 'comment', foreground: '808080'},
|
||||
{token: 'comment.doc', foreground: '629755'},
|
||||
{token: 'comment', foreground: '808080', fontStyle: 'italic'},
|
||||
{token: 'comment.doc', foreground: '629755', fontStyle: 'italic'},
|
||||
{token: 'comment.todo', foreground: 'A8C023', fontStyle: 'italic'},
|
||||
{token: 'string.escape', foreground: 'CC7832'}
|
||||
],
|
||||
colors: {
|
||||
|
||||
@@ -17,8 +17,9 @@ export default {
|
||||
{token: 'string.invalid', foreground: '008000', background: 'FFCCCC'},
|
||||
{token: 'string.escape.invalid', foreground: '008000', background: 'FFCCCC'},
|
||||
{token: 'string.escape', foreground: '000080', fontStyle: 'bold'},
|
||||
{token: 'comment', foreground: '808080'},
|
||||
{token: 'comment.doc', foreground: '808080'},
|
||||
{token: 'comment', foreground: '808080', fontStyle: 'italic'},
|
||||
{token: 'comment.doc', foreground: '808080', fontStyle: 'italic'},
|
||||
{token: 'comment.todo', foreground: '008DDE', fontStyle: 'italic'},
|
||||
{token: 'string.escape', foreground: '000080'}
|
||||
],
|
||||
colors: {
|
||||
|
||||
@@ -27,9 +27,8 @@ export const HighLightOptions = {
|
||||
[/::[a-zA-Z]+/, 'keywords'],
|
||||
[/[{}()[\]]/, '@brackets'],
|
||||
[/(@digits)[lLbBsSdDfFmM]?/, 'number'],
|
||||
[/\/\*\*(?!\/)/, 'comment.doc', '@mulcomment'],
|
||||
[/\/\*/, 'comment', '@comment'],
|
||||
[/\/\/.*$/, 'comment'],
|
||||
[/\/\//, 'comment', '@commentTodo'],
|
||||
[
|
||||
/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,
|
||||
{token: 'regexp', bracket: '@open', next: '@regexp'}
|
||||
@@ -42,11 +41,16 @@ export const HighLightOptions = {
|
||||
[/'/, 'string', '@string_single'],
|
||||
],
|
||||
comment: [
|
||||
[/[^/*]+/, 'comment'],
|
||||
// [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-(
|
||||
// [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/
|
||||
[/\*\//, 'comment', '@pop'],
|
||||
[/[/*]/, 'comment']
|
||||
[/((TODO)|(todo)|(fixme)|(FIXME))[ \t]+[^\n(?!\*\/)]+/, 'comment.todo','@comment'],
|
||||
[/[ \t]+/, 'comment','@comment'],
|
||||
[/\*\//, 'comment', '@popall'],
|
||||
[/[^ \t]+(?!((TODO)|(todo)|(fixme)|(FIXME)))/, 'comment','@comment']
|
||||
],
|
||||
commentTodo: [
|
||||
[/((TODO)|(todo)|(fixme)|(FIXME))[ \t]+[^\n]+/, 'comment.todo','@popall'],
|
||||
[/^/,'', '@popall'],
|
||||
[/[^ \t]+(?!((TODO)|(todo)|(fixme)|(FIXME)))/, 'comment', '@commentTodo']
|
||||
|
||||
],
|
||||
regexp: [
|
||||
[
|
||||
@@ -90,13 +94,6 @@ export const HighLightOptions = {
|
||||
}
|
||||
]
|
||||
],
|
||||
mulcomment: [
|
||||
[/[^/*]+/, 'comment.doc'],
|
||||
// [/\/\*/, 'comment.doc', '@push' ], // nested comment not allowed :-(
|
||||
[/\/\*/, 'comment.doc.invalid'],
|
||||
[/\*\//, 'comment.doc', '@pop'],
|
||||
[/[/*]/, 'comment.doc']
|
||||
],
|
||||
string_multi_embedded: [
|
||||
[/[^"]+/, ''],
|
||||
['"""', {token: 'string', next: '@pop', nextEmbedded: '@pop'}]
|
||||
|
||||
Reference in New Issue
Block a user