/ concept-collection / stan-web-ide
Sign in
concept-collection / stan-web-ide
stan-web-ide / src / stan / language.ts
23 lines · 726 BBlameHistoryRaw
1import { monaco } from 'minwebide';
2import { conf, language } from './stanLanguageDef';
4/**
5 * Registers the Stan language (Monarch tokenizer + language configuration)
6 * for .stan files, and maps .sample files to the built-in YAML language.
7 * Called after registerBuiltinLanguages so these claims win.
8 */
9export function registerStanLanguage(): void {
10 monaco.languages.register({
11 id: 'stan',
12 extensions: ['.stan'],
13 aliases: ['Stan', 'stan'],
14 });
15 monaco.languages.setMonarchTokensProvider('stan', language);
16 monaco.languages.setLanguageConfiguration('stan', conf);
18 // .sample files are YAML; extend the built-in yaml language's claim
19 monaco.languages.register({
20 id: 'yaml',
21 extensions: ['.sample'],
22 });
moveopenescclose