Remove some vscode differences (#5010)

* remove some vscode differences

* add dates to todo comments
This commit is contained in:
Anthony Dresser
2019-04-12 21:55:07 -07:00
committed by GitHub
parent c5a32d8373
commit 6dbf757385
25 changed files with 34 additions and 94 deletions

View File

@@ -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;
}
}

View File

@@ -429,7 +429,6 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
private toDispose: IDisposable[];
private dropEnabled: boolean;
private isCopy: boolean;
constructor(
@INotificationService private notificationService: INotificationService,
@@ -550,7 +549,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
}
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<ExplorerItem> {
}
onDragStart(data: IDragAndDropData, originalEvent: DragEvent): void {
this.isCopy = (originalEvent.ctrlKey && !isMacintosh) || (originalEvent.altKey && isMacintosh);
const items = (data as ElementsDragAndDropData<ExplorerItem>).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<ExplorerItem> {
}
// 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<ExplorerItem> {
return Promise.resolve(undefined);
}
private handleExplorerDrop(data: IDragAndDropData, target: ExplorerItem): Promise<void> {
private handleExplorerDrop(data: IDragAndDropData, target: ExplorerItem, originalEvent: DragEvent): Promise<void> {
const elementsData = (data as ElementsDragAndDropData<ExplorerItem>).elements;
const items = distinctParents(elementsData, s => s.resource);
const isCopy = (originalEvent.ctrlKey && !isMacintosh) || (originalEvent.altKey && isMacintosh);
let confirmPromise: Promise<IConfirmationResult>;
// Handle confirm setting
const confirmDragAndDrop = !this.isCopy && this.configurationService.getValue<boolean>(FileDragAndDrop.CONFIRM_DND_SETTING_KEY);
const confirmDragAndDrop = !isCopy && this.configurationService.getValue<boolean>(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<ExplorerItem> {
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);

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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<IEditorOptions>('editor');
const editorFontFamily = configuration.fontFamily || EDITOR_FONT_DEFAULTS.fontFamily;
const editorFontWeight = configuration.fontWeight || EDITOR_FONT_DEFAULTS.fontWeight;