Skip to content

Commit

Permalink
#160 - support template variable highlighting for plaintext
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulKa committed Dec 17, 2024
1 parent 46d5e1a commit 3203ee0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum Language {
JSON = 'json',
XML = 'xml',
HTML = 'html',
TEXT = 'text',
TEXT = 'plaintext',
}

export function InputTabs(props: InputTabsProps) {
Expand Down
1 change: 1 addition & 0 deletions src/renderer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as monaco from 'monaco-editor';
import { RendererEventService } from '@/services/event/renderer-event-service';
import { useRequestStore } from '@/state/requestStore';
import { TrufosRequest } from '../shim/objects/request';
import './lib/monaco/language';

const { initialize } = useRequestStore.getState();
console.info('Initializing renderer process...');
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions src/renderer/lib/monaco/language.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { languages } from 'monaco-editor';

// plaintext
languages.setMonarchTokensProvider('plaintext', {
tokenizer: {
root: [[/\{\{\s*(\$?\w+)\s*}}/, 'variable.other']],
},
});

0 comments on commit 3203ee0

Please sign in to comment.