mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Merge vscode 1.67 (#20883)
* Fix initial build breaks from 1.67 merge (#2514) * Update yarn lock files * Update build scripts * Fix tsconfig * Build breaks * WIP * Update yarn lock files * Misc breaks * Updates to package.json * Breaks * Update yarn * Fix breaks * Breaks * Build breaks * Breaks * Breaks * Breaks * Breaks * Breaks * Missing file * Breaks * Breaks * Breaks * Breaks * Breaks * Fix several runtime breaks (#2515) * Missing files * Runtime breaks * Fix proxy ordering issue * Remove commented code * Fix breaks with opening query editor * Fix post merge break * Updates related to setup build and other breaks (#2516) * Fix bundle build issues * Update distro * Fix distro merge and update build JS files * Disable pipeline steps * Remove stats call * Update license name * Make new RPM dependencies a warning * Fix extension manager version checks * Update JS file * Fix a few runtime breaks * Fixes * Fix runtime issues * Fix build breaks * Update notebook tests (part 1) * Fix broken tests * Linting errors * Fix hygiene * Disable lint rules * Bump distro * Turn off smoke tests * Disable integration tests * Remove failing "activate" test * Remove failed test assertion * Disable other broken test * Disable query history tests * Disable extension unit tests * Disable failing tasks
This commit is contained in:
@@ -59,7 +59,7 @@ export interface ITreeShakingOptions {
|
||||
*/
|
||||
importIgnorePattern: RegExp;
|
||||
|
||||
redirects: { [module: string]: string; };
|
||||
redirects: { [module: string]: string };
|
||||
}
|
||||
|
||||
export interface ITreeShakingResult {
|
||||
@@ -140,7 +140,7 @@ function createTypeScriptLanguageService(ts: typeof import('typescript'), option
|
||||
function discoverAndReadFiles(ts: typeof import('typescript'), options: ITreeShakingOptions): IFileMap {
|
||||
const FILES: IFileMap = {};
|
||||
|
||||
const in_queue: { [module: string]: boolean; } = Object.create(null);
|
||||
const in_queue: { [module: string]: boolean } = Object.create(null);
|
||||
const queue: string[] = [];
|
||||
|
||||
const enqueue = (moduleId: string) => {
|
||||
@@ -225,8 +225,8 @@ function processLibFiles(ts: typeof import('typescript'), options: ITreeShakingO
|
||||
return result;
|
||||
}
|
||||
|
||||
interface ILibMap { [libName: string]: string; }
|
||||
interface IFileMap { [fileName: string]: string; }
|
||||
interface ILibMap { [libName: string]: string }
|
||||
interface IFileMap { [fileName: string]: string }
|
||||
|
||||
/**
|
||||
* A TypeScript language service host
|
||||
@@ -245,14 +245,6 @@ class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
|
||||
this._compilerOptions = compilerOptions;
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}} - provide missing methods
|
||||
readFile(): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
fileExists(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
// --- language service host ---------------
|
||||
|
||||
getCompilationSettings(): ts.CompilerOptions {
|
||||
@@ -292,6 +284,12 @@ class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost {
|
||||
isDefaultLibFileName(fileName: string): boolean {
|
||||
return fileName === this.getDefaultLibFileName(this._compilerOptions);
|
||||
}
|
||||
readFile(path: string, _encoding?: string): string | undefined {
|
||||
return this._files[path] || this._libs[path];
|
||||
}
|
||||
fileExists(path: string): boolean {
|
||||
return path in this._files || path in this._libs;
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
|
||||
@@ -335,6 +333,54 @@ function isSymbolWithDeclarations(symbol: ts.Symbol | undefined | null): symbol
|
||||
return !!(symbol && symbol.declarations);
|
||||
}
|
||||
|
||||
function isVariableStatementWithSideEffects(ts: typeof import('typescript'), node: ts.Node): boolean {
|
||||
if (!ts.isVariableStatement(node)) {
|
||||
return false;
|
||||
}
|
||||
let hasSideEffects = false;
|
||||
const visitNode = (node: ts.Node) => {
|
||||
if (hasSideEffects) {
|
||||
// no need to go on
|
||||
return;
|
||||
}
|
||||
if (ts.isCallExpression(node) || ts.isNewExpression(node)) {
|
||||
// TODO: assuming `createDecorator` and `refineServiceDecorator` calls are side-effect free
|
||||
const isSideEffectFree = /(createDecorator|refineServiceDecorator)/.test(node.expression.getText());
|
||||
if (!isSideEffectFree) {
|
||||
hasSideEffects = true;
|
||||
}
|
||||
}
|
||||
node.forEachChild(visitNode);
|
||||
};
|
||||
node.forEachChild(visitNode);
|
||||
return hasSideEffects;
|
||||
}
|
||||
|
||||
function isStaticMemberWithSideEffects(ts: typeof import('typescript'), node: ts.ClassElement | ts.TypeElement): boolean {
|
||||
if (!ts.isPropertyDeclaration(node)) {
|
||||
return false;
|
||||
}
|
||||
if (!node.modifiers) {
|
||||
return false;
|
||||
}
|
||||
if (!node.modifiers.some(mod => mod.kind === ts.SyntaxKind.StaticKeyword)) {
|
||||
return false;
|
||||
}
|
||||
let hasSideEffects = false;
|
||||
const visitNode = (node: ts.Node) => {
|
||||
if (hasSideEffects) {
|
||||
// no need to go on
|
||||
return;
|
||||
}
|
||||
if (ts.isCallExpression(node) || ts.isNewExpression(node)) {
|
||||
hasSideEffects = true;
|
||||
}
|
||||
node.forEachChild(visitNode);
|
||||
};
|
||||
node.forEachChild(visitNode);
|
||||
return hasSideEffects;
|
||||
}
|
||||
|
||||
function markNodes(ts: typeof import('typescript'), languageService: ts.LanguageService, options: ITreeShakingOptions) {
|
||||
const program = languageService.getProgram();
|
||||
if (!program) {
|
||||
@@ -380,6 +426,10 @@ function markNodes(ts: typeof import('typescript'), languageService: ts.Language
|
||||
return;
|
||||
}
|
||||
|
||||
if (isVariableStatementWithSideEffects(ts, node)) {
|
||||
enqueue_black(node);
|
||||
}
|
||||
|
||||
if (
|
||||
ts.isExpressionStatement(node)
|
||||
|| ts.isIfStatement(node)
|
||||
@@ -571,6 +621,10 @@ function markNodes(ts: typeof import('typescript'), languageService: ts.Language
|
||||
) {
|
||||
enqueue_black(member);
|
||||
}
|
||||
|
||||
if (isStaticMemberWithSideEffects(ts, member)) {
|
||||
enqueue_black(member);
|
||||
}
|
||||
}
|
||||
|
||||
// queue the heritage clauses
|
||||
|
||||
Reference in New Issue
Block a user