@@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
33import * as monaco from 'monaco-editor' ;
44import noop from 'lodash/noop.js' ;
55
6- import getStyleMetadataLight , { themes as themesLight } from '../../utils/monaco-theme-light .js' ;
7- import getStyleMetadataDark , { themes as themesDark } from '../../utils/monaco-theme-dark .js' ;
6+ import seVsDarkTheme from '../../themes/se-vs-dark .js' ;
7+ import seVsLightTheme from '../../themes/se-vs-light .js' ;
88import { dereference } from '../../utils/monaco-action-apidom-deref.js' ;
99import { requestGetJsonPointerPosition } from '../../utils/monaco-jump-from-path-to-line.js' ;
1010import { useMount , useUpdate , useSmoothResize } from './hooks.js' ;
@@ -90,8 +90,8 @@ const MonacoEditor = ({
9090
9191 // defining the custom themes and setting the active one
9292 useMount ( ( ) => {
93- monaco . editor . defineTheme ( 'my -vs-dark' , themesDark . seVsDark ) ;
94- monaco . editor . defineTheme ( 'my -vs-light' , themesLight . seVsLight ) ;
93+ monaco . editor . defineTheme ( 'se -vs-dark' , seVsDarkTheme ) ;
94+ monaco . editor . defineTheme ( 'se -vs-light' , seVsLightTheme ) ;
9595 } ) ;
9696
9797 // update language
@@ -163,7 +163,7 @@ const MonacoEditor = ({
163163 // then clear the request itself
164164 onClearRequestJumpToMarker ( ) ;
165165 } else {
166- // just clear the request anyways
166+ // just clear the request anyway
167167 onClearRequestJumpToMarker ( ) ;
168168 }
169169 }
@@ -188,35 +188,7 @@ const MonacoEditor = ({
188188
189189 // settings the theme if changed
190190 useEffect ( ( ) => {
191- // START dev demo test unrelated to the setTheme
192- // async function findMarkerPosition() {
193- // const mockPath =
194- // '/channels/smartylighting.streetlights.1.0.event.{streetlightId}.lighting.measured'; // asyncapi
195- // // via apidom-ls
196- // const foundMarkerPosition = await requestGetJsonPointerPosition(editorRef.current, mockPath);
197- // console.log('mock...foundMarkerPosition', foundMarkerPosition);
198- // if (foundMarkerPosition?.data) {
199- // onSetRequestJumpToMarker(foundMarkerPosition.data);
200- // onClearRequestJumpToMarker();
201- // } else {
202- // onClearRequestJumpToMarker();
203- // }
204- // }
205- // if (editorRef?.current?.getModel) {
206- // findMarkerPosition();
207- // }
208- // END dev demo test
209- if ( theme === 'vs-dark' ) {
210- monaco . editor . setTheme ( 'vs-dark' ) ;
211- // eslint-disable-next-line no-underscore-dangle
212- editorRef . current . _themeService . _theme . getTokenStyleMetadata = getStyleMetadataDark ;
213- } else if ( [ 'vs-light' , 'vs' ] . includes ( theme ) ) {
214- monaco . editor . setTheme ( 'vs' ) ;
215- // eslint-disable-next-line no-underscore-dangle
216- editorRef . current . _themeService . _theme . getTokenStyleMetadata = getStyleMetadataLight ;
217- } else {
218- monaco . editor . setTheme ( theme ) ;
219- }
191+ monaco . editor . setTheme ( theme ) ;
220192 } , [ theme ] ) ;
221193
222194 // register listener for validation markers
0 commit comments