From 95843ea12d0abf3e7726735489458e5903b86e7e Mon Sep 17 00:00:00 2001 From: arookieofc Date: Mon, 9 Nov 2026 09:23:17 +0800 Subject: [PATCH] fix(vue): highlight SCSS in ``; + const tree = support!.language.parser.parse(src).toString(); + // SCSS-only syntax that plain CSS can't parse: a nested rule and a $-variable. + expect(tree).toContain("SassVariableName"); + // The nested .b ruleset only parses under the Sass grammar. + expect(tree).toMatch(/RuleSet\(ClassSelector.*RuleSet\(ClassSelector/s); + }); + + it("still parses a plain `) + .toString(); + expect(tree).toContain("StyleSheet"); + expect(tree).toContain("Declaration"); + expect(tree).not.toContain("SassVariableName"); + }); +}); diff --git a/src/editor/core/cm/vue.ts b/src/editor/core/cm/vue.ts new file mode 100644 index 000000000..21d50c1f2 --- /dev/null +++ b/src/editor/core/cm/vue.ts @@ -0,0 +1,27 @@ +/** + * Vue single-file components: `@codemirror/lang-vue`'s parser over an HTML + * base that also highlights `