From 51246d82f74162c4779de01409121d6e396836a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Sanz?= Date: Sat, 11 Nov 2023 19:40:32 +0100 Subject: [PATCH] feat: adding astro files support via JSX language syntax (#337) * feat: adding astro files support via JSX language syntax * Update manifest.json * Update plugins/language_jsx.lua Co-authored-by: Guldoman * Update plugins/language_jsx.lua Co-authored-by: Guldoman * Apply suggestions from code review Co-authored-by: Guldoman * Update language_jsx.lua --------- Co-authored-by: Guldoman --- manifest.json | 4 ++-- plugins/language_jsx.lua | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 40f993fe..a228f5cc 100644 --- a/manifest.json +++ b/manifest.json @@ -61,7 +61,7 @@ { "id": "meta_languages", "type": "meta", - "version": "0.1.2", + "version": "0.1.3", "mod_version": "3", "description": "A metapackage containing all publically accessible language syntaxes.", "dependencies": { @@ -867,7 +867,7 @@ }, { "description": "Syntax for the [JSX](https://reactjs.org/docs/introducing-jsx.html) language for the React framework in JavaScript", - "version": "0.1", + "version": "0.2", "path": "plugins/language_jsx.lua", "id": "language_jsx", "mod_version": "3", diff --git a/plugins/language_jsx.lua b/plugins/language_jsx.lua index 04e846b3..941e786c 100644 --- a/plugins/language_jsx.lua +++ b/plugins/language_jsx.lua @@ -4,10 +4,11 @@ local syntax = require "core.syntax" syntax.add { name = "JSX", - files = { "%.jsx$" }, + files = { "%.jsx$", "%.astro$" }, comment = "//", + block_comment = { "/*", "*/" }, patterns = { - { pattern = "//.-\n", type = "comment" }, + { pattern = "//.*", type = "comment" }, { pattern = { "/%*", "%*/" }, type = "comment" }, { pattern = { '"', '"', '\\' }, type = "string" }, { pattern = { "'", "'", '\\' }, type = "string" },