|
111 | 111 | "dependencies": { "foldingStopMarker": { "required": [ "foldingStartMarker" ] } }, |
112 | 112 | "defaultSnippets": [ |
113 | 113 | { |
114 | | - "label": "New grammar", |
115 | | - "markdownDescription": "\t{\n\t\t\"scopeName\": \"source.languageId\",\n\t\t\"patterns\": [\n\t\t\t{ }\n\t\t],\n\t\t\"repository\": { }\n\t}", |
| 114 | + "label": "New Grammar", |
| 115 | + "markdownDescription": "\t{\n\t\t\"scopeName\": \"source.languageId\",\n\t\t\"patterns\": [\n\t\t\t{ ... }\n\t\t],\n\t\t\"repository\": { ... }\n\t}\n\n\t/* package.json */\n\t\"grammars\": [\n\t\t{\n\t\t\t\"language\": \"languageId\",\n\t\t\t\"scopeName\": \"source.languageId\",\n\t\t\t\"path\": \"./syntaxes/languageId.tmLanguage.json\",\n\t\t}\n\t]\n", |
116 | 116 | "body": { |
117 | 117 | "$${_///}schema": "https://raw.githubusercontent.com/RedCMD/TmLanguage-Syntax-Highlighter/main/vscode.tmLanguage.schema.json", |
118 | | - "name": "${1:languageId}", |
| 118 | + "name": "${1/([._-]+)|([a-zA-Z]+)/${1:+ }${2:/capitalize}/g}", |
119 | 119 | "scopeName": "source.${1:languageId}", |
120 | 120 | "patterns": [ |
121 | 121 | "^{ \"include\": \"#${2:repo-item}\" }", |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | } |
| 149 | + }, |
| 150 | + { |
| 151 | + "label": "New Markdown Code-Block Injection", |
| 152 | + "markdownDescription": "\t{\n\t\t\"name\": \"Markdown Code-Block Injection languageId\",\n\t\t\"scopeName\": \"markdown.languageId.codeblock\",\n\t\t\"injectionSelector\": \"L:text.html.markdown\",\n\t\t\"patterns\": [\n\t\t\t{ \"include\": \"#fenced_code_block_languageId\" }\n\t\t],\n\t\t\"repository\": {\n\t\t\t\"fenced_code_block_languageId\": { ... }\n\t\t}\n\t}\n\n\t/* package.json */\n\t\"grammars\": [\n\t\t{\n\t\t\t\"scopeName\": \"markdown.languageId.codeblock\",\n\t\t\t\"path\": \"./syntaxes/languageId.tmLanguage.json\",\n\t\t\t\"injectTo\": [\n\t\t\t\t\"text.html.markdown\"\n\t\t\t],\n\t\t\t\"embeddedLanguages\": {\n\t\t\t\t\"meta.embedded.block.languageId\": \"languageId\"\n\t\t\t}\n\t\t}\n\t]", |
| 153 | + "body": { |
| 154 | + "$${_///}schema": "https://raw.githubusercontent.com/RedCMD/TmLanguage-Syntax-Highlighter/main/vscode.tmLanguage.schema.json", |
| 155 | + "comment": "https://github.com/mjbvz/vscode-fenced-code-block-grammar-injection-example/blob/master/syntaxes/codeblock.json", |
| 156 | + "name": "Markdown Code-Block Injection ${1/([._-]+)|([a-zA-Z]+)/${1:+ }${2:/capitalize}/g}$0", |
| 157 | + "scopeName": "markdown.${1:languageId}.codeblock", |
| 158 | + "injectionSelector": "L:text.html.markdown -meta.embedded.block.${1:languageId}", |
| 159 | + "patterns": [ |
| 160 | + "^{ \"include\": \"#fenced_code_block_${1/[. -]/_/g}\" }" |
| 161 | + ], |
| 162 | + "repository": { |
| 163 | + "fenced_code_block_${1/[. -]/_/g}": { |
| 164 | + "begin": "(^|\\\\G)(\\\\s*)(\\\\`{3,}|~{3,})\\\\s*(?i:(${1/([.+])/\\\\$1/g})((\\\\s+|:|,|\\\\{|\\\\?)[^`]*)?$)", |
| 165 | + "name": "markup.fenced_code.block.markdown", |
| 166 | + "end": "(^|\\\\G)(\\\\2|\\\\s{0,3})(\\\\3)\\\\s*$", |
| 167 | + "beginCaptures": { |
| 168 | + "3": "^{ \"name\": \"punctuation.definition.markdown\" }", |
| 169 | + "4": "^{ \"name\": \"fenced_code.block.language.markdown\" }", |
| 170 | + "5": "^{ \"name\": \"fenced_code.block.language.attributes.markdown\" }" |
| 171 | + }, |
| 172 | + "endCaptures": "^{ \"3\": { \"name\": \"punctuation.definition.markdown\" } }", |
| 173 | + "patterns": [ |
| 174 | + { |
| 175 | + "begin": "(^|\\\\G)(\\\\s*)(.*)", |
| 176 | + "while": "(^|\\\\G)(?!\\\\s*([`~]{3,})\\\\s*$)", |
| 177 | + "contentName": "meta.embedded.block.${1:languageId}", |
| 178 | + "patterns": "^[ { \"include\": \"source.${1:languageId}\" } ]" |
| 179 | + } |
| 180 | + ] |
| 181 | + } |
| 182 | + } |
| 183 | + } |
| 184 | + }, |
| 185 | + { |
| 186 | + "label": "New Search Results Injection", |
| 187 | + "markdownDescription": "\t{\n\t\t\"name\": \"Search Results Injection languageId\",\n\t\t\"scopeName\": \"text.searchResult.languageId\",\n\t\t\"injectionSelector\": \"L:text.searchResult\",\n\t\t\"patterns\": [\n\t\t\t{ \"include\": \"#languageId\" }\n\t\t],\n\t\t\"repository\": {\n\t\t\t\"languageId\": { ... }\n\t\t}\n\t}\n\n\t/* package.json */\n\t\"grammars\": [\n\t\t{\n\t\t\t\"scopeName\": \"text.searchResult.languageId\",\n\t\t\t\"path\": \"./syntaxes/languageId.tmLanguage.json\",\n\t\t\t\"injectTo\": [\n\t\t\t\t\"text.searchResult\"\n\t\t\t]\n\t\t}\n\t]", |
| 188 | + "body": { |
| 189 | + "$${_///}schema": "https://raw.githubusercontent.com/RedCMD/TmLanguage-Syntax-Highlighter/main/vscode.tmLanguage.schema.json", |
| 190 | + "comment": "https://github.com/microsoft/vscode/issues/185430", |
| 191 | + "name": "Search Results Injection ${1/([._-]+)|([a-zA-Z]+)/${1:+ }${2:/capitalize}/g}$0", |
| 192 | + "scopeName": "text.searchResult.${1:languageId}", |
| 193 | + "injectionSelector": "L:text.searchResult -meta.resultBlock.search", |
| 194 | + "patterns": [ |
| 195 | + "^{ \"include\": \"#${1/[. -]/_/g}\" }" |
| 196 | + ], |
| 197 | + "repository": { |
| 198 | + "${1/[. -]/_/g}": { |
| 199 | + "name": "meta.resultBlock.search", |
| 200 | + "begin": "${_///}^(?!\\\\s)(.*?)([^\\\\\\\\\\\\/\\\\n]*\\\\.${1/([.+])/\\\\$1/g})(:)$", |
| 201 | + "end": "${_///}^(?!\\\\s)", |
| 202 | + "beginCaptures": { |
| 203 | + "0": "^{ \"name\": \"string meta.path.search\" }", |
| 204 | + "1": "^{ \"name\": \"meta.path.dirname.search\" }", |
| 205 | + "2": "^{ \"name\": \"meta.path.basename.search\" }", |
| 206 | + "3": "^{ \"name\": \"punctuation.separator\" }" |
| 207 | + }, |
| 208 | + "patterns": [ |
| 209 | + { |
| 210 | + "name": "meta.resultLine.search meta.resultLine.multiLine.search", |
| 211 | + "begin": "${_///}^ (?:\\\\s*)((\\\\d+) )", |
| 212 | + "while": "${_///}^ (?:\\\\s*)(?:((\\\\d+)(:))|((\\\\d+) ))", |
| 213 | + "beginCaptures": { |
| 214 | + "0": "^{ \"name\": \"constant.numeric.integer meta.resultLinePrefix.search\" }", |
| 215 | + "1": "^{ \"name\": \"meta.resultLinePrefix.contextLinePrefix.search\" }", |
| 216 | + "2": "^{ \"name\": \"meta.resultLinePrefix.lineNumber.search\" }" |
| 217 | + }, |
| 218 | + "whileCaptures": { |
| 219 | + "0": "^{ \"name\": \"constant.numeric.integer meta.resultLinePrefix.search\" }", |
| 220 | + "1": "^{ \"name\": \"meta.resultLinePrefix.matchLinePrefix.search\" }", |
| 221 | + "2": "^{ \"name\": \"meta.resultLinePrefix.lineNumber.search\" }", |
| 222 | + "3": "^{ \"name\": \"punctuation.separator\" }", |
| 223 | + "4": "^{ \"name\": \"meta.resultLinePrefix.contextLinePrefix.search\" }", |
| 224 | + "5": "^{ \"name\": \"meta.resultLinePrefix.lineNumber.search\" }" |
| 225 | + }, |
| 226 | + "patterns": "^[ { \"include\": \"source.${1:languageId}\" } ]" |
| 227 | + }, |
| 228 | + { |
| 229 | + "begin": "${_///}^ (?:\\\\s*)((\\\\d+)(:))", |
| 230 | + "while": "(?=not)possible", |
| 231 | + "name": "meta.resultLine.search meta.resultLine.singleLine.search", |
| 232 | + "beginCaptures": { |
| 233 | + "0": "^{ \"name\": \"constant.numeric.integer meta.resultLinePrefix.search\" }", |
| 234 | + "1": "^{ \"name\": \"meta.resultLinePrefix.matchLinePrefix.search\" }", |
| 235 | + "2": "^{ \"name\": \"meta.resultLinePrefix.lineNumber.search\" }", |
| 236 | + "3": "^{ \"name\": \"punctuation.separator\" }" |
| 237 | + }, |
| 238 | + "patterns": "^[ { \"include\": \"source.${1:languageId}\" } ]" |
| 239 | + } |
| 240 | + ] |
| 241 | + } |
| 242 | + } |
| 243 | + } |
149 | 244 | } |
150 | 245 | ] |
151 | 246 | }, |
|
0 commit comments