mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 07:00:11 +01:00
Merge pull request #2775 from microsoft/ts_faff
Expose full ts object to global ts
This commit is contained in:
commit
df3ee0f9d7
4 changed files with 7 additions and 1 deletions
|
|
@ -134,6 +134,7 @@ export var IndentStyle = ts.IndentStyle;
|
|||
export var ScriptKind = ts.ScriptKind;
|
||||
export var ScriptTarget = ts.ScriptTarget;
|
||||
export var TokenClass = ts.TokenClass;
|
||||
export var typescript = ts;
|
||||
// END MONACOCHANGE
|
||||
`;
|
||||
fs.writeFileSync(
|
||||
|
|
|
|||
|
|
@ -160240,4 +160240,5 @@ export var IndentStyle = ts.IndentStyle;
|
|||
export var ScriptKind = ts.ScriptKind;
|
||||
export var ScriptTarget = ts.ScriptTarget;
|
||||
export var TokenClass = ts.TokenClass;
|
||||
export var typescript = ts;
|
||||
// END MONACOCHANGE
|
||||
|
|
|
|||
|
|
@ -496,4 +496,5 @@ export function create(ctx: worker.IWorkerContext, createData: ICreateData): Typ
|
|||
}
|
||||
|
||||
/** Allows for clients to have access to the same version of TypeScript that the worker uses */
|
||||
globalThis.ts = ts;
|
||||
// @ts-ignore
|
||||
globalThis.ts = ts.typescript;
|
||||
|
|
|
|||
|
|
@ -172,6 +172,9 @@ describe(`Smoke Test '${TESTS_TYPE}'`, () => {
|
|||
|
||||
// check that the TypeScript worker exposes `ts` as a global
|
||||
assert.strictEqual(await tsWorker.evaluate(`typeof ts`), 'object');
|
||||
|
||||
// check that the TypeScript worker exposes the full `ts` as a global
|
||||
assert.strictEqual(await tsWorker.evaluate(`typeof ts.optionDeclarations`), 'object');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue