This commit is contained in:
Keshav Kumar (MAQ LLC) 2024-06-19 17:32:29 +05:30
Родитель 5ec1313c2d
Коммит c0e743f22b
6 изменённых файлов: 24 добавлений и 12 удалений

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -5,7 +5,6 @@ import { lightPalette } from '../tmdl-utils/tmdl-color-palette';
import { getMonarchTokensDefinition } from "../tmdl-utils/tmdl-token-provider";
import { tmdlKewords, tmdlTypeKewords } from "../tmdl-utils/tmdl-types";
import { TmdlMonacoContributions } from '../tmdl-utils/tmdl.monaco.contributions';
/*import { TMDLSemanticTokensProvider } from "../tmdl-semanticTokenProvider";*/
@Component({
selector: 'app-codeeditor',
@ -31,8 +30,8 @@ export class CodeeditorComponent implements OnChanges {
return;
}
TmdlMonacoContributions.registerLanguageContributions();
TmdlMonacoContributions.registerLanguageContributions();
const sourceDataModel = monaco.editor.createModel(this.comparisonData.SourceObjectDefinition, this.languageName);
const targetDataModel = monaco.editor.createModel(this.comparisonData.TargetObjectDefinition, this.languageName);
@ -64,7 +63,6 @@ export class CodeeditorComponent implements OnChanges {
inherit: true, // If true, this theme inherits from other themes defined before it
...lightPalette,
};
console.log("Check if getting called again");
monaco.editor.defineTheme('tmdlLightTheme', tmdlLightTheme);
// Set the custom theme to the editor

Просмотреть файл

@ -1,3 +1,8 @@
//-----------------------------------------------------------------------
// <copyright company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
export interface TMDLPalette {
rules: { token: string; foreground: string }[];
colors: { [key: string]: string };

Просмотреть файл

@ -1,3 +1,8 @@
//-----------------------------------------------------------------------
// <copyright company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
import { IDisposable, editor } from "monaco-editor";
export class TmdlParserManager implements IDisposable {

Просмотреть файл

@ -1,5 +1,8 @@
//-----------------------------------------------------------------------
// <copyright company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
import { languages } from "monaco-editor";
export interface MonarchTokenizer extends languages.IMonarchLanguage {
@ -23,7 +26,7 @@ export function getMonarchTokensDefinition(tmdlKeywords: string[], tmdlTypeKeywo
ignoreCase: true,
tmdlKeywords: tmdlKeywords,
tmdlTypeKeywords: tmdlTypeKeywords,
tokenizer: {
root: [
{ include: '@expression' }
@ -62,10 +65,6 @@ export function getMonarchTokensDefinition(tmdlKeywords: string[], tmdlTypeKeywo
propertyValue: [
{ include: '@flowNumbers' },
//[
// /\b\d+\b/,
// { token: 'attribute' }
//],
[
/[\w-$()#.,;\\]+\s*/, // Match words followed by optional whitespace
{

Просмотреть файл

@ -1,3 +1,8 @@
//-----------------------------------------------------------------------
// <copyright company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
export const tmdlKewords: string[] = ['true', 'false', 'null'];
export const tmdlTypeKewords: string[] =
["automatic",