remove some vscode differences (#12146)

This commit is contained in:
Anthony Dresser
2020-09-04 18:04:30 -07:00
committed by GitHub
parent 503090856a
commit 704222b8d7
31 changed files with 1118 additions and 66 deletions

5
.vscode/launch.json vendored
View File

@@ -69,10 +69,9 @@
} }
}, },
{ {
"type": "pwa-chrome", "type": "chrome",
"request": "attach", "request": "attach",
"name": "Attach to azuredatastudio", "name": "Attach to azuredatastudio",
"timeout": 50000,
"port": 9222 "port": 9222
}, },
{ {
@@ -113,7 +112,7 @@
"preLaunchTask": "Ensure Prelaunch Dependencies", "preLaunchTask": "Ensure Prelaunch Dependencies",
}, },
{ {
"type": "chrome", "type": "node",
"request": "launch", "request": "launch",
"name": "Launch ADS (Web) (TBD)", "name": "Launch ADS (Web) (TBD)",
"program": "${workspaceFolder}/resources/web/code-web.js", "program": "${workspaceFolder}/resources/web/code-web.js",

View File

@@ -211,13 +211,6 @@ steps:
zip -d $(agent.builddirectory)/VSCode-darwin.zip "*.pkg" zip -d $(agent.builddirectory)/VSCode-darwin.zip "*.pkg"
displayName: Clean Archive displayName: Clean Archive
- script: |
set -e
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
node build/azure-pipelines/common/createAsset.js darwin-unnotarized archive "VSCode-darwin-$VSCODE_QUALITY.zip" $(agent.builddirectory)/VSCode-darwin.zip
displayName: Publish Unnotarized Build
- script: | - script: |
APP_ROOT=$(agent.builddirectory)/VSCode-darwin APP_ROOT=$(agent.builddirectory)/VSCode-darwin
APP_NAME="`ls $APP_ROOT | head -n 1`" APP_NAME="`ls $APP_ROOT | head -n 1`"

View File

@@ -6,7 +6,7 @@ schedules:
displayName: Mon-Fri at 7:00 displayName: Mon-Fri at 7:00
branches: branches:
include: include:
- main - master
resources: resources:
containers: containers:

View File

@@ -26,7 +26,7 @@
"onCommand:markdown.showSource", "onCommand:markdown.showSource",
"onCommand:markdown.showPreviewSecuritySelector", "onCommand:markdown.showPreviewSecuritySelector",
"onCommand:markdown.api.render", "onCommand:markdown.api.render",
"onCommand:notebook.showPreview", "onCommand:notebook.showPreview",
"onWebviewPanel:markdown.preview", "onWebviewPanel:markdown.preview",
"onCustomEditor:vscode.markdown.preview.editor" "onCustomEditor:vscode.markdown.preview.editor"
], ],

View File

@@ -128,8 +128,8 @@ export class SelectBox extends vsSelectBox {
private static createOptions(options: SelectOptionItemSQL[] | string[] | ISelectOptionItem[]): SelectOptionItemSQL[] { private static createOptions(options: SelectOptionItemSQL[] | string[] | ISelectOptionItem[]): SelectOptionItemSQL[] {
let selectOptions: SelectOptionItemSQL[]; let selectOptions: SelectOptionItemSQL[];
if (Array.isArray<string>(options) && typeof (options[0]) === 'string') { if (Array.isArray(options) && typeof (options[0]) === 'string') {
selectOptions = options.map(o => { selectOptions = (options as string[]).map(o => {
return { text: o, value: o } as SelectOptionItemSQL; return { text: o, value: o } as SelectOptionItemSQL;
}); });
} else { // Handle both SelectOptionItemSql and ISelectOptionItem } else { // Handle both SelectOptionItemSql and ISelectOptionItem

View File

@@ -76,7 +76,7 @@ ExtensionsRegistry.registerExtensionPoint<IAccountContrib | IAccountContrib[]>({
for (let extension of extensions) { for (let extension of extensions) {
const { value } = extension; const { value } = extension;
if (Array.isArray<IAccountContrib>(value)) { if (Array.isArray(value)) {
for (let command of value) { for (let command of value) {
handleCommand(command, extension); handleCommand(command, extension);
} }

View File

@@ -199,7 +199,7 @@ function resolveIconPath(extension: IExtensionPointUser<any>): void {
let baseDir = extension.description.extensionLocation.fsPath; let baseDir = extension.description.extensionLocation.fsPath;
let properties: ConnectionProviderProperties = extension.value; let properties: ConnectionProviderProperties = extension.value;
if (Array.isArray<ConnectionProviderProperties>(properties)) { if (Array.isArray(properties)) {
for (let p of properties) { for (let p of properties) {
toAbsolutePath(p['iconPath']); toAbsolutePath(p['iconPath']);
} }

View File

@@ -103,7 +103,7 @@ ExtensionsRegistry.registerExtensionPoint<IDashboardContainerContrib | IDashboar
for (const extension of extensions) { for (const extension of extensions) {
const { value } = extension; const { value } = extension;
if (Array.isArray<IDashboardContainerContrib>(value)) { if (Array.isArray(value)) {
for (const command of value) { for (const command of value) {
handleCommand(command, extension); handleCommand(command, extension);
} }

View File

@@ -161,7 +161,7 @@ ExtensionsRegistry.registerExtensionPoint<IDashboardTabContrib | IDashboardTabCo
for (const extension of extensions) { for (const extension of extensions) {
const { value } = extension; const { value } = extension;
if (Array.isArray<IDashboardTabContrib>(value)) { if (Array.isArray(value)) {
for (const command of value) { for (const command of value) {
handleTab(command, extension); handleTab(command, extension);
} }
@@ -215,7 +215,7 @@ ExtensionsRegistry.registerExtensionPoint<IDashboardTabContrib | IDashboardTabCo
for (const extension of extensions) { for (const extension of extensions) {
const { value } = extension; const { value } = extension;
if (Array.isArray<IDashboardTabGroupContrib>(value)) { if (Array.isArray(value)) {
for (const command of value) { for (const command of value) {
handleTabGroup(command, extension); handleTabGroup(command, extension);
} }

View File

@@ -298,7 +298,7 @@ ExtensionsRegistry.registerExtensionPoint<ProviderProperties | ProviderPropertie
for (let extension of extensions) { for (let extension of extensions) {
const { value } = extension; const { value } = extension;
if (Array.isArray<ProviderProperties>(value)) { if (Array.isArray(value)) {
for (let command of value) { for (let command of value) {
handleCommand(command, extension); handleCommand(command, extension);
} }

View File

@@ -37,7 +37,7 @@ ExtensionsRegistry.registerExtensionPoint<IInsightTypeContrib | IInsightTypeCont
for (const extension of extensions) { for (const extension of extensions) {
const { value } = extension; const { value } = extension;
if (Array.isArray<IInsightTypeContrib>(value)) { if (Array.isArray(value)) {
for (const command of value) { for (const command of value) {
handleCommand(command, extension); handleCommand(command, extension);
} }

View File

@@ -191,7 +191,7 @@ export class NotebookService extends Disposable implements INotebookService {
this._providers.set(p.id, new ProviderDescriptor()); this._providers.set(p.id, new ProviderDescriptor());
} }
if (registration.fileExtensions) { if (registration.fileExtensions) {
if (Array.isArray<string>(registration.fileExtensions)) { if (Array.isArray(registration.fileExtensions)) {
for (let fileType of registration.fileExtensions) { for (let fileType of registration.fileExtensions) {
this.addFileProvider(fileType, registration); this.addFileProvider(fileType, registration);
} }

View File

@@ -197,7 +197,7 @@ ExtensionsRegistry.registerExtensionPoint<NotebookProviderRegistration | Noteboo
for (let extension of extensions) { for (let extension of extensions) {
const { value } = extension; const { value } = extension;
if (Array.isArray<NotebookProviderRegistration>(value)) { if (Array.isArray(value)) {
for (let command of value) { for (let command of value) {
handleExtension(command, extension); handleExtension(command, extension);
} }
@@ -215,7 +215,7 @@ ExtensionsRegistry.registerExtensionPoint<NotebookLanguageMagicRegistration | No
for (let extension of extensions) { for (let extension of extensions) {
const { value } = extension; const { value } = extension;
if (Array.isArray<NotebookLanguageMagicRegistration>(value)) { if (Array.isArray(value)) {
for (let command of value) { for (let command of value) {
handleExtension(command, extension); handleExtension(command, extension);
} }

View File

@@ -1,11 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
interface ArrayConstructor {
isArray<T>(arg: ReadonlyArray<T> | null | undefined): arg is ReadonlyArray<T>;
isArray<T>(arg: Array<T> | null | undefined): arg is Array<T>;
isArray(arg: any): arg is Array<any>;
isArray<T>(arg: any): arg is Array<T>;
}

View File

@@ -704,8 +704,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
let elementWidth = 0; let elementWidth = 0;
if (container) { if (container) {
let longest = -1; let longest = 0;
let longestLength = -1; let longestLength = 0;
this.options.forEach((option, index) => { this.options.forEach((option, index) => {
const len = option.text.length + (!!option.decoratorRight ? option.decoratorRight.length : 0); const len = option.text.length + (!!option.decoratorRight ? option.decoratorRight.length : 0);
@@ -715,9 +715,8 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
} }
}); });
if (longest >= 0) {
container.innerHTML = this.options[longest].text + (!!this.options[longest].decoratorRight ? (this.options[longest].decoratorRight + ' ') : ''); container.innerHTML = this.options[longest].text + (!!this.options[longest].decoratorRight ? (this.options[longest].decoratorRight + ' ') : '');
}
elementWidth = dom.getTotalWidth(container); elementWidth = dom.getTotalWidth(container);
} }

View File

@@ -189,7 +189,7 @@ export class ObjectTreeModel<T extends NonNullable<any>, TFilterData extends Non
let childrenNodes = [...node.children] as ITreeNode<T, TFilterData>[]; let childrenNodes = [...node.children] as ITreeNode<T, TFilterData>[];
if (recursive || first) { if (recursive || first) {
childrenNodes = mergeSort(childrenNodes, this.sorter!.compare.bind(this.sorter)) as ITreeNode<T, TFilterData>[]; childrenNodes = mergeSort(childrenNodes, this.sorter!.compare.bind(this.sorter)) as ITreeNode<T, TFilterData>[]; // {{SQL CARBON EDIT}} strict-null-checks
} }
return Iterable.map<ITreeNode<T | null, TFilterData>, ITreeElement<T>>(childrenNodes, node => ({ return Iterable.map<ITreeNode<T | null, TFilterData>, ITreeElement<T>>(childrenNodes, node => ({

View File

@@ -383,7 +383,7 @@ export class URI implements UriComponents {
static revive(data: UriComponents | URI | undefined | null): URI | undefined | null; static revive(data: UriComponents | URI | undefined | null): URI | undefined | null;
static revive(data: UriComponents | URI | undefined | null): URI | undefined | null { static revive(data: UriComponents | URI | undefined | null): URI | undefined | null {
if (!data) { if (!data) {
// {{SQL CARBON EDIT}} @todo chlafren change back to data when we enable strict null checks // {{SQL CARBON EDIT}} strict-null-check
return undefined; return undefined;
} else if (data instanceof URI) { } else if (data instanceof URI) {
return data; return data;

View File

@@ -18,7 +18,7 @@ interface IIPCEvent {
function createScopedOnMessageEvent(senderId: number, eventName: string): Event<VSBuffer | null> { function createScopedOnMessageEvent(senderId: number, eventName: string): Event<VSBuffer | null> {
const onMessage = Event.fromNodeEventEmitter<IIPCEvent>(ipcMain, eventName, (event, message) => ({ event, message })); const onMessage = Event.fromNodeEventEmitter<IIPCEvent>(ipcMain, eventName, (event, message) => ({ event, message }));
const onMessageFromSender = Event.filter(onMessage, ({ event }) => event.sender.id === senderId); const onMessageFromSender = Event.filter(onMessage, ({ event }) => event.sender.id === senderId);
// {{SQL CARBON EDIT}} cast message as null since typescript isn't saying its always null // {{SQL CARBON EDIT}} strict-null-checks
return Event.map(onMessageFromSender, ({ message }) => message ? VSBuffer.wrap(message) : message as null); return Event.map(onMessageFromSender, ({ message }) => message ? VSBuffer.wrap(message) : message as null);
} }

File diff suppressed because it is too large Load Diff

View File

@@ -57,7 +57,7 @@ export class UserDataAutoSyncEnablementService extends Disposable {
return true; return true;
case 'off': case 'off':
return false; return false;
default: return this.storageService.getBoolean(enablementKey, StorageScope.GLOBAL, this.environmentService.enableSyncByDefault); default: return this.storageService.getBoolean(enablementKey, StorageScope.GLOBAL, this.environmentService.enableSyncByDefault); // {{SQL CARBON EDIT}} strict-null-checks move this to a default case
} }
} }

View File

@@ -127,13 +127,11 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
} }
private static _reviveCodeActionDto(data: ReadonlyArray<ICodeActionDto>): modes.CodeAction[] { private static _reviveCodeActionDto(data: ReadonlyArray<ICodeActionDto>): modes.CodeAction[] {
let dataCast = data as unknown; // {{ SQL CARBON EDIT }} if (data) {
let returnval = dataCast as modes.CodeAction[]; // {{ SQL CARBON EDIT }}
if (returnval) {
data.forEach(code => reviveWorkspaceEditDto(code.edit)); data.forEach(code => reviveWorkspaceEditDto(code.edit));
} }
return <modes.CodeAction[]>returnval; // {{ SQL CARBON EDIT }} return <modes.CodeAction[]><unknown>data; // {{SQL CARBON EDIT}} strict-null-check
} }
private static _reviveLinkDTO(data: ILinkDto): modes.ILink { private static _reviveLinkDTO(data: ILinkDto): modes.ILink {

View File

@@ -1083,7 +1083,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape, ExtHostN
const provider = this._notebookContentProviders.get(viewType); const provider = this._notebookContentProviders.get(viewType);
const revivedUri = URI.revive(uri); const revivedUri = URI.revive(uri);
if (!provider) { if (!provider) {
return undefined; // {{SQL CARBON EDIT}} return undefined; // {{SQL CARBON EDIT}} strict-null-checks
} }
const storageRoot = this._extensionStoragePaths.workspaceValue(provider.extension) ?? this._extensionStoragePaths.globalValue(provider.extension); const storageRoot = this._extensionStoragePaths.workspaceValue(provider.extension) ?? this._extensionStoragePaths.globalValue(provider.extension);

View File

@@ -302,7 +302,7 @@ export function appendStylizedStringToContainer(
export function calcANSI8bitColor(colorNumber: number): RGBA | undefined { export function calcANSI8bitColor(colorNumber: number): RGBA | undefined {
if (colorNumber % 1 !== 0) { if (colorNumber % 1 !== 0) {
// Should be integer // Should be integer
// {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 this is necessary because we don't use strict null checks // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 this is necessary because we don't use strict-null-checks
return undefined; return undefined;
} if (colorNumber >= 16 && colorNumber <= 231) { } if (colorNumber >= 16 && colorNumber <= 231) {
// Converts to one of 216 RGB colors // Converts to one of 216 RGB colors
@@ -327,7 +327,7 @@ export function calcANSI8bitColor(colorNumber: number): RGBA | undefined {
const colorLevel: number = Math.round(colorNumber / 23 * 255); const colorLevel: number = Math.round(colorNumber / 23 * 255);
return new RGBA(colorLevel, colorLevel, colorLevel); return new RGBA(colorLevel, colorLevel, colorLevel);
} else { } else {
// {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 this is necessary because we don't use strict null checks // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 this is necessary because we don't use strict-null-checks
return undefined; return undefined;
} }
} }

View File

@@ -160,9 +160,6 @@ abstract class NotebookAction extends Action2 {
} }
const activeCell = editor.getActiveCell(); const activeCell = editor.getActiveCell();
if (!activeCell) {
return undefined; // {{SQL CARBON EDIT}} strict-null-checks
}
return { return {
cell: activeCell, cell: activeCell,

View File

@@ -231,7 +231,6 @@ export class NotebookEditor extends EditorPane {
return group.activeEditorPane._widget.value?.getEditorViewState(); return group.activeEditorPane._widget.value?.getEditorViewState();
} }
} }
return undefined; // {{SQL CARBON EDIT}} strict-null-check return undefined; // {{SQL CARBON EDIT}} strict-null-check
} }

View File

@@ -192,8 +192,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
get activeCodeEditor(): IEditor | undefined { get activeCodeEditor(): IEditor | undefined {
if (this._isDisposed) { if (this._isDisposed) {
// {{SQL CARBON EDIT}} return undefined; // {{SQL CARBON EDIT}} strict-null-check
return undefined;
} }
const [focused] = this._list!.getFocusedElements(); const [focused] = this._list!.getFocusedElements();
@@ -769,14 +768,14 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
await this._loadKernelPreloads(this.activeKernel.extensionLocation, this.activeKernel); await this._loadKernelPreloads(this.activeKernel.extensionLocation, this.activeKernel);
if (tokenSource.token.isCancellationRequested) { if (tokenSource.token.isCancellationRequested) {
return undefined; // {{ SQL CARBON EDIT }} return undefined; // {{SQL CARBON EDIT}} strict-null-check
} }
this._activeKernelResolvePromise = (this.activeKernel as INotebookKernelInfo2).resolve(this.viewModel!.uri, this.getId(), tokenSource.token); this._activeKernelResolvePromise = (this.activeKernel as INotebookKernelInfo2).resolve(this.viewModel!.uri, this.getId(), tokenSource.token);
await this._activeKernelResolvePromise; await this._activeKernelResolvePromise;
if (tokenSource.token.isCancellationRequested) { if (tokenSource.token.isCancellationRequested) {
return undefined; // {{ SQL CARBON EDIT }} return undefined; // {{SQL CARBON EDIT}} strict-null-check
} }
} }

View File

@@ -306,7 +306,7 @@ export class SimpleFileDialog {
this.filePickBox.onDidCustom(() => { this.filePickBox.onDidCustom(() => {
if (isAcceptHandled || this.busy) { if (isAcceptHandled || this.busy) {
return undefined; // {{SQL CARBON EDIT}} @todo anthonydresser return to return; when we do strict null checks return undefined; // {{SQL CARBON EDIT}} @todo anthonydresser return to return; when we do strict-null-checks
} }
isAcceptHandled = true; isAcceptHandled = true;

View File

@@ -145,7 +145,7 @@ function globExprsToRgGlobs(patterns: glob.IExpression, folder?: string, exclude
} }
globArgs.push(fixDriveC(key)); globArgs.push(fixDriveC(key));
// {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 cast value because we aren't using strict null checks // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 cast value because we aren't using strict-null-checks
} else if (value && (<glob.SiblingClause>value).when) { } else if (value && (<glob.SiblingClause>value).when) {
siblingClauses[key] = value; siblingClauses[key] = value;
} }

View File

@@ -37,12 +37,11 @@ import { isWeb } from 'vs/base/common/platform';
// implementation // implementation
const DEFAULT_COLOR_THEME_ID = 'vs sql-theme-carbon-themes-light_carbon-json'; const DEFAULT_COLOR_THEME_ID = 'vs sql-theme-carbon-themes-light_carbon-json'; // {{SQL CARBON EDIT}}
const PERSISTED_OS_COLOR_SCHEME = 'osColorScheme'; const PERSISTED_OS_COLOR_SCHEME = 'osColorScheme';
// {{SQL CARBON EDIT}} const defaultThemeExtensionId = 'sql-theme-carbon';// {{SQL CARBON EDIT}}
const defaultThemeExtensionId = 'sql-theme-carbon';
const oldDefaultThemeExtensionId = 'vscode-theme-colorful-defaults'; const oldDefaultThemeExtensionId = 'vscode-theme-colorful-defaults';
const DEFAULT_FILE_ICON_THEME_ID = 'vscode.vscode-theme-seti-vs-seti'; const DEFAULT_FILE_ICON_THEME_ID = 'vscode.vscode-theme-seti-vs-seti';

View File

@@ -33,7 +33,7 @@ const colorThemeSettingEnumDescriptions: string[] = [];
const colorThemeSettingSchema: IConfigurationPropertySchema = { const colorThemeSettingSchema: IConfigurationPropertySchema = {
type: 'string', type: 'string',
description: nls.localize('colorTheme', "Specifies the color theme used in the workbench."), description: nls.localize('colorTheme', "Specifies the color theme used in the workbench."),
default: isWeb ? DEFAULT_THEME_LIGHT_SETTING_VALUE : DEFAULT_THEME_LIGHT_SETTING_VALUE, default: isWeb ? DEFAULT_THEME_LIGHT_SETTING_VALUE : DEFAULT_THEME_LIGHT_SETTING_VALUE, // {{SQL CARBON EDIT}}
enum: colorThemeSettingEnum, enum: colorThemeSettingEnum,
enumDescriptions: colorThemeSettingEnumDescriptions, enumDescriptions: colorThemeSettingEnumDescriptions,
errorMessage: nls.localize('colorThemeError', "Theme is unknown or not installed."), errorMessage: nls.localize('colorThemeError', "Theme is unknown or not installed."),

View File

@@ -141,7 +141,7 @@ suite.skip('TextSearch performance (integration)', () => {
let i = n; let i = n;
return (function iterate(): Promise<undefined> | undefined { return (function iterate(): Promise<undefined> | undefined {
if (!i--) { if (!i--) {
return undefined; return undefined; // {{SQL CARBON EDIT}} strict-null-checks
} }
return runSearch() return runSearch()