From b217a7f2367154c7bdc4f7e42fb86fdb06191090 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 22 May 2018 10:52:19 +0200 Subject: [PATCH] [pug] Use pug grammar & rename language id. Fixes #50086 --- build/gulpfile.vscode.js | 2 +- build/npm/update-grammar.js | 2 +- extensions/markdown-basics/package.json | 2 +- .../syntaxes/markdown.tmLanguage.json | 8 +- extensions/pug/OSSREADME.json | 23 +- extensions/pug/package.json | 8 +- extensions/pug/syntaxes/pug.tmLanguage.json | 846 +++++++++--------- .../test/colorize-results/test-4287_pug.json | 8 +- .../pug/test/colorize-results/test_pug.json | 410 ++++----- .../theme-defaults/themes/light_vs.json | 6 +- .../theme-seti/icons/vs-seti-icon-theme.json | 2 +- src/vs/editor/standalone/common/themes.ts | 12 +- 12 files changed, 656 insertions(+), 673 deletions(-) diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 67c8fe08858..c53b798fed7 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -141,7 +141,7 @@ const config = { name: product.nameLong + ' document', role: 'Editor', ostypes: ["TEXT", "utxt", "TUTX", "****"], - extensions: ["ascx", "asp", "aspx", "bash", "bash_login", "bash_logout", "bash_profile", "bashrc", "bat", "bowerrc", "c", "cc", "clj", "cljs", "cljx", "clojure", "cmd", "code-workspace", "coffee", "config", "cpp", "cs", "cshtml", "csproj", "css", "csx", "ctp", "cxx", "dockerfile", "dot", "dtd", "editorconfig", "edn", "eyaml", "eyml", "fs", "fsi", "fsscript", "fsx", "gemspec", "gitattributes", "gitconfig", "gitignore", "go", "h", "handlebars", "hbs", "hh", "hpp", "htm", "html", "hxx", "ini", "jade", "jav", "java", "js", "jscsrc", "jshintrc", "jshtm", "json", "jsp", "less", "lua", "m", "makefile", "markdown", "md", "mdoc", "mdown", "mdtext", "mdtxt", "mdwn", "mkd", "mkdn", "ml", "mli", "php", "phtml", "pl", "pl6", "pm", "pm6", "pod", "pp", "profile", "properties", "ps1", "psd1", "psgi", "psm1", "py", "r", "rb", "rhistory", "rprofile", "rs", "rt", "scss", "sh", "shtml", "sql", "svg", "svgz", "t", "ts", "txt", "vb", "wxi", "wxl", "wxs", "xaml", "xcodeproj", "xcworkspace", "xml", "yaml", "yml", "zlogin", "zlogout", "zprofile", "zsh", "zshenv", "zshrc"], + extensions: ["ascx", "asp", "aspx", "bash", "bash_login", "bash_logout", "bash_profile", "bashrc", "bat", "bowerrc", "c", "cc", "clj", "cljs", "cljx", "clojure", "cmd", "code-workspace", "coffee", "config", "cpp", "cs", "cshtml", "csproj", "css", "csx", "ctp", "cxx", "dockerfile", "dot", "dtd", "editorconfig", "edn", "eyaml", "eyml", "fs", "fsi", "fsscript", "fsx", "gemspec", "gitattributes", "gitconfig", "gitignore", "go", "h", "handlebars", "hbs", "hh", "hpp", "htm", "html", "hxx", "ini", "jade", "jav", "java", "js", "jscsrc", "jshintrc", "jshtm", "json", "jsp", "less", "lua", "m", "makefile", "markdown", "md", "mdoc", "mdown", "mdtext", "mdtxt", "mdwn", "mkd", "mkdn", "ml", "mli", "php", "phtml", "pl", "pl6", "pm", "pm6", "pod", "pp", "profile", "properties", "ps1", "psd1", "psgi", "psm1", "pug", "py", "r", "rb", "rhistory", "rprofile", "rs", "rt", "scss", "sh", "shtml", "sql", "svg", "svgz", "t", "ts", "txt", "vb", "wxi", "wxl", "wxs", "xaml", "xcodeproj", "xcworkspace", "xml", "yaml", "yml", "zlogin", "zlogout", "zprofile", "zsh", "zshenv", "zshrc"], iconFile: 'resources/darwin/code_file.icns' }], darwinBundleURLTypes: [{ diff --git a/build/npm/update-grammar.js b/build/npm/update-grammar.js index 822de7c59c2..988b7bc3795 100644 --- a/build/npm/update-grammar.js +++ b/build/npm/update-grammar.js @@ -83,7 +83,7 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'mas grammar = plist.parse(content); } else if (ext === '.cson') { grammar = cson.parse(content); - } else if (ext === '.json') { + } else if (ext === '.json' || ext === '.JSON-tmLanguage') { grammar = JSON.parse(content); } else { return Promise.reject(new Error('Unknown file extension: ' + ext)); diff --git a/extensions/markdown-basics/package.json b/extensions/markdown-basics/package.json index 8583ba0c8bc..a07bb0378ae 100644 --- a/extensions/markdown-basics/package.json +++ b/extensions/markdown-basics/package.json @@ -57,7 +57,7 @@ "meta.embedded.block.dockerfile": "dockerfile", "meta.embedded.block.go": "go", "meta.embedded.block.groovy": "groovy", - "meta.embedded.block.jade": "jade", + "meta.embedded.block.pug": "pug", "meta.embedded.block.javascript": "javascript", "meta.embedded.block.json": "json", "meta.embedded.block.less": "less", diff --git a/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json b/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json index 091e4378a90..52b3dcd3ca9 100644 --- a/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json +++ b/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json @@ -109,7 +109,7 @@ "include": "#fenced_code_block_groovy" }, { - "include": "#fenced_code_block_jade" + "include": "#fenced_code_block_pug" }, { "include": "#fenced_code_block_js" @@ -1058,7 +1058,7 @@ } ] }, - "fenced_code_block_jade": { + "fenced_code_block_pug": { "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(jade|pug)(\\s+[^`~]*)?$)", "name": "markup.fenced_code.block.markdown", "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", @@ -1082,10 +1082,10 @@ { "begin": "(^|\\G)(\\s*)(.*)", "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", - "contentName": "meta.embedded.block.jade", + "contentName": "meta.embedded.block.pug", "patterns": [ { - "include": "text.jade" + "include": "text.pug" } ] } diff --git a/extensions/pug/OSSREADME.json b/extensions/pug/OSSREADME.json index 35a98417d24..37b45142cc0 100644 --- a/extensions/pug/OSSREADME.json +++ b/extensions/pug/OSSREADME.json @@ -1,25 +1,8 @@ // ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS: [{ - "name": "davidrios/jade-tmbundle", + "name": "davidrios/pug-tmbundle", "version": "0.0.0", "license": "MIT", - "repositoryURL": "https://github.com/davidrios/jade-tmbundle", - "description": "The file syntaxes/Jade.json was derived from Jade.tmLanguage in https://github.com/davidrios/jade-tmbundle.", - "licenseDetail": [ - "The MIT License (MIT)", - "", - "Copyright (c) 2014 David Rios", - "", - "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated ", - "documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to ", - "use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to ", - "whom the Software is furnished to do so, subject to the following conditions:", - "", - "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.", - "", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ", - "OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE ", - "LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ", - "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE" - ] + "repositoryURL": "https://github.com/davidrios/pug-tmbundle", + "description": "The file syntaxes/pug.tmLanguage.json was derived from Syntaxes/Pug.JSON-tmLanguage in https://github.com/davidrios/pug-tmbundle." }] diff --git a/extensions/pug/package.json b/extensions/pug/package.json index 8c584ed78b4..60d7bf783fb 100644 --- a/extensions/pug/package.json +++ b/extensions/pug/package.json @@ -6,18 +6,18 @@ "publisher": "vscode", "engines": { "vscode": "*" }, "scripts": { - "update-grammar": "node ../../build/npm/update-grammar.js davidrios/jade-tmbundle Syntaxes/Jade.tmLanguage ./syntaxes/pug.tmLanguage.json" + "update-grammar": "node ../../build/npm/update-grammar.js davidrios/pug-tmbundle Syntaxes/Pug.JSON-tmLanguage ./syntaxes/pug.tmLanguage.json" }, "contributes": { "languages": [{ - "id": "jade", + "id": "pug", "extensions": [ ".jade", ".pug" ], "aliases": [ "Pug", "Jade", "jade" ], "configuration": "./language-configuration.json" }], "grammars": [{ - "language": "jade", - "scopeName": "text.jade", + "language": "pug", + "scopeName": "text.pug", "path": "./syntaxes/pug.tmLanguage.json" }] } diff --git a/extensions/pug/syntaxes/pug.tmLanguage.json b/extensions/pug/syntaxes/pug.tmLanguage.json index cff09cd9a37..108fc1ed1c6 100644 --- a/extensions/pug/syntaxes/pug.tmLanguage.json +++ b/extensions/pug/syntaxes/pug.tmLanguage.json @@ -1,58 +1,58 @@ { "information_for_contributors": [ - "This file has been converted from https://github.com/davidrios/jade-tmbundle/blob/master/Syntaxes/Jade.tmLanguage", + "This file has been converted from https://github.com/davidrios/pug-tmbundle/blob/master/Syntaxes/Pug.JSON-tmLanguage", "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/davidrios/jade-tmbundle/commit/f311a516bb29296fcebfdc7da8149b1c79dfb0a1", - "name": "Jade", - "scopeName": "text.jade", + "version": "https://github.com/davidrios/pug-tmbundle/commit/e67e895f6fb64932aa122e471000fa55d826bff6", + "name": "Pug", + "scopeName": "text.pug", "patterns": [ { - "comment": "Doctype declaration.", "match": "^(!!!|doctype)(\\s*[a-zA-Z0-9-_]+)?", - "name": "meta.tag.sgml.doctype.html" + "name": "meta.tag.sgml.doctype.html", + "comment": "Doctype declaration." }, { "begin": "^(\\s*)//-", - "comment": "Unbuffered (jade-only) comments.", "end": "^(?!(\\1\\s)|\\s*$)", - "name": "comment.unbuffered.block.jade" + "name": "comment.unbuffered.block.pug", + "comment": "Unbuffered (pug-only) comments." }, { "begin": "^(\\s*)//", - "comment": "Buffered (html) comments.", "end": "^(?!(\\1\\s)|\\s*$)", - "name": "string.comment.buffered.block.jade", + "name": "string.comment.buffered.block.pug", + "comment": "Buffered (html) comments.", "patterns": [ { "captures": { "1": { - "name": "invalid.illegal.comment.comment.block.jade" + "name": "invalid.illegal.comment.comment.block.pug" } }, - "comment": "Buffered comments inside buffered comments will generate invalid html.", "match": "^\\s*(//)(?!-)", - "name": "string.comment.buffered.block.jade" + "name": "string.comment.buffered.block.pug", + "comment": "Buffered comments inside buffered comments will generate invalid html." } ] }, { "begin": "