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

@@ -386,7 +386,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
provideCompletionItems: (model: ITextModel, position: EditorPosition, context: modes.CompletionContext, token: CancellationToken): Promise<modes.CompletionList | undefined> => {
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 {

View File

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

View File

@@ -382,7 +382,7 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac
// Events
this._onDidChangeWorkspace.fire(Object.freeze({
added,
removed
removed,
}));
}

View File

@@ -124,7 +124,7 @@ class UntitledEditorInputFactory implements IEditorInputFactory {
const untitledEditorInput = <UntitledEditorInput>editorInput;
// {{SQL CARBON EDIT}}
// {{SQL CARBON EDIT}} @todo anthonydresser 4/12/19 investigate
if (!untitledEditorInput.getResource()) {
return undefined;
}

View File

@@ -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[] = [];

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;

View File

@@ -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 && (<glob.SiblingClause>value).when) {
siblingClauses[key] = value;
}

View File

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