From b74758159abf24351dbd2f77f95a0c388db78b76 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Sun, 5 Jul 2026 12:05:16 -0400 Subject: [PATCH] Use appropriate highlighter dialects for ts + jsx. --- src/components/shared/SourceView-codemirror.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/shared/SourceView-codemirror.ts b/src/components/shared/SourceView-codemirror.ts index ea61ab2357..65f8c5dab9 100644 --- a/src/components/shared/SourceView-codemirror.ts +++ b/src/components/shared/SourceView-codemirror.ts @@ -53,14 +53,16 @@ function _languageExtForPath(path: string | null): LanguageSupport | [] { if (path.endsWith('.rs')) { return rust(); } - if ( - path.endsWith('.js') || - path.endsWith('.jsm') || - path.endsWith('.jsx') || - path.endsWith('.mjs') || - path.endsWith('.ts') || - path.endsWith('.tsx') - ) { + if (path.endsWith('.tsx')) { + return javascript({ typescript: true, jsx: true }); + } + if (path.endsWith('.ts')) { + return javascript({ typescript: true }); + } + if (path.endsWith('.jsx')) { + return javascript({ jsx: true }); + } + if (path.endsWith('.js') || path.endsWith('.jsm') || path.endsWith('.mjs')) { return javascript(); } if (