From 96e02601e6d640e39cbfa6ccf8a3de355767c9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janis=20Daniel=20Da=CC=88hne?= <janis.daehne@informatik.uni-halle.de> Date: Thu, 27 Jun 2024 11:32:11 +0200 Subject: [PATCH] - fixed issue where editor highlingting was not displayed in some cases (e.g. reset code, tutor views, ...) --- .../codeEditors/aceEditors/aceEditorsStorageHelper.ts | 3 ++- src/constants.ts | 2 +- .../actions/doExerciseSite/doExerciseSiteActions.ts | 6 +++--- .../actions/tutorViewSite/tutorViewSiteActions.ts | 10 +++++----- src/types/pLangs.ts | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/codeEditors/aceEditors/aceEditorsStorageHelper.ts b/src/components/codeEditors/aceEditors/aceEditorsStorageHelper.ts index 9a1382c1..c31ea5f0 100644 --- a/src/components/codeEditors/aceEditors/aceEditorsStorageHelper.ts +++ b/src/components/codeEditors/aceEditors/aceEditorsStorageHelper.ts @@ -201,7 +201,8 @@ export interface AceStoredTabLike { readonly content: string /** - * the programming language + * the programming language name of syntax highlighting in the editor, + * see {@link possibleEditorHighlightPLanguages} * this can not be changed... */ readonly language: string diff --git a/src/constants.ts b/src/constants.ts index 6ca129e0..ebce2fff 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -13,7 +13,7 @@ import Logger from './helpers/logger' * y - breaking changes / new features * z - fixes, small changes */ -export const versionString = '2.19.2' +export const versionString = '2.19.3' export const supportMail = 'yapex@informatik.uni-halle.de' diff --git a/src/state/actions/doExerciseSite/doExerciseSiteActions.ts b/src/state/actions/doExerciseSite/doExerciseSiteActions.ts index e18e394b..bd7a21ea 100644 --- a/src/state/actions/doExerciseSite/doExerciseSiteActions.ts +++ b/src/state/actions/doExerciseSite/doExerciseSiteActions.ts @@ -184,7 +184,7 @@ export function resetDoExerciseSolutionToTemplate(releaseCode: string, currentPL return { id: p.id, content: p.content, - language: pLang.internalName + language: pLang.editorHighlightModeName } }) AceEditorsStorageHelper.addEditorWithTabs(doEditorEditorPanelViewEditorId, storedTabs) @@ -503,7 +503,7 @@ export function loadDoExerciseSite(releaseCode: string): AwaitActions { return { id: p.id, content: p.content, - language: plang.internalName + language: plang.editorHighlightModeName } }) @@ -550,7 +550,7 @@ export function loadDoExerciseSite(releaseCode: string): AwaitActions { return { id: p.id, content: p.content, - language: plang.internalName + language: plang.editorHighlightModeName } }) diff --git a/src/state/actions/tutorViewSite/tutorViewSiteActions.ts b/src/state/actions/tutorViewSite/tutorViewSiteActions.ts index 8820ca12..3e118b60 100644 --- a/src/state/actions/tutorViewSite/tutorViewSiteActions.ts +++ b/src/state/actions/tutorViewSite/tutorViewSiteActions.ts @@ -141,7 +141,7 @@ export function resetTutorEditorToUserSolution(userSolution: SolutionDoExerciseF return { id: p.id, content: p.content, - language: pLang.internalName + language: pLang.editorHighlightModeName } }) AceEditorsStorageHelper.removeEditor(tutorViewEditorPanelViewEditorId) @@ -368,7 +368,7 @@ function _loadTutorViewData(releaseId: number, userId: number, pLangId: number): return { id: p.id, content: p.content, - language: plang.internalName + language: plang.editorHighlightModeName } }) @@ -389,7 +389,7 @@ function _loadTutorViewData(releaseId: number, userId: number, pLangId: number): return { id: p.id, content: p.content, - language: plang.internalName + language: plang.editorHighlightModeName } }) @@ -414,7 +414,7 @@ function _loadTutorViewData(releaseId: number, userId: number, pLangId: number): return { id: p.id, content: p.content, - language: plang.internalName + language: plang.editorHighlightModeName } }) @@ -465,7 +465,7 @@ function _loadTutorViewData(releaseId: number, userId: number, pLangId: number): return { id: p.id, content: p.content, - language: plang.internalName + language: plang.editorHighlightModeName } }) diff --git a/src/types/pLangs.ts b/src/types/pLangs.ts index e5738a15..533cfc60 100644 --- a/src/types/pLangs.ts +++ b/src/types/pLangs.ts @@ -25,10 +25,10 @@ export interface PLangFullBase { readonly fileExtensionsWithDot: string | null /** * the highlight mode for the editor (currently ace) - * @see possibleEditorHighlightPLanguages for all possible langs + * {@link possibleMarkdownHighlightPLanguages} for all possible langs * * for markdown - * @see possibleMarkdownHighlightPLanguages but this is not needed because from the ```[lang] we directly dynamic import the lang + * {@link possibleMarkdownHighlightPLanguages} but this is not needed because from the ```[lang] we directly dynamic import the lang */ readonly editorHighlightModeName: string | null -- GitLab