[java] Javadoc Syntax highlighting. Fixes #15527
This commit is contained in:
parent
ebb58dc7e6
commit
fd8067bbec
|
@ -19,4 +19,24 @@
|
|||
"to the base-name name of the original file, and an extension of txt, html, or similar. For example",
|
||||
"\"tidy\" is accompanied by \"tidy-license.txt\"."
|
||||
]
|
||||
},{
|
||||
"name": "textmate/javadoc.tmbundle",
|
||||
"version": "0.0.0",
|
||||
"license": "TextMate Bundle License",
|
||||
"repositoryURL": "https://github.com/textmate/javadoc.tmbundle",
|
||||
"licenseDetail": [
|
||||
"Copyright (c) textmate-javadoc.tmbundle project authors",
|
||||
"",
|
||||
"If not otherwise specified (see below), files in this repository fall under the following license:",
|
||||
"",
|
||||
"Permission to copy, use, modify, sell and distribute this",
|
||||
"software is granted. This software is provided \"as is\" without",
|
||||
"express or implied warranty, and with no claim as to its",
|
||||
"suitability for any purpose.",
|
||||
"",
|
||||
"An exception is made for files in readable text which contain their own license information,",
|
||||
"or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added",
|
||||
"to the base-name name of the original file, and an extension of txt, html, or similar. For example",
|
||||
"\"tidy\" is accompanied by \"tidy-license.txt\"."
|
||||
]
|
||||
}]
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"publisher": "vscode",
|
||||
"engines": { "vscode": "*" },
|
||||
"scripts": {
|
||||
"update-grammar": "node ../../build/npm/update-grammar.js textmate/java.tmbundle Syntaxes/Java.plist ./syntaxes/java.json"
|
||||
"update-grammar": "node ../../build/npm/update-grammar.js textmate/java.tmbundle Syntaxes/Java.plist ./syntaxes/java.tmLanguage.json && node ../../build/npm/update-grammar.js textmate/javadoc.tmbundle Syntaxes/JavaDoc.tmLanguage ./syntaxes/javadoc.tmLanguage.json"
|
||||
},
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
|
@ -16,7 +16,10 @@
|
|||
"grammars": [{
|
||||
"language": "java",
|
||||
"scopeName": "source.java",
|
||||
"path": "./syntaxes/java.json"
|
||||
"path": "./syntaxes/java.tmLanguage.json"
|
||||
},{
|
||||
"scopeName": "text.html.javadoc",
|
||||
"path": "./syntaxes/javadoc.tmLanguage.json"
|
||||
}]
|
||||
}
|
||||
}
|
432
extensions/java/syntaxes/javadoc.tmLanguage.json
Normal file
432
extensions/java/syntaxes/javadoc.tmLanguage.json
Normal file
|
@ -0,0 +1,432 @@
|
|||
{
|
||||
"fileTypes": [],
|
||||
"name": "JavaDoc",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(/\\*\\*)\\s*$",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.comment.begin.javadoc"
|
||||
}
|
||||
},
|
||||
"contentName": "text.html",
|
||||
"end": "\\*/",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.end.javadoc"
|
||||
}
|
||||
},
|
||||
"name": "comment.block.documentation.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)param)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.param.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.param.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)return)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.return.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.return.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)throws)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.throws.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.throws.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)exception)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.exception.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.exception.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)author)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.author.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.author.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)version)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.version.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.version.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)see)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.see.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.see.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)since)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.since.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.since.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)serial)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.serial.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.serial.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)serialField)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.serialField.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.serialField.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)serialData)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.serialData.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.serialData.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "((\\@)deprecated)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.deprecated.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"end": "(?=^\\s*\\*?\\s*@|\\*/)",
|
||||
"name": "meta.documentation.tag.deprecated.javadoc",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.other.documentation.custom.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"match": "((\\@)\\S+)\\s"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"inline": {
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#inline-formatting"
|
||||
},
|
||||
{
|
||||
"comment": "This prevents < characters in commented source from starting\n\t\t\t\t\t\t\t\ta tag that will not end. List of allowed tags taken from\n\t\t\t\t\t\t\t\tjava checkstyle.",
|
||||
"match": "<(?!(a|abbr|acronym|address|area|b|bdo|big|blockquote|br|caption|cite|code|colgroup|dd|del|div|dfn|dl|dt|em|fieldset|font|h1toh6|hr|i|img|ins|kbd|li|ol|p|pre|q|samp|small|span|strong|sub|sup|table|tbody|td|tfoot|th|thread|tr|tt|u|ul)\\b[^>]*>)"
|
||||
},
|
||||
{
|
||||
"include": "text.html.basic"
|
||||
},
|
||||
{
|
||||
"match": "((https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt)://|mailto:)[-:@a-zA-Z0-9_.,~%+/?=&#;]+(?<![-.,?:#;])",
|
||||
"name": "markup.underline.link"
|
||||
}
|
||||
]
|
||||
},
|
||||
"inline-formatting": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(\\{)((\\@)code)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.begin.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.other.documentation.directive.code.javadoc"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"contentName": "markup.raw.code.javadoc",
|
||||
"end": "\\}",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.tag.end.javadoc"
|
||||
}
|
||||
},
|
||||
"name": "meta.tag.template.code.javadoc",
|
||||
"patterns": []
|
||||
},
|
||||
{
|
||||
"begin": "(\\{)((\\@)literal)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.begin.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.other.documentation.directive.literal.javadoc"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
}
|
||||
},
|
||||
"contentName": "markup.raw.literal.javadoc",
|
||||
"end": "\\}",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.tag.end.javadoc"
|
||||
}
|
||||
},
|
||||
"name": "meta.tag.template.literal.javadoc",
|
||||
"patterns": []
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.begin.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.other.documentation.directive.docRoot.javadoc"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
},
|
||||
"4": {
|
||||
"name": "punctuation.definition.tag.end.javadoc"
|
||||
}
|
||||
},
|
||||
"match": "(\\{)((\\@)docRoot)(\\})",
|
||||
"name": "meta.tag.template.docRoot.javadoc"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.begin.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.other.documentation.directive.inheritDoc.javadoc"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
},
|
||||
"4": {
|
||||
"name": "punctuation.definition.tag.end.javadoc"
|
||||
}
|
||||
},
|
||||
"match": "(\\{)((\\@)inheritDoc)(\\})",
|
||||
"name": "meta.tag.template.inheritDoc.javadoc"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.begin.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.other.documentation.directive.link.javadoc"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
},
|
||||
"4": {
|
||||
"name": "markup.underline.link.javadoc"
|
||||
},
|
||||
"5": {
|
||||
"name": "string.other.link.title.javadoc"
|
||||
},
|
||||
"6": {
|
||||
"name": "punctuation.definition.tag.end.javadoc"
|
||||
}
|
||||
},
|
||||
"match": "(\\{)((\\@)link)(?:\\s+(\\S+?))?(?:\\s+(.+?))?\\s*(\\})",
|
||||
"name": "meta.tag.template.link.javadoc"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.begin.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.other.documentation.directive.linkplain.javadoc"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
},
|
||||
"4": {
|
||||
"name": "markup.underline.linkplain.javadoc"
|
||||
},
|
||||
"5": {
|
||||
"name": "string.other.link.title.javadoc"
|
||||
},
|
||||
"6": {
|
||||
"name": "punctuation.definition.tag.end.javadoc"
|
||||
}
|
||||
},
|
||||
"match": "(\\{)((\\@)linkplain)(?:\\s+(\\S+?))?(?:\\s+(.+?))?\\s*(\\})",
|
||||
"name": "meta.tag.template.linkplain.javadoc"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.tag.begin.javadoc"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.other.documentation.directive.value.javadoc"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.definition.keyword.javadoc"
|
||||
},
|
||||
"4": {
|
||||
"name": "variable.other.javadoc"
|
||||
},
|
||||
"5": {
|
||||
"name": "punctuation.definition.tag.end.javadoc"
|
||||
}
|
||||
},
|
||||
"match": "(\\{)((\\@)value)\\s*(\\S+?)?\\s*(\\})",
|
||||
"name": "meta.tag.template.value.javadoc"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scopeName": "text.html.javadoc",
|
||||
"uuid": "64BB98A4-59D4-474E-9091-C1E1D04BDD03",
|
||||
"version": "https://github.com/textmate/javadoc.tmbundle/commit/5276d7a93f0cf53b7d425c39c6968b09ea9f2d40"
|
||||
}
|
|
@ -440,8 +440,8 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"c": "/*",
|
||||
"t": "block.body.class.comment.definition.java.meta.punctuation",
|
||||
"c": "/**",
|
||||
"t": "begin.block.body.class.comment.definition.documentation.java.javadoc.meta.punctuation",
|
||||
"r": {
|
||||
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.comment rgb(96, 139, 78)",
|
||||
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.comment rgb(0, 128, 0)",
|
||||
|
@ -451,8 +451,8 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"c": "*",
|
||||
"t": "block.body.class.comment.java.meta",
|
||||
"c": "\t * ",
|
||||
"t": "block.body.class.comment.documentation.html.java.javadoc.meta.text",
|
||||
"r": {
|
||||
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.comment rgb(96, 139, 78)",
|
||||
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.comment rgb(0, 128, 0)",
|
||||
|
@ -462,8 +462,30 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"c": "\t * @param args",
|
||||
"t": "block.body.class.comment.java.meta",
|
||||
"c": "@",
|
||||
"t": "block.body.class.comment.definition.documentation.html.java.javadoc.keyword.meta.other.param.punctuation.tag.text",
|
||||
"r": {
|
||||
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.punctuation.definition.tag rgb(128, 128, 128)",
|
||||
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.punctuation.definition.tag rgb(128, 0, 0)",
|
||||
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.punctuation.definition.tag rgb(128, 128, 128)",
|
||||
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.punctuation.definition.tag rgb(128, 0, 0)",
|
||||
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.punctuation.definition.tag rgb(128, 128, 128)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "param",
|
||||
"t": "block.body.class.comment.documentation.html.java.javadoc.keyword.meta.other.param.tag.text",
|
||||
"r": {
|
||||
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword rgb(86, 156, 214)",
|
||||
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword rgb(0, 0, 255)",
|
||||
"dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword rgb(86, 156, 214)",
|
||||
"light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword rgb(0, 0, 255)",
|
||||
"hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword rgb(86, 156, 214)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " args",
|
||||
"t": "block.body.class.comment.documentation.html.java.javadoc.meta.param.tag.text",
|
||||
"r": {
|
||||
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.comment rgb(96, 139, 78)",
|
||||
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.comment rgb(0, 128, 0)",
|
||||
|
@ -474,7 +496,7 @@
|
|||
},
|
||||
{
|
||||
"c": "\t ",
|
||||
"t": "block.body.class.comment.java.meta",
|
||||
"t": "block.body.class.comment.documentation.html.java.javadoc.meta.param.tag.text",
|
||||
"r": {
|
||||
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.comment rgb(96, 139, 78)",
|
||||
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.comment rgb(0, 128, 0)",
|
||||
|
@ -485,7 +507,7 @@
|
|||
},
|
||||
{
|
||||
"c": "*/",
|
||||
"t": "block.body.class.comment.definition.java.meta.punctuation",
|
||||
"t": "block.body.class.comment.definition.documentation.end.java.javadoc.meta.punctuation",
|
||||
"r": {
|
||||
"dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.comment rgb(96, 139, 78)",
|
||||
"light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.comment rgb(0, 128, 0)",
|
||||
|
|
Loading…
Reference in a new issue