From 8bc42af7c85378670d05cd1841e5fc029313a76e Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Wed, 9 Dec 2015 11:07:17 -0800 Subject: [PATCH] JavaScript: Enable ES6 by Default - This tiny commit enables ES6 support for JavaScript files by default, ensuring that VS Code supports popular JavaScript frameworks and modules out of the box. - Tests pass, behaviour otherwise unchanged. Closes #318 --- src/vs/editor/browser/standalone/standaloneSchemas.ts | 2 +- src/vs/languages/typescript/common/project/projectService.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/browser/standalone/standaloneSchemas.ts b/src/vs/editor/browser/standalone/standaloneSchemas.ts index f4e85fa5d34..a6a47ac159d 100644 --- a/src/vs/editor/browser/standalone/standaloneSchemas.ts +++ b/src/vs/editor/browser/standalone/standaloneSchemas.ts @@ -1015,7 +1015,7 @@ MonacoEditorSchemas['http://json.schemastore.org/tsconfig'] = { MonacoEditorSchemas['http://opentools.azurewebsites.net/jsconfig'] = { 'title': nls.localize('jsconfig.json.title', "JSON schema for the JavaScript configuration file"), 'type': 'object', - 'default': { 'compilerOptions': { 'target': 'ES5' } }, + 'default': { 'compilerOptions': { 'target': 'ES6' } }, 'properties': { 'compilerOptions': { 'type': 'object', diff --git a/src/vs/languages/typescript/common/project/projectService.ts b/src/vs/languages/typescript/common/project/projectService.ts index d98593d8b66..4c9e3443e9e 100644 --- a/src/vs/languages/typescript/common/project/projectService.ts +++ b/src/vs/languages/typescript/common/project/projectService.ts @@ -113,6 +113,7 @@ export class LanguageServiceHost implements ts.LanguageServiceHost { this._compilerOptions = options || ts.getDefaultCompilerOptions(); this._compilerOptions.allowNonTsExtensions = true; // because of JS* and mirror model we need this this._compilerOptions.module = ts.ModuleKind.CommonJS; // because of JS* + this._compilerOptions.target = options && options.target !== undefined ? options.target : ts.ScriptTarget.Latest; // because of JS* } getCompilationSettings(): ts.CompilerOptions { -- GitLab