mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 02:02:35 -05:00
Merge VS Code 1.21 source code (#1067)
* Initial VS Code 1.21 file copy with patches * A few more merges * Post npm install * Fix batch of build breaks * Fix more build breaks * Fix more build errors * Fix more build breaks * Runtime fixes 1 * Get connection dialog working with some todos * Fix a few packaging issues * Copy several node_modules to package build to fix loader issues * Fix breaks from master * A few more fixes * Make tests pass * First pass of license header updates * Second pass of license header updates * Fix restore dialog issues * Remove add additional themes menu items * fix select box issues where the list doesn't show up * formatting * Fix editor dispose issue * Copy over node modules to correct location on all platforms
This commit is contained in:
@@ -10,11 +10,13 @@ import * as objects from 'vs/base/common/objects';
|
||||
import types = require('vs/base/common/types');
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IEditor, IEditorViewState, IModel, ScrollType } from 'vs/editor/common/editorCommon';
|
||||
import { IEditorInput, IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceInput, Position, Verbosity, IEditor as IBaseEditor } from 'vs/platform/editor/common/editor';
|
||||
import { IEditor, IEditorViewState, ScrollType } from 'vs/editor/common/editorCommon';
|
||||
import { IEditorInput, IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceInput, Position, Verbosity, IEditor as IBaseEditor, IRevertOptions } from 'vs/platform/editor/common/editor';
|
||||
import { IInstantiationService, IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
export const TextCompareEditorVisible = new RawContextKey<boolean>('textCompareEditorVisible', false);
|
||||
|
||||
@@ -29,13 +31,18 @@ export enum ConfirmResult {
|
||||
*/
|
||||
export const TEXT_DIFF_EDITOR_ID = 'workbench.editors.textDiffEditor';
|
||||
|
||||
export const PREFERENCES_EDITOR_ID = 'workbench.editor.preferencesEditor';
|
||||
|
||||
/**
|
||||
* Binary diff editor id.
|
||||
*/
|
||||
export const BINARY_DIFF_EDITOR_ID = 'workbench.editors.binaryResourceDiffEditor';
|
||||
|
||||
export interface IFileInputFactory {
|
||||
|
||||
createFileInput(resource: URI, encoding: string, instantiationService: IInstantiationService): IFileEditorInput;
|
||||
|
||||
isFileInput(obj: any): obj is IFileEditorInput;
|
||||
}
|
||||
|
||||
export interface IEditorInputFactoryRegistry {
|
||||
@@ -200,8 +207,8 @@ export abstract class EditorInput implements IEditorInput {
|
||||
/**
|
||||
* Subclasses should bring up a proper dialog for the user if the editor is dirty and return the result.
|
||||
*/
|
||||
public confirmSave(): ConfirmResult {
|
||||
return ConfirmResult.DONT_SAVE;
|
||||
public confirmSave(): TPromise<ConfirmResult> {
|
||||
return TPromise.wrap(ConfirmResult.DONT_SAVE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -214,7 +221,7 @@ export abstract class EditorInput implements IEditorInput {
|
||||
/**
|
||||
* Reverts the editor if it is dirty. Subclasses return a promise with a boolean indicating the success of the operation.
|
||||
*/
|
||||
public revert(): TPromise<boolean> {
|
||||
public revert(options?: IRevertOptions): TPromise<boolean> {
|
||||
return TPromise.as(true);
|
||||
}
|
||||
|
||||
@@ -351,7 +358,7 @@ export interface IFileEditorInput extends IEditorInput, IEncodingSupport {
|
||||
*/
|
||||
export class SideBySideEditorInput extends EditorInput {
|
||||
|
||||
public static ID: string = 'workbench.editorinputs.sidebysideEditorInput';
|
||||
public static readonly ID: string = 'workbench.editorinputs.sidebysideEditorInput';
|
||||
|
||||
private _toUnbind: IDisposable[];
|
||||
|
||||
@@ -373,7 +380,7 @@ export class SideBySideEditorInput extends EditorInput {
|
||||
return this.master.isDirty();
|
||||
}
|
||||
|
||||
public confirmSave(): ConfirmResult {
|
||||
public confirmSave(): TPromise<ConfirmResult> {
|
||||
return this.master.confirmSave();
|
||||
}
|
||||
|
||||
@@ -460,7 +467,7 @@ export class SideBySideEditorInput extends EditorInput {
|
||||
}
|
||||
|
||||
export interface ITextEditorModel extends IEditorModel {
|
||||
textEditorModel: IModel;
|
||||
textEditorModel: ITextModel;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -788,8 +795,14 @@ export interface IEditorIdentifier {
|
||||
editor: IEditorInput;
|
||||
}
|
||||
|
||||
export interface IEditorContext extends IEditorIdentifier {
|
||||
event?: any;
|
||||
/**
|
||||
* The editor commands context is used for editor commands (e.g. in the editor title)
|
||||
* and we must ensure that the context is serializable because it potentially travels
|
||||
* to the extension host!
|
||||
*/
|
||||
export interface IEditorCommandsContext {
|
||||
groupId: GroupIdentifier;
|
||||
editorIndex?: number;
|
||||
}
|
||||
|
||||
export interface IEditorCloseEvent extends IEditorIdentifier {
|
||||
@@ -853,7 +866,7 @@ export const EditorCommands = {
|
||||
|
||||
export interface IResourceOptions {
|
||||
supportSideBySide?: boolean;
|
||||
filter?: 'file' | 'untitled' | ['file', 'untitled'] | ['untitled', 'file'];
|
||||
filter?: string | string[];
|
||||
}
|
||||
|
||||
export function toResource(editor: IEditorInput, options?: IResourceOptions): URI {
|
||||
@@ -878,18 +891,18 @@ export function toResource(editor: IEditorInput, options?: IResourceOptions): UR
|
||||
let includeFiles: boolean;
|
||||
let includeUntitled: boolean;
|
||||
if (Array.isArray(options.filter)) {
|
||||
includeFiles = (options.filter.indexOf('file') >= 0);
|
||||
includeUntitled = (options.filter.indexOf('untitled') >= 0);
|
||||
includeFiles = (options.filter.indexOf(Schemas.file) >= 0);
|
||||
includeUntitled = (options.filter.indexOf(Schemas.untitled) >= 0);
|
||||
} else {
|
||||
includeFiles = (options.filter === 'file');
|
||||
includeUntitled = (options.filter === 'untitled');
|
||||
includeFiles = (options.filter === Schemas.file);
|
||||
includeUntitled = (options.filter === Schemas.untitled);
|
||||
}
|
||||
|
||||
if (includeFiles && resource.scheme === 'file') {
|
||||
if (includeFiles && resource.scheme === Schemas.file) {
|
||||
return resource;
|
||||
}
|
||||
|
||||
if (includeUntitled && resource.scheme === 'untitled') {
|
||||
if (includeUntitled && resource.scheme === Schemas.untitled) {
|
||||
return resource;
|
||||
}
|
||||
|
||||
@@ -946,4 +959,4 @@ export const Extensions = {
|
||||
EditorInputFactories: 'workbench.contributions.editor.inputFactories'
|
||||
};
|
||||
|
||||
Registry.add(Extensions.EditorInputFactories, new EditorInputFactoryRegistry());
|
||||
Registry.add(Extensions.EditorInputFactories, new EditorInputFactoryRegistry());
|
||||
|
||||
Reference in New Issue
Block a user