From c14bd001a812e5218dab09d4e9d05585b694c1e6 Mon Sep 17 00:00:00 2001 From: Norber Date: Sat, 5 Mar 2022 19:16:31 +0000 Subject: [PATCH 1/5] Fix "Use 'Programming Languages' instead" warning --- package.json | 139 +++++++++++++++++++++++++-------------------------- 1 file changed, 69 insertions(+), 70 deletions(-) diff --git a/package.json b/package.json index 8446a21..841a90a 100644 --- a/package.json +++ b/package.json @@ -1,73 +1,72 @@ { - "name": "mojolicious", - "displayName": "Mojolicious", - "description": "VS Code support for Mojolicious Template syntax", - "version": "1.9.0", - "publisher": "kraih", - "repository": { - "type": "git", - "url": "https://github.com/kraih/vscode-mojo" - }, - "engines": { - "vscode": "^1.5.0" - }, - "license": "MIT", - "categories": [ - "Languages" - ], - "keywords": [ - "mojolicious", - "perl", - "template" - ], - "icon": "logo.png", - "galleryBanner": { - "color": "#ffffff", - "theme": "light" - }, - "contributes": { - "languages": [ - { - "id": "perl+mojolicious", - "aliases": [ - "Perl (Mojolicious)", - "Perl+Mojolicious" - ], - "extensions": [ - ".ep", - ".epl" - ], - "configuration": "./language-configuration.json" - }, - { - "id": "mojolicious", - "aliases": [ - "Mojolicious", - "ep", - "epl" - ], - "extensions": [ - ".ep", - ".epl", - ".html.ep", - ".html.epl" - ], - "configuration": "./language-configuration.json" - } + "name": "mojolicious", + "displayName": "Mojolicious", + "description": "VS Code support for Mojolicious Template syntax", + "version": "1.9.0", + "publisher": "kraih", + "repository": { + "type": "git", + "url": "https://github.com/kraih/vscode-mojo" + }, + "engines": { + "vscode": "^1.5.0" + }, + "license": "MIT", + "categories": [ + "Programming Languages" + ], + "keywords": [ + "mojolicious", + "perl", + "template" + ], + "icon": "logo.png", + "galleryBanner": { + "color": "#ffffff", + "theme": "light" + }, + "contributes": { + "languages": [ + { + "id": "perl+mojolicious", + "aliases": [ + "Perl (Mojolicious)", + "Perl+Mojolicious" + ], + "extensions": [ + ".ep", + ".epl" ], - "grammars": [ - { - "language": "perl+mojolicious", - "scopeName": "source.perl.mojolicious", - "path": "./syntaxes/Perl+Mojolicious.tmLanguage" - }, - { - "language": "mojolicious", - "scopeName": "text.html.mojolicious", - "path": "./syntaxes/Mojolicious.tmLanguage" - } - ] - }, - "dependencies": { - } + "configuration": "./language-configuration.json" + }, + { + "id": "mojolicious", + "aliases": [ + "Mojolicious", + "ep", + "epl" + ], + "extensions": [ + ".ep", + ".epl", + ".html.ep", + ".html.epl" + ], + "configuration": "./language-configuration.json" + } + ], + "grammars": [ + { + "language": "perl+mojolicious", + "scopeName": "source.perl.mojolicious", + "path": "./syntaxes/Perl+Mojolicious.tmLanguage" + }, + { + "language": "mojolicious", + "scopeName": "text.html.mojolicious", + "path": "./syntaxes/Mojolicious.tmLanguage" + } + ] + }, + "dependencies": {} } From 659862d9e642264d18a6a9fa0a736e5c36dbcf8a Mon Sep 17 00:00:00 2001 From: Norber Date: Sat, 5 Mar 2022 19:17:26 +0000 Subject: [PATCH 2/5] Embed html langauge in templates language --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 841a90a..61df58e 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,10 @@ { "language": "mojolicious", "scopeName": "text.html.mojolicious", - "path": "./syntaxes/Mojolicious.tmLanguage" + "path": "./syntaxes/Mojolicious.tmLanguage", + "embeddedLanguages": { + "text.html.basic": "html" + } } ] }, From 3a802743354c86c990f533db985e712f4a6f59a2 Mon Sep 17 00:00:00 2001 From: Norber Date: Sat, 5 Mar 2022 19:18:44 +0000 Subject: [PATCH 3/5] Adding symbol pairs --- language-configuration.json | 56 +++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/language-configuration.json b/language-configuration.json index b1a6aa8..4c4ac1d 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -1,26 +1,34 @@ { - "comments": { - "lineComment": "#" - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - "autoClosingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"], - ["`", "`"] - ], - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"], - ["`", "`"] - ] + "comments": { + "lineComment": "#" + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"], + ["`", "`"], + ["<", ">"], + ["<%", "%>"], + ["<%=", "%>"], + ["<%==", "%>"] + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"], + ["`", "`"], + ["<", ">"], + ["<%", "%>"], + ["<%=", "%>"], + ["<%==", "%>"] + ] } From 36bf2531336e8a48c2f9eec4fb06806e4745ee07 Mon Sep 17 00:00:00 2001 From: Norber Date: Sat, 5 Mar 2022 19:24:12 +0000 Subject: [PATCH 4/5] Include emmet in templates --- .gitignore | 2 +- .vscode/settings.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 722d5e7..3c3629e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -.vscode +node_modules diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..d84f9b1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "emmet.includeLanguages": { + "mojolicious": "html" + } +} From b8a86e68db16c60df74f3999ffe25dcc3dc450f7 Mon Sep 17 00:00:00 2001 From: Norber Date: Sat, 5 Mar 2022 19:30:48 +0000 Subject: [PATCH 5/5] Fix redundant symbol pairs --- language-configuration.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/language-configuration.json b/language-configuration.json index 4c4ac1d..6b88bc1 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -15,9 +15,7 @@ ["'", "'"], ["`", "`"], ["<", ">"], - ["<%", "%>"], - ["<%=", "%>"], - ["<%==", "%>"] + ["<%", "%>"] ], "surroundingPairs": [ ["{", "}"], @@ -27,8 +25,6 @@ ["'", "'"], ["`", "`"], ["<", ">"], - ["<%", "%>"], - ["<%=", "%>"], - ["<%==", "%>"] + ["<%", "%>"] ] }