Skip to content

Commit

Permalink
Merge pull request #4450 from timotheeguerin/add-typespec-lang
Browse files Browse the repository at this point in the history
Add support for TypeSpec language
  • Loading branch information
hediet authored Apr 23, 2024
2 parents 0037b13 + ed45c2e commit 7073387
Show file tree
Hide file tree
Showing 5 changed files with 726 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/basic-languages/monaco.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import './systemverilog/systemverilog.contribution';
import './tcl/tcl.contribution';
import './twig/twig.contribution';
import './typescript/typescript.contribution';
import './typespec/typespec.contribution';
import './vb/vb.contribution';
import './wgsl/wgsl.contribution';
import './xml/xml.contribution';
Expand Down
24 changes: 24 additions & 0 deletions src/basic-languages/typespec/typespec.contribution.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { registerLanguage } from '../_.contribution';

declare var AMD: any;
declare var require: any;

registerLanguage({
id: 'typespec',
extensions: ['.tsp'],
aliases: ['TypeSpec'],
loader: () => {
if (AMD) {
return new Promise((resolve, reject) => {
require(['vs/basic-languages/typespec/typespec'], resolve, reject);
});
} else {
return import('./typespec');
}
}
});
Loading

0 comments on commit 7073387

Please sign in to comment.