Skip to content

Commit

Permalink
Merge from vscode 6268feb (microsoft#6530)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Dresser authored Jul 30, 2019
1 parent 2c8a22b commit 6db84ee
Show file tree
Hide file tree
Showing 104 changed files with 1,798 additions and 3,741 deletions.
1 change: 1 addition & 0 deletions build/gulpfile.hygiene.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const copyrightFilter = [
'!extensions/markdown-language-features/media/highlight.css',
'!extensions/html-language-features/server/src/modes/typescript/*',
'!extensions/*/server/bin/*',
'!src/vs/editor/test/node/classification/typescript-test.ts',
// {{SQL CARBON EDIT}}
'!extensions/notebook/src/intellisense/text.ts',
'!extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts',
Expand Down
5 changes: 2 additions & 3 deletions build/lib/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function extractEditor(options) {
let compilerOptions;
if (tsConfig.extends) {
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
delete tsConfig.extends;
}
else {
compilerOptions = tsConfig.compilerOptions;
Expand All @@ -40,9 +41,9 @@ function extractEditor(options) {
compilerOptions.noUnusedLocals = false;
compilerOptions.preserveConstEnums = false;
compilerOptions.declaration = false;
compilerOptions.noImplicitAny = false;
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
options.compilerOptions = compilerOptions;
console.log(`Running with shakeLevel ${tss.toStringShakeLevel(options.shakeLevel)}`);
let result = tss.shake(options);
for (let fileName in result) {
if (result.hasOwnProperty(fileName)) {
Expand Down Expand Up @@ -91,8 +92,6 @@ function extractEditor(options) {
}
delete tsConfig.compilerOptions.moduleResolution;
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
const tsConfigBase = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.base.json')).toString());
writeOutputFile('tsconfig.base.json', JSON.stringify(tsConfigBase, null, '\t'));
[
'vs/css.build.js',
'vs/css.d.ts',
Expand Down
6 changes: 3 additions & 3 deletions build/lib/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
let compilerOptions: { [key: string]: any };
if (tsConfig.extends) {
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
delete tsConfig.extends;
} else {
compilerOptions = tsConfig.compilerOptions;
}
Expand All @@ -44,12 +45,13 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
compilerOptions.noUnusedLocals = false;
compilerOptions.preserveConstEnums = false;
compilerOptions.declaration = false;
compilerOptions.noImplicitAny = false;
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;


options.compilerOptions = compilerOptions;

console.log(`Running with shakeLevel ${tss.toStringShakeLevel(options.shakeLevel)}`);

let result = tss.shake(options);
for (let fileName in result) {
if (result.hasOwnProperty(fileName)) {
Expand Down Expand Up @@ -100,8 +102,6 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str

delete tsConfig.compilerOptions.moduleResolution;
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
const tsConfigBase = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.base.json')).toString());
writeOutputFile('tsconfig.base.json', JSON.stringify(tsConfigBase, null, '\t'));

[
'vs/css.build.js',
Expand Down
16 changes: 12 additions & 4 deletions build/lib/treeshaking.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ var ShakeLevel;
ShakeLevel[ShakeLevel["InnerFile"] = 1] = "InnerFile";
ShakeLevel[ShakeLevel["ClassMembers"] = 2] = "ClassMembers";
})(ShakeLevel = exports.ShakeLevel || (exports.ShakeLevel = {}));
function toStringShakeLevel(shakeLevel) {
switch (shakeLevel) {
case 0 /* Files */:
return 'Files (0)';
case 1 /* InnerFile */:
return 'InnerFile (1)';
case 2 /* ClassMembers */:
return 'ClassMembers (2)';
}
}
exports.toStringShakeLevel = toStringShakeLevel;
function printDiagnostics(diagnostics) {
for (const diag of diagnostics) {
let result = '';
Expand Down Expand Up @@ -394,6 +405,7 @@ function markNodes(languageService, options) {
|| memberName === 'toJSON'
|| memberName === 'toString'
|| memberName === 'dispose' // TODO: keeping all `dispose` methods
|| /^_(.*)Brand$/.test(memberName || '') // TODO: keeping all members ending with `Brand`...
) {
enqueue_black(member);
}
Expand Down Expand Up @@ -513,10 +525,6 @@ function generateResult(languageService, shakeLevel) {
// keep method
continue;
}
if (/^_(.*)Brand$/.test(member.name.getText())) {
// TODO: keep all members ending with `Brand`...
continue;
}
let pos = member.pos - node.pos;
let end = member.end - node.pos;
toWrite = toWrite.substring(0, pos) + toWrite.substring(end);
Expand Down
16 changes: 12 additions & 4 deletions build/lib/treeshaking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ export const enum ShakeLevel {
ClassMembers = 2
}

export function toStringShakeLevel(shakeLevel: ShakeLevel): string {
switch(shakeLevel) {
case ShakeLevel.Files:
return 'Files (0)';
case ShakeLevel.InnerFile:
return 'InnerFile (1)';
case ShakeLevel.ClassMembers:
return 'ClassMembers (2)';
}
}

export interface ITreeShakingOptions {
/**
* The full path to the root where sources are.
Expand Down Expand Up @@ -513,6 +524,7 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
|| memberName === 'toJSON'
|| memberName === 'toString'
|| memberName === 'dispose'// TODO: keeping all `dispose` methods
|| /^_(.*)Brand$/.test(memberName || '') // TODO: keeping all members ending with `Brand`...
) {
enqueue_black(member);
}
Expand Down Expand Up @@ -642,10 +654,6 @@ function generateResult(languageService: ts.LanguageService, shakeLevel: ShakeLe
// keep method
continue;
}
if (/^_(.*)Brand$/.test(member.name.getText())) {
// TODO: keep all members ending with `Brand`...
continue;
}

let pos = member.pos - node.pos;
let end = member.end - node.pos;
Expand Down
4 changes: 2 additions & 2 deletions build/monaco/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ function generateDeclarationFile(recipe, sourceFileGetter) {
let usageImports = [];
let usage = [];
let failed = false;
usage.push(`var a;`);
usage.push(`var b;`);
usage.push(`var a: any;`);
usage.push(`var b: any;`);
const generateUsageImport = (moduleId) => {
let importName = 'm' + (++usageCounter);
usageImports.push(`import * as ${importName} from './${moduleId.replace(/\.d\.ts$/, '')}';`);
Expand Down
4 changes: 2 additions & 2 deletions build/monaco/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ function generateDeclarationFile(recipe: string, sourceFileGetter: SourceFileGet

let failed = false;

usage.push(`var a;`);
usage.push(`var b;`);
usage.push(`var a: any;`);
usage.push(`var b: any;`);

const generateUsageImport = (moduleId: string) => {
let importName = 'm' + (++usageCounter);
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
"typescript": "3.5.2",
"vsce": "1.48.0",
"vscode-telemetry-extractor": "^1.5.1",
"vscode-telemetry-extractor": "1.5.3",
"xml2js": "^0.4.17"
},
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions build/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3623,10 +3623,10 @@ vscode-ripgrep@^1.5.5:
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.5.tgz#24c0e9cb356cf889c98e15ecb58f9cf654a1d961"
integrity sha512-OrPrAmcun4+uZAuNcQvE6CCPskh+5AsjANod/Q3zRcJcGNxgoOSGlQN9RPtatkUNmkN8Nn8mZBnS1jMylu/dKg==

vscode-telemetry-extractor@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/vscode-telemetry-extractor/-/vscode-telemetry-extractor-1.5.1.tgz#67249e4ca9c65a21800ca53880732f8cef98d0fa"
integrity sha512-B5SnEdRiDrI4o6NMG9iHmengoaW1rxUQmS/sCaripgnchm+P79JURmKxhfXr5eRo4Mr1QSenFT/SDNaEop7aoQ==
vscode-telemetry-extractor@1.5.3:
version "1.5.3"
resolved "https://registry.yarnpkg.com/vscode-telemetry-extractor/-/vscode-telemetry-extractor-1.5.3.tgz#c17f9065a47425edafd23ea161e80c23274e009d"
integrity sha512-feioJ1e1KyMa9rzblnLbSOduo+Ny0l62H3/bSDgfgCSnU/km+tTSYxPBvZHVr7iQfQGC95J61yC/ObqS9EbaQg==
dependencies:
command-line-args "^5.1.1"
ts-morph "^3.1.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as fs from 'fs';
import { URI } from 'vscode-uri';
import * as URL from 'url';
import { formatError, runSafe, runSafeAsync } from './utils/runner';
import { JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration } from 'vscode-json-languageservice';
import { JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration, ClientCapabilities } from 'vscode-json-languageservice';
import { getLanguageModelCache } from './languageModelCache';

interface ISchemaAssociations {
Expand Down Expand Up @@ -103,6 +103,7 @@ function getSchemaRequestService(handledSchemas: { [schema: string]: boolean })
let languageService = getLanguageService({
workspaceContext,
contributions: [],
clientCapabilities: ClientCapabilities.LATEST
});

// Create a text document manager.
Expand Down
11 changes: 0 additions & 11 deletions extensions/objective-c/build/update-grammars.js

This file was deleted.

52 changes: 0 additions & 52 deletions extensions/objective-c/test/colorize-fixtures/test.mm

This file was deleted.

Loading

0 comments on commit 6db84ee

Please sign in to comment.