From 6dbf7573856415bf724dadeb6c302501b6d04c19 Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Fri, 12 Apr 2019 21:55:07 -0700 Subject: [PATCH] Remove some vscode differences (#5010) * remove some vscode differences * add dates to todo comments --- .../parts/modelComponents/webview.component.ts | 18 ++---------------- .../contents/webviewContent.component.ts | 5 ----- .../widgets/webview/webviewWidget.component.ts | 5 ----- .../webview/electron-browser/webViewDialog.ts | 6 ------ src/vs/base/browser/htmlContentRenderer.ts | 2 +- src/vs/base/browser/ui/button/button.ts | 5 +++-- .../base/browser/ui/contextview/contextview.ts | 4 ++-- src/vs/base/parts/tree/browser/tree.ts | 4 ++-- src/vs/base/parts/tree/browser/treeImpl.ts | 2 +- src/vs/editor/contrib/rename/rename.ts | 3 +-- src/vs/editor/contrib/suggest/suggestWidget.ts | 9 +-------- .../common/configurationModels.ts | 2 +- src/vs/platform/theme/common/colorRegistry.ts | 7 ++----- .../api/browser/mainThreadLanguageFeatures.ts | 2 +- .../workbench/api/common/extHost.protocol.ts | 6 +----- .../workbench/api/common/extHostWorkspace.ts | 2 +- .../parts/editor/editor.contribution.ts | 2 +- .../browser/parts/editor/editorStatus.ts | 2 +- .../contrib/debug/browser/debugANSIHandling.ts | 4 ++-- .../files/browser/views/explorerViewer.ts | 13 ++++++------- .../preferences.contribution.ts | 13 ------------- .../terminal/browser/terminalInstance.ts | 3 +-- .../webview/electron-browser/webviewElement.ts | 3 +-- .../services/search/node/ripgrepFileSearch.ts | 2 +- .../textfile/common/textFileService.ts | 4 ++-- 25 files changed, 34 insertions(+), 94 deletions(-) diff --git a/src/sql/parts/modelComponents/webview.component.ts b/src/sql/parts/modelComponents/webview.component.ts index 523f2e8da0..be12e133ec 100644 --- a/src/sql/parts/modelComponents/webview.component.ts +++ b/src/sql/parts/modelComponents/webview.component.ts @@ -4,17 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/css!./webview'; import { - Component, Input, Inject, ChangeDetectorRef, forwardRef, ComponentFactoryResolver, - ViewChild, ViewChildren, ElementRef, Injector, OnDestroy, QueryList + Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, OnDestroy } from '@angular/core'; import * as azdata from 'azdata'; import * as vscode from 'vscode'; import { addDisposableListener, EventType } from 'vs/base/browser/dom'; -import { CommonServiceInterface } from 'sql/platform/bootstrap/node/commonServiceInterface.service'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; import { URI, UriComponents } from 'vs/base/common/uri'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -22,9 +17,8 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { ComponentBase } from 'sql/parts/modelComponents/componentBase'; import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/parts/modelComponents/interfaces'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; import { WebviewContentOptions } from 'vs/workbench/contrib/webview/common/webview'; function reviveWebviewOptions(options: vscode.WebviewOptions): vscode.WebviewOptions { @@ -52,17 +46,11 @@ export default class WebViewComponent extends ComponentBase implements IComponen protected findInputFocusContextKey: IContextKey; constructor( - @Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface, @Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef, @Inject(forwardRef(() => ElementRef)) el: ElementRef, - @Inject(IWorkbenchLayoutService) private layoutService: IWorkbenchLayoutService, - @Inject(IThemeService) private themeService: IThemeService, - @Inject(IEnvironmentService) private environmentService: IEnvironmentService, - @Inject(IContextViewService) private contextViewService: IContextViewService, @Inject(IOpenerService) private readonly _openerService: IOpenerService, @Inject(IWorkspaceContextService) private readonly _contextService: IWorkspaceContextService, @Inject(IInstantiationService) private instantiationService: IInstantiationService, - @Inject(IContextKeyService) contextKeyService: IContextKeyService ) { super(changeRef, el); } @@ -94,8 +82,6 @@ export default class WebViewComponent extends ComponentBase implements IComponen args: e }); })); - - this._webview.style(this.themeService.getTheme()); this.setHtml(); } diff --git a/src/sql/workbench/parts/dashboard/contents/webviewContent.component.ts b/src/sql/workbench/parts/dashboard/contents/webviewContent.component.ts index bc8322e1af..f01c0f0f3d 100644 --- a/src/sql/workbench/parts/dashboard/contents/webviewContent.component.ts +++ b/src/sql/workbench/parts/dashboard/contents/webviewContent.component.ts @@ -11,7 +11,6 @@ import { Event, Emitter } from 'vs/base/common/event'; import { IDisposable } from 'vs/base/common/lifecycle'; import { addDisposableListener, EventType } from 'vs/base/browser/dom'; import { memoize } from 'vs/base/common/decorators'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { DashboardServiceInterface } from 'sql/workbench/parts/dashboard/services/dashboardServiceInterface.service'; import { CommonServiceInterface } from 'sql/platform/bootstrap/node/commonServiceInterface.service'; import { IDashboardWebview, IDashboardViewService } from 'sql/platform/dashboard/common/dashboardViewService'; @@ -20,7 +19,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import * as azdata from 'azdata'; import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; @Component({ template: '', @@ -41,9 +39,7 @@ export class WebviewContent extends AngularDisposable implements OnInit, IDashbo constructor( @Inject(forwardRef(() => CommonServiceInterface)) private _dashboardService: DashboardServiceInterface, @Inject(forwardRef(() => ElementRef)) private _el: ElementRef, - @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, @Inject(IDashboardViewService) private dashboardViewService: IDashboardViewService, - @Inject(IWorkbenchLayoutService) private layoutService: IWorkbenchLayoutService, @Inject(IInstantiationService) private instantiationService: IInstantiationService ) { super(); @@ -115,7 +111,6 @@ export class WebviewContent extends AngularDisposable implements OnInit, IDashbo this._onMessageDisposable = this._webview.onMessage(e => { this._onMessage.fire(e); }); - this._webview.style(this.themeService.getTheme()); if (this._html) { this._webview.contents = this._html; } diff --git a/src/sql/workbench/parts/dashboard/widgets/webview/webviewWidget.component.ts b/src/sql/workbench/parts/dashboard/widgets/webview/webviewWidget.component.ts index 4cf814877d..375add445d 100644 --- a/src/sql/workbench/parts/dashboard/widgets/webview/webviewWidget.component.ts +++ b/src/sql/workbench/parts/dashboard/widgets/webview/webviewWidget.component.ts @@ -15,10 +15,8 @@ import { CommonServiceInterface } from 'sql/platform/bootstrap/node/commonServic import { IDashboardWebview, IDashboardViewService } from 'sql/platform/dashboard/common/dashboardViewService'; import * as azdata from 'azdata'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; interface IWebviewWidgetConfig { id: string; @@ -43,8 +41,6 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget, @Inject(forwardRef(() => CommonServiceInterface)) private _dashboardService: DashboardServiceInterface, @Inject(WIDGET_CONFIG) protected _config: WidgetConfig, @Inject(forwardRef(() => ElementRef)) private _el: ElementRef, - @Inject(IWorkbenchLayoutService) private layoutService: IWorkbenchLayoutService, - @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, @Inject(IDashboardViewService) private dashboardViewService: IDashboardViewService, @Inject(IInstantiationService) private instantiationService: IInstantiationService, ) { @@ -113,7 +109,6 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget, this._onMessageDisposable = this._webview.onMessage(e => { this._onMessage.fire(e); }); - this._webview.style(this.themeService.getTheme()); if (this._html) { this._webview.contents = this._html; } diff --git a/src/sql/workbench/parts/webview/electron-browser/webViewDialog.ts b/src/sql/workbench/parts/webview/electron-browser/webViewDialog.ts index 76b334063f..4b76ed013f 100644 --- a/src/sql/workbench/parts/webview/electron-browser/webViewDialog.ts +++ b/src/sql/workbench/parts/webview/electron-browser/webViewDialog.ts @@ -3,8 +3,6 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -'use strict'; - import 'vs/css!sql/media/icons/common-icons'; import { Button } from 'sql/base/browser/ui/button/button'; import { Modal } from 'sql/workbench/browser/modal/modal'; @@ -95,14 +93,10 @@ export class WebViewDialog extends Modal { this._webview.mountTo(this._body); - this._webview.style(this._themeService.getTheme()); - this._webview.onMessage(message => { this._onMessage.fire(message); }, null, this.contentDisposables); - this._themeService.onThemeChange(theme => this._webview.style(theme), null, this.contentDisposables); - this.contentDisposables.push(this._webview); this.contentDisposables.push(toDisposable(() => this._webview = null)); } diff --git a/src/vs/base/browser/htmlContentRenderer.ts b/src/vs/base/browser/htmlContentRenderer.ts index 2587de3ea2..b2908db913 100644 --- a/src/vs/base/browser/htmlContentRenderer.ts +++ b/src/vs/base/browser/htmlContentRenderer.ts @@ -171,7 +171,7 @@ export function renderMarkdown(markdown: IMarkdownString, options: RenderOptions // but update the node with the real result later. const id = defaultGenerator.nextId(); - // {{SQL CARBON EDIT}} - Promise.all not returning the strValue properly in original code? + // {{SQL CARBON EDIT}} - Promise.all not returning the strValue properly in original code? @todo anthonydresser 4/12/19 investigate a better way to do this. const promise = value.then(strValue => { withInnerHTML.then(e => { const span = element.querySelector(`div[data-code="${id}"]`); diff --git a/src/vs/base/browser/ui/button/button.ts b/src/vs/base/browser/ui/button/button.ts index 9de98f977e..10b14761df 100644 --- a/src/vs/base/browser/ui/button/button.ts +++ b/src/vs/base/browser/ui/button/button.ts @@ -126,7 +126,7 @@ export class Button extends Disposable { this.applyStyles(); } - // {{SQL CARBON EDIT}} -- removed 'private' access modifier + // {{SQL CARBON EDIT}} -- removed 'private' access modifier @todo anthonydresser 4/12/19 things needs investigation whether we need this applyStyles(): void { if (this._element) { const background = this.buttonBackground ? this.buttonBackground.toString() : null; @@ -159,6 +159,7 @@ export class Button extends Disposable { } } + // {{SQL CARBON EDIT}} from addClass to addClasses to support multiple classes @todo anthonydresser 4/12/19 invesitgate a better way to do this. set icon(iconClassName: string) { DOM.addClasses(this._element, ...iconClassName.split(' ')); } @@ -227,4 +228,4 @@ export class ButtonGroup extends Disposable { } } } -} \ No newline at end of file +} diff --git a/src/vs/base/browser/ui/contextview/contextview.ts b/src/vs/base/browser/ui/contextview/contextview.ts index e5889ec04c..655f74850a 100644 --- a/src/vs/base/browser/ui/contextview/contextview.ts +++ b/src/vs/base/browser/ui/contextview/contextview.ts @@ -273,7 +273,7 @@ export class ContextView extends Disposable { DOM.hide(this.view); } - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 investigate a better way to do this public isVisible(): boolean { return !!this.delegate; } @@ -293,4 +293,4 @@ export class ContextView extends Disposable { super.dispose(); } -} \ No newline at end of file +} diff --git a/src/vs/base/parts/tree/browser/tree.ts b/src/vs/base/parts/tree/browser/tree.ts index 454f8d2d24..14630c8174 100644 --- a/src/vs/base/parts/tree/browser/tree.ts +++ b/src/vs/base/parts/tree/browser/tree.ts @@ -207,7 +207,7 @@ export interface ITree { */ clearFocus(eventPayload?: any): void; - // {{SQL CARBON EDIT}} @todo anthonydresser we need to refactor our code to not need these methods + // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 we need to refactor our code to not need these methods /** * Adds the trait to elements. */ @@ -475,7 +475,7 @@ export interface IDragOverReaction { autoExpand?: boolean; } -// {{SQL CARBON EDIT}} @todo anthonydresser refactor to not need this +// {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 refactor to not need this export const DRAG_OVER_REJECT: IDragOverReaction = { accept: false }; export const DRAG_OVER_ACCEPT: IDragOverReaction = { accept: true }; export const DRAG_OVER_ACCEPT_BUBBLE_UP: IDragOverReaction = { accept: true, bubble: DragOverBubble.BUBBLE_UP }; diff --git a/src/vs/base/parts/tree/browser/treeImpl.ts b/src/vs/base/parts/tree/browser/treeImpl.ts index 122010082f..40d70cee3d 100644 --- a/src/vs/base/parts/tree/browser/treeImpl.ts +++ b/src/vs/base/parts/tree/browser/treeImpl.ts @@ -276,7 +276,7 @@ export class Tree implements _.ITree { this.model.setFocus(null, eventPayload); } - // {{SQL CARBON EDIT}} @todo anthonydresser we need to refactor our code to not need these methods + // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 we need to refactor our code to not need these methods public addTraits(trait: string, elements: any[]): void { this.model.addTraits(trait, elements); } diff --git a/src/vs/editor/contrib/rename/rename.ts b/src/vs/editor/contrib/rename/rename.ts index 0941aa1512..e1d6bed0c4 100644 --- a/src/vs/editor/contrib/rename/rename.ts +++ b/src/vs/editor/contrib/rename/rename.ts @@ -94,8 +94,7 @@ export async function rename(model: ITextModel, position: Position, newName: str // --- register actions and commands -// {{SQL CARBON EDIT}} -export class RenameController extends Disposable implements IEditorContribution { +class RenameController extends Disposable implements IEditorContribution { private static readonly ID = 'editor.contrib.renameController'; diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index b448cca998..6f8696749a 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -214,14 +214,7 @@ class Renderer implements IListRenderer } disposeTemplate(templateData: ISuggestionTemplateData): void { - // {{SQL CARBON EDIT}} - if (templateData.iconLabel) { - templateData.iconLabel.dispose(); - } - // {{SQL CARBON EDIT}} - if (templateData.disposables) { - templateData.disposables = dispose(templateData.disposables); - } + templateData.disposables = dispose(templateData.disposables); } } diff --git a/src/vs/platform/configuration/common/configurationModels.ts b/src/vs/platform/configuration/common/configurationModels.ts index dfd2205135..ee13a7bf1a 100644 --- a/src/vs/platform/configuration/common/configurationModels.ts +++ b/src/vs/platform/configuration/common/configurationModels.ts @@ -102,7 +102,7 @@ export class ConfigurationModel implements IConfigurationModel { } freeze(): ConfigurationModel { - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 needs investigation; we shouldn't need to do this // this.isFrozen = true; return this; } diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index afcbdb361b..5a01929b64 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -192,8 +192,8 @@ export const selectionBackground = registerColor('selection.background', { light // ------ text colors export const textSeparatorForeground = registerColor('textSeparator.foreground', { light: '#0000002e', dark: '#ffffff2e', hc: Color.black }, nls.localize('textSeparatorForeground', "Color for text separators.")); -export const textLinkForeground = registerColor('textLink.foreground', { light: '#006AB1', dark: '#3794FF', hc: '006AB1' }, nls.localize('textLinkForeground', "Foreground color for links in text.")); -export const textLinkActiveForeground = registerColor('textLink.activeForeground', { light: '#007ACC', dark: '#3794FF', hc: '#007ACC' }, nls.localize('textLinkActiveForeground', "Foreground color for links in text when clicked on and on mouse hover.")); +export const textLinkForeground = registerColor('textLink.foreground', { light: '#006AB1', dark: '#3794FF', hc: '#3794FF' }, nls.localize('textLinkForeground', "Foreground color for links in text.")); +export const textLinkActiveForeground = registerColor('textLink.activeForeground', { light: '#006AB1', dark: '#3794FF', hc: '#3794FF' }, nls.localize('textLinkActiveForeground', "Foreground color for links in text when clicked on and on mouse hover.")); export const textPreformatForeground = registerColor('textPreformat.foreground', { light: '#A31515', dark: '#D7BA7D', hc: '#D7BA7D' }, nls.localize('textPreformatForeground', "Foreground color for preformatted text segments.")); export const textBlockQuoteBackground = registerColor('textBlockQuote.background', { light: '#7f7f7f1a', dark: '#7f7f7f1a', hc: null }, nls.localize('textBlockQuoteBackground', "Background color for block quotes in text.")); export const textBlockQuoteBorder = registerColor('textBlockQuote.border', { light: '#007acc80', dark: '#007acc80', hc: Color.white }, nls.localize('textBlockQuoteBorder', "Border color for block quotes in text.")); @@ -475,6 +475,3 @@ colorRegistry.onDidChangeSchema(() => { }); // setTimeout(_ => console.log(colorRegistry.toString()), 5000); - - - diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index 1b0aee3ab7..daaf482536 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -386,7 +386,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha provideCompletionItems: (model: ITextModel, position: EditorPosition, context: modes.CompletionContext, token: CancellationToken): Promise => { return this._proxy.$provideCompletionItems(handle, model.uri, position, context, token).then(result => { if (!result) { - // {{SQL CARBON EDIT}} @todo anthonydresser required because of strict null checks + // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 required because of strict null checks return undefined; } return { diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 9790b65d78..59bbdd32f3 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -258,11 +258,7 @@ export interface MainThreadErrorsShape extends IDisposable { } export interface MainThreadConsoleShape extends IDisposable { - $logExtensionHostMessage(msg: { - type: string; - severity: string; - arguments: string; - }): void; + $logExtensionHostMessage(msg: IRemoteConsoleLog): void; } export interface MainThreadKeytarShape extends IDisposable { diff --git a/src/vs/workbench/api/common/extHostWorkspace.ts b/src/vs/workbench/api/common/extHostWorkspace.ts index 10af142a5e..c603c6a0df 100644 --- a/src/vs/workbench/api/common/extHostWorkspace.ts +++ b/src/vs/workbench/api/common/extHostWorkspace.ts @@ -382,7 +382,7 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac // Events this._onDidChangeWorkspace.fire(Object.freeze({ added, - removed + removed, })); } diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index e277e6a7ec..2f13d0be00 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -124,7 +124,7 @@ class UntitledEditorInputFactory implements IEditorInputFactory { const untitledEditorInput = editorInput; - // {{SQL CARBON EDIT}} + // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 investigate if (!untitledEditorInput.getResource()) { return undefined; } diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index e81b5bd56e..b102e13bac 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -950,7 +950,7 @@ export class ChangeModeAction extends Action { } // Change mode for active editor - // {{SQL CARBON EDIT}} - Get activeControl instead of activeEditor + // {{SQL CARBON EDIT}} - Get activeControl instead of activeEditor @todo anthonydresser 4/12/19 investigate const activeEditor = this.editorService.activeControl; const activeTextEditorWidget = this.editorService.activeTextEditorWidget; const models: ITextModel[] = []; diff --git a/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts b/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts index 611668dbb6..0e0b1adca8 100644 --- a/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts +++ b/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts @@ -250,7 +250,7 @@ export function appendStylizedStringToContainer( export function calcANSI8bitColor(colorNumber: number): RGBA | undefined { if (colorNumber % 1 !== 0) { // Should be integer - // {{SQL CARBON EDIT}} @todo anthonydresser 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; } if (colorNumber >= 16 && colorNumber <= 231) { // Converts to one of 216 RGB colors @@ -275,7 +275,7 @@ export function calcANSI8bitColor(colorNumber: number): RGBA | undefined { const colorLevel: number = Math.round(colorNumber / 23 * 255); return new RGBA(colorLevel, colorLevel, colorLevel); } else { - // {{SQL CARBON EDIT}} @todo anthonydresser 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; } } diff --git a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts index dd2f9062f6..cc8f4b18d2 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts @@ -429,7 +429,6 @@ export class FileDragAndDrop implements ITreeDragAndDrop { private toDispose: IDisposable[]; private dropEnabled: boolean; - private isCopy: boolean; constructor( @INotificationService private notificationService: INotificationService, @@ -550,7 +549,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop { } getDragURI(element: ExplorerItem): string | null { - if (this.explorerService.isEditable(element) || (!this.isCopy && element.isReadonly)) { + if (this.explorerService.isEditable(element)) { return null; } @@ -566,7 +565,6 @@ export class FileDragAndDrop implements ITreeDragAndDrop { } onDragStart(data: IDragAndDropData, originalEvent: DragEvent): void { - this.isCopy = (originalEvent.ctrlKey && !isMacintosh) || (originalEvent.altKey && isMacintosh); const items = (data as ElementsDragAndDropData).elements; if (items && items.length && originalEvent.dataTransfer) { // Apply some datatransfer types to allow for dragging the element outside of the application @@ -599,7 +597,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop { } // In-Explorer DND (Move/Copy file) else { - this.handleExplorerDrop(data, target); + this.handleExplorerDrop(data, target, originalEvent); } } @@ -713,14 +711,15 @@ export class FileDragAndDrop implements ITreeDragAndDrop { return Promise.resolve(undefined); } - private handleExplorerDrop(data: IDragAndDropData, target: ExplorerItem): Promise { + private handleExplorerDrop(data: IDragAndDropData, target: ExplorerItem, originalEvent: DragEvent): Promise { const elementsData = (data as ElementsDragAndDropData).elements; const items = distinctParents(elementsData, s => s.resource); + const isCopy = (originalEvent.ctrlKey && !isMacintosh) || (originalEvent.altKey && isMacintosh); let confirmPromise: Promise; // Handle confirm setting - const confirmDragAndDrop = !this.isCopy && this.configurationService.getValue(FileDragAndDrop.CONFIRM_DND_SETTING_KEY); + const confirmDragAndDrop = !isCopy && this.configurationService.getValue(FileDragAndDrop.CONFIRM_DND_SETTING_KEY); if (confirmDragAndDrop) { confirmPromise = this.dialogService.confirm({ message: items.length > 1 && items.every(s => s.isRoot) ? localize('confirmRootsMove', "Are you sure you want to change the order of multiple root folders in your workspace?") @@ -748,7 +747,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop { return updateConfirmSettingsPromise.then(() => { if (res.confirmed) { const rootDropPromise = this.doHandleRootDrop(items.filter(s => s.isRoot), target); - return Promise.all(items.filter(s => !s.isRoot).map(source => this.doHandleExplorerDrop(source, target, this.isCopy)).concat(rootDropPromise)).then(() => undefined); + return Promise.all(items.filter(s => !s.isRoot).map(source => this.doHandleExplorerDrop(source, target, isCopy)).concat(rootDropPromise)).then(() => undefined); } return Promise.resolve(undefined); diff --git a/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts b/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts index e1c96e7bb7..6dfab4223f 100644 --- a/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts +++ b/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts @@ -248,19 +248,6 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ } }); -KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: KEYBINDINGS_EDITOR_COMMAND_DEFINE_WHEN, - weight: KeybindingWeight.WorkbenchContrib, - when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDING_FOCUS), - primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_E), - handler: (accessor, args: any) => { - const control = accessor.get(IEditorService).activeControl as IKeybindingsEditor; - if (control && control instanceof KeybindingsEditor && control.activeKeybindingEntry!.keybindingItem.keybinding) { - control.defineWhenExpression(control.activeKeybindingEntry!); - } - } -}); - KeybindingsRegistry.registerCommandAndKeybindingRule({ id: KEYBINDINGS_EDITOR_COMMAND_REMOVE, weight: KeybindingWeight.WorkbenchContrib, diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 759421df4f..edaf06b4bd 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -681,8 +681,7 @@ export class TerminalInstance implements ITerminalInstance { } public hasSelection(): boolean { - // {{SQL CARBON EDIT}} - return this._xterm && this._xterm.hasSelection ? this._xterm.hasSelection() : false; + return this._xterm && this._xterm.hasSelection(); } public copySelection(): void { diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts index 5af54121ed..c2cef4a649 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts @@ -605,8 +605,7 @@ export class WebviewElement extends Disposable implements Webview { }); } - // {{SQL CARBON EDIT}} - make public - public style(theme: ITheme): void { + private style(theme: ITheme): void { const configuration = this._configurationService.getValue('editor'); const editorFontFamily = configuration.fontFamily || EDITOR_FONT_DEFAULTS.fontFamily; const editorFontWeight = configuration.fontWeight || EDITOR_FONT_DEFAULTS.fontWeight; diff --git a/src/vs/workbench/services/search/node/ripgrepFileSearch.ts b/src/vs/workbench/services/search/node/ripgrepFileSearch.ts index 6f383347b5..06400e95be 100644 --- a/src/vs/workbench/services/search/node/ripgrepFileSearch.ts +++ b/src/vs/workbench/services/search/node/ripgrepFileSearch.ts @@ -144,7 +144,7 @@ function globExprsToRgGlobs(patterns: glob.IExpression, folder?: string, exclude } globArgs.push(fixDriveC(key)); - // {{SQL CARBON EDIT}} @todo anthonydresser 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 && (value).when) { siblingClauses[key] = value; } diff --git a/src/vs/workbench/services/textfile/common/textFileService.ts b/src/vs/workbench/services/textfile/common/textFileService.ts index 1680813822..f24936760b 100644 --- a/src/vs/workbench/services/textfile/common/textFileService.ts +++ b/src/vs/workbench/services/textfile/common/textFileService.ts @@ -740,7 +740,7 @@ export class TextFileService extends Disposable implements ITextFileService { } if (!targetResource) { - // {{SQL CARBON EDIT}} @todo anthonydresser necessary to add undefined till we enable strict null check + // {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 necessary to add undefined till we enable strict null check return undefined; // user canceled } @@ -993,4 +993,4 @@ export class TextFileService extends Disposable implements ITextFileService { super.dispose(); } -} \ No newline at end of file +}