Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c (#8525)

* Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c

* remove files we don't want

* fix hygiene

* update distro

* update distro

* fix hygiene

* fix strict nulls

* distro

* distro

* fix tests

* fix tests

* add another edit

* fix viewlet icon

* fix azure dialog

* fix some padding

* fix more padding issues
This commit is contained in:
Anthony Dresser
2019-12-04 19:28:22 -08:00
committed by GitHub
parent a8818ab0df
commit f5ce7fb2a5
1507 changed files with 42813 additions and 27370 deletions

21
src/bootstrap-fork.js vendored
View File

@@ -20,11 +20,6 @@ if (!!process.send && process.env.PIPE_LOGGING === 'true') {
pipeLoggingToParent();
}
// Disable IO if configured
if (!process.env['VSCODE_ALLOW_IO']) {
disableSTDIO();
}
// Handle Exceptions
if (!process.env['VSCODE_HANDLES_UNCAUGHT_ERRORS']) {
handleExceptions();
@@ -141,20 +136,6 @@ function pipeLoggingToParent() {
console.error = function () { safeSend({ type: '__$console', severity: 'error', arguments: safeToArray(arguments) }); };
}
function disableSTDIO() {
// const stdout, stderr and stdin be no-op streams. This prevents an issue where we would get an EBADF
// error when we are inside a forked process and this process tries to access those channels.
const stream = require('stream');
const writable = new stream.Writable({
write: function () { /* No OP */ }
});
process['__defineGetter__']('stdout', function () { return writable; });
process['__defineGetter__']('stderr', function () { return writable; });
process['__defineGetter__']('stdin', function () { return writable; });
}
function handleExceptions() {
// Handle uncaught exceptions
@@ -198,4 +179,4 @@ function configureCrashReporter() {
}
}
//#endregion
//#endregion

View File

@@ -161,7 +161,7 @@ exports.load = function (modulePaths, resultCallback, options) {
} catch (error) {
onUnexpectedError(error, enableDeveloperTools);
}
});
}, onUnexpectedError);
};
/**

51
src/bootstrap.js vendored
View File

@@ -39,10 +39,12 @@ exports.injectNodeModuleLookupPath = function (injectPath) {
// @ts-ignore
Module._resolveLookupPaths = function (moduleName, parent) {
const paths = originalResolveLookupPaths(moduleName, parent);
for (let i = 0, len = paths.length; i < len; i++) {
if (paths[i] === nodeModulesPath) {
paths.splice(i, 0, injectPath);
break;
if (Array.isArray(paths)) {
for (let i = 0, len = paths.length; i < len; i++) {
if (paths[i] === nodeModulesPath) {
paths.splice(i, 0, injectPath);
break;
}
}
}
@@ -74,10 +76,12 @@ exports.enableASARSupport = function (nodeModulesPath) {
// @ts-ignore
Module._resolveLookupPaths = function (request, parent) {
const paths = originalResolveLookupPaths(request, parent);
for (let i = 0, len = paths.length; i < len; i++) {
if (paths[i] === NODE_MODULES_PATH) {
paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
break;
if (Array.isArray(paths)) {
for (let i = 0, len = paths.length; i < len; i++) {
if (paths[i] === NODE_MODULES_PATH) {
paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
break;
}
}
}
@@ -153,30 +157,10 @@ exports.writeFile = function (file, content) {
* @param {string} dir
* @returns {Promise<string>}
*/
function mkdir(dir) {
exports.mkdirp = function mkdirp(dir) {
const fs = require('fs');
return new Promise((c, e) => fs.mkdir(dir, err => (err && err.code !== 'EEXIST') ? e(err) : c(dir)));
}
/**
* @param {string} dir
* @returns {Promise<string>}
*/
exports.mkdirp = function mkdirp(dir) {
const path = require('path');
return mkdir(dir).then(null, err => {
if (err && err.code === 'ENOENT') {
const parent = path.dirname(dir);
if (parent !== dir) { // if not arrived at root
return mkdirp(parent).then(() => mkdir(dir));
}
}
throw err;
});
return new Promise((c, e) => fs.mkdir(dir, { recursive: true }, err => (err && err.code !== 'EEXIST') ? e(err) : c(dir)));
};
//#endregion
@@ -279,7 +263,12 @@ exports.configurePortable = function () {
}
if (isTempPortable) {
process.env[process.platform === 'win32' ? 'TEMP' : 'TMPDIR'] = portableTempPath;
if (process.platform === 'win32') {
process.env['TMP'] = portableTempPath;
process.env['TEMP'] = portableTempPath;
} else {
process.env['TMPDIR'] = portableTempPath;
}
}
return {

View File

@@ -155,10 +155,8 @@ function configureCommandlineSwitchesSync(cliArgs) {
if (argvKey === 'disable-hardware-acceleration') {
app.disableHardwareAcceleration(); // needs to be called explicitly
} else {
app.commandLine.appendArgument(argvKey);
app.commandLine.appendSwitch(argvKey);
}
} else {
app.commandLine.appendSwitch(argvKey, argvValue);
}
});
@@ -221,24 +219,19 @@ function createDefaultArgvConfigSync(argvConfigPath) {
// Default argv content
const defaultArgvConfigContent = [
'// This configuration file allows to pass permanent command line arguments to VSCode.',
'// This configuration file allows you to pass permanent command line arguments to VS Code.',
'// Only a subset of arguments is currently supported to reduce the likelyhood of breaking',
'// the installation.',
'//',
'// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT',
'//',
'// If the command line argument does not have any values, simply assign',
'// it in the JSON below with a value of \'true\'. Otherwise, put the value',
'// directly.',
'//',
'// If you see rendering issues in VSCode and have a better experience',
'// with software rendering, you can configure this by adding:',
'//',
'// \'disable-hardware-acceleration\': true',
'//',
'// NOTE: Changing this file requires a restart of VSCode.',
'// NOTE: Changing this file requires a restart of VS Code.',
'{',
' // Enabled by default by VSCode to resolve color issues in the renderer',
' // Use software rendering instead of hardware accelerated rendering.',
' // This can help in cases where you see rendering issues in VS Code.',
' // "disable-hardware-acceleration": true,',
'',
' // Enabled by default by VS Code to resolve color issues in the renderer',
' // See https://github.com/Microsoft/vscode/issues/51791 for details',
' "disable-color-correct-rendering": true'
];
@@ -247,7 +240,7 @@ function createDefaultArgvConfigSync(argvConfigPath) {
defaultArgvConfigContent[defaultArgvConfigContent.length - 1] = `${defaultArgvConfigContent[defaultArgvConfigContent.length - 1]},`; // append trailing ","
defaultArgvConfigContent.push('');
defaultArgvConfigContent.push(' // Display language of VSCode');
defaultArgvConfigContent.push(' // Display language of VS Code');
defaultArgvConfigContent.push(` "locale": "${legacyLocale}"`);
}

View File

@@ -13,3 +13,8 @@
flex-direction: row;
margin-right: 5px;
}
.monaco-select-box.monaco-select-box-dropdown-padding {
padding: 2px 8px;
padding: 0 22px 0 6px !important; /* I don't like this but for now its fine */
}

View File

@@ -26,9 +26,3 @@
-webkit-mask: url('icons/search_inverse.svg') no-repeat 50% 50%;
-webkit-mask-size: 25px 25px;
}
/* Activity Bar - Data Explorer */
.monaco-workbench > .activitybar .monaco-action-bar .action-label.dataExplorer {
-webkit-mask: url('icons/server_page_inverse.svg') no-repeat 50% 50%;
-webkit-mask-size: 25px 25px;
}

View File

@@ -14,6 +14,7 @@ import { createCSSRule, asCSSUrl } from 'vs/base/browser/dom';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { IdGenerator } from 'vs/base/common/idGenerator';
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
const ids = new IdGenerator('task-icon-');
@@ -56,10 +57,12 @@ export const TaskRegistry: ITaskRegistry = new class implements ITaskRegistry {
let iconClass: string | undefined;
if (this.taskIdToIconClassNameMap.has(item.id)) {
iconClass = this.taskIdToIconClassNameMap.get(item.id);
} else if (item.iconLocation) {
} else if (ThemeIcon.isThemeIcon(item.icon)) {
// TODO
} else if (item.icon?.dark) { // at the very least we need a dark icon
iconClass = ids.nextId();
createCSSRule(`.codicon.${iconClass}`, `background-image: ${asCSSUrl(item.iconLocation.light || item.iconLocation.dark)}`);
createCSSRule(`.vs-dark .codicon.${iconClass}, .hc-black .codicon.${iconClass}`, `background-image: ${asCSSUrl(item.iconLocation.dark)}`);
createCSSRule(`.codicon.${iconClass}`, `background-image: ${asCSSUrl(item.icon.light || item.icon.dark)}`);
createCSSRule(`.vs-dark .codicon.${iconClass}, .hc-black .codicon.${iconClass}`, `background-image: ${asCSSUrl(item.icon.dark)}`);
this.taskIdToIconClassNameMap.set(item.id, iconClass);
}
return iconClass;
@@ -102,7 +105,7 @@ export abstract class Task {
private toCommandAction(): ICommandAction {
return {
iconLocation: this.iconPath,
icon: this.iconPath,
id: this.id,
title: this.title
};

View File

@@ -7,9 +7,10 @@ import * as sqlcolors from './colors';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import * as cr from 'vs/platform/theme/common/colorRegistry';
import { IThemable, attachStyler } from 'vs/platform/theme/common/styler';
import { attachStyler } from 'vs/platform/theme/common/styler';
import { IDisposable } from 'vs/base/common/lifecycle';
import { SIDE_BAR_BACKGROUND, SIDE_BAR_SECTION_HEADER_FOREGROUND, SIDE_BAR_SECTION_HEADER_BACKGROUND, SIDE_BAR_DRAG_AND_DROP_BACKGROUND, PANEL_INACTIVE_TITLE_FOREGROUND, PANEL_ACTIVE_TITLE_BORDER, PANEL_ACTIVE_TITLE_FOREGROUND } from 'vs/workbench/common/theme';
import { IThemable } from 'vs/base/common/styler';
export function attachModalDialogStyler(widget: IThemable, themeService: IThemeService, style?:
{

View File

@@ -91,7 +91,7 @@ class NotebookProviderWrapper extends Disposable implements INotebookProvider {
constructor(
private _proxy: Proxies,
public readonly providerId,
public readonly providerId: string,
public readonly providerHandle: number,
@IInstantiationService private readonly instantiationService: IInstantiationService
) {
@@ -127,7 +127,7 @@ class NotebookManagerWrapper implements INotebookManager {
private managerDetails: INotebookManagerDetails;
constructor(private _proxy: Proxies,
public readonly providerId,
public readonly providerId: string,
private notebookUri: URI,
@IInstantiationService private readonly instantiationService: IInstantiationService
) { }

View File

@@ -27,7 +27,6 @@ import { disposed } from 'vs/base/common/errors';
import { ICellModel, NotebookContentChange, INotebookModel } from 'sql/workbench/contrib/notebook/browser/models/modelInterfaces';
import { NotebookChangeType, CellTypes } from 'sql/workbench/contrib/notebook/common/models/contracts';
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { viewColumnToEditorGroup } from 'vs/workbench/api/common/shared/editor';
import { localize } from 'vs/nls';
@@ -35,6 +34,9 @@ import { IFileService } from 'vs/platform/files/common/files';
import { UntitledNotebookInput } from 'sql/workbench/contrib/notebook/common/models/untitledNotebookInput';
import { FileNotebookInput } from 'sql/workbench/contrib/notebook/common/models/fileNotebookInput';
import { find } from 'vs/base/common/arrays';
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
class MainThreadNotebookEditor extends Disposable {
private _contentChangedEmitter = new Emitter<NotebookContentChange>();
@@ -325,7 +327,7 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
private _modelToDisposeMap = new Map<string, DisposableStore>();
constructor(
extHostContext: IExtHostContext,
@IUntitledEditorService private _untitledEditorService: IUntitledEditorService,
@IUntitledTextEditorService private _untitledEditorService: IUntitledTextEditorService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IEditorService private _editorService: IEditorService,
@IEditorGroupsService private _editorGroupService: IEditorGroupsService,
@@ -458,9 +460,9 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
this._editorService.createInput({ resource: uri, mode: 'notebook' });
let input: NotebookInput;
if (isUntitled) {
input = this._instantiationService.createInstance(UntitledNotebookInput, path.basename(uri.fsPath), uri, fileInput);
input = this._instantiationService.createInstance(UntitledNotebookInput, path.basename(uri.fsPath), uri, fileInput as UntitledTextEditorInput);
} else {
input = this._instantiationService.createInstance(FileNotebookInput, path.basename(uri.fsPath), uri, fileInput);
input = this._instantiationService.createInstance(FileNotebookInput, path.basename(uri.fsPath), uri, fileInput as FileEditorInput);
}
input.defaultKernel = options.defaultKernel;
input.connectionProfile = new ConnectionProfile(this._capabilitiesService, options.connectionProfile);

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./media/modal';
import { IThemable, attachButtonStyler } from 'vs/platform/theme/common/styler';
import { attachButtonStyler } from 'vs/platform/theme/common/styler';
import { Color } from 'vs/base/common/color';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { mixin } from 'vs/base/common/objects';
@@ -26,6 +26,7 @@ import { ITextResourcePropertiesService } from 'vs/editor/common/services/resour
import { URI } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
import { find, firstIndex } from 'vs/base/common/arrays';
import { IThemable } from 'vs/base/common/styler';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
export const MODAL_SHOWING_KEY = 'modalShowing';

View File

@@ -24,7 +24,6 @@ import * as styler from 'vs/platform/theme/common/styler';
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
import { Widget } from 'vs/base/browser/ui/widget';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { IViewletPanelOptions, ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -34,13 +33,14 @@ import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { ViewletPane, IViewletPaneOptions } from 'vs/workbench/browser/parts/views/paneViewlet';
export class CategoryView extends ViewletPanel {
export class CategoryView extends ViewletPane {
constructor(
private contentElement: HTMLElement,
private size: number,
options: IViewletPanelOptions,
options: IViewletPaneOptions,
@IKeybindingService keybindingService: IKeybindingService,
@IContextMenuService contextMenuService: IContextMenuService,
@IConfigurationService configurationService: IConfigurationService,

View File

@@ -90,7 +90,7 @@ export default class DiffEditorComponent extends ComponentBase implements ICompo
let editorinput1 = this._instantiationService.createInstance(ResourceEditorInput, 'source', undefined, uri1, undefined);
let editorinput2 = this._instantiationService.createInstance(ResourceEditorInput, 'target', undefined, uri2, undefined);
this._editorInput = this._instantiationService.createInstance(DiffEditorInput, 'DiffEditor', undefined, editorinput1, editorinput2, true);
this._editorInput = new DiffEditorInput('DiffEditor', undefined, editorinput1, editorinput2, true);
this._editor.setInput(this._editorInput, undefined, cancellationTokenSource.token);

View File

@@ -11,7 +11,6 @@ import * as azdata from 'azdata';
import * as DOM from 'vs/base/browser/dom';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITextModel } from 'vs/editor/common/model';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { URI } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
import { IModeService } from 'vs/editor/common/services/modeService';
@@ -24,6 +23,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
import { SimpleEditorProgressService } from 'vs/editor/standalone/browser/simpleServices';
import { IProgressService } from 'vs/platform/progress/common/progress';
import { ILogService } from 'vs/platform/log/common/log';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
@Component({
template: '',
@@ -33,7 +33,7 @@ export default class EditorComponent extends ComponentBase implements IComponent
@Input() descriptor: IComponentDescriptor;
@Input() modelStore: IModelStore;
private _editor: QueryTextEditor;
private _editorInput: UntitledEditorInput;
private _editorInput: UntitledTextEditorInput;
private _editorModel: ITextModel;
private _renderedContent: string;
private _languageMode: string;
@@ -66,7 +66,7 @@ export default class EditorComponent extends ComponentBase implements IComponent
this._editor.create(this._el.nativeElement);
this._editor.setVisible(true);
let uri = this.createUri();
this._editorInput = instantiationService.createInstance(UntitledEditorInput, uri, false, 'plaintext', '', '');
this._editorInput = instantiationService.createInstance(UntitledTextEditorInput, uri, false, 'plaintext', '', '');
await this._editor.setInput(this._editorInput, undefined);
const model = await this._editorInput.resolve();
this._editorModel = model.textEditorModel;

View File

@@ -6,7 +6,7 @@
import * as azdata from 'azdata';
import { IEditorModel } from 'vs/platform/editor/common/editor';
import { EditorInput, EditorModel, ConfirmResult } from 'vs/workbench/common/editor';
import { EditorInput, EditorModel } from 'vs/workbench/common/editor';
import * as DOM from 'vs/base/browser/dom';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -136,17 +136,6 @@ export class ModelViewInput extends EditorInput {
return this._model.isDirty;
}
/**
* Subclasses should bring up a proper dialog for the user if the editor is dirty and return the result.
*/
confirmSave(): Promise<ConfirmResult> {
// TODO #2530 support save on close / confirm save. This is significantly more work
// as we need to either integrate with textFileService (seems like this isn't viable)
// or register our own complimentary service that handles the lifecycle operations such
// as close all, auto save etc.
return Promise.resolve(ConfirmResult.DONT_SAVE);
}
/**
* Saves the editor if it is dirty. Subclasses return a promise with a boolean indicating the success of the operation.
*/

View File

@@ -6,7 +6,6 @@
import { IEditorOptions, EditorOption } from 'vs/editor/common/config/editorOptions';
import * as nls from 'vs/nls';
import * as DOM from 'vs/base/browser/dom';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel';
import * as editorCommon from 'vs/editor/common/editorCommon';
@@ -16,7 +15,6 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { EditorOptions } from 'vs/workbench/common/editor';
import { StandaloneCodeEditor } from 'vs/editor/standalone/browser/standaloneCodeEditor';
import { CancellationToken } from 'vs/base/common/cancellation';
@@ -24,7 +22,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IHostService } from 'vs/workbench/services/host/browser/host';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
/**
* Extension of TextResourceEditor that is always readonly rather than only with non UntitledInputs
@@ -47,16 +45,14 @@ export class QueryTextEditor extends BaseTextEditor {
@IStorageService storageService: IStorageService,
@ITextResourceConfigurationService configurationService: ITextResourceConfigurationService,
@IThemeService themeService: IThemeService,
@ITextFileService textFileService: ITextFileService,
@IEditorGroupsService editorGroupService: IEditorGroupsService,
@IEditorService protected editorService: IEditorService,
@IHostService hostService: IHostService,
@IConfigurationService private workspaceConfigurationService: IConfigurationService,
@IConfigurationService private workspaceConfigurationService: IConfigurationService
) {
super(
QueryTextEditor.ID, telemetryService, instantiationService, storageService,
configurationService, themeService, textFileService, editorService, editorGroupService, hostService);
configurationService, themeService, editorService, editorGroupService);
}
public createEditorControl(parent: HTMLElement, configuration: IEditorOptions): editorCommon.IEditor {
@@ -90,7 +86,7 @@ export class QueryTextEditor extends BaseTextEditor {
return options;
}
setInput(input: UntitledEditorInput, options: EditorOptions): Promise<void> {
setInput(input: UntitledTextEditorInput, options: EditorOptions): Promise<void> {
return super.setInput(input, options, CancellationToken.None)
.then(() => this.input.resolve()
.then(editorModel => editorModel.load())

View File

@@ -16,7 +16,6 @@ import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/bro
import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
import { TreeComponentRenderer } from 'sql/workbench/browser/modelComponents/treeComponentRenderer';
import { TreeComponentDataSource } from 'sql/workbench/browser/modelComponents/treeDataSource';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { attachListStyler } from 'vs/platform/theme/common/styler';
import { DefaultFilter, DefaultAccessibilityProvider, DefaultController } from 'vs/base/parts/tree/browser/treeDefaults';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -26,6 +25,7 @@ import * as DOM from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode } from 'vs/base/common/keyCodes';
import { values } from 'vs/base/common/collections';
import { IThemeService } from 'vs/platform/theme/common/themeService';
class Root implements ITreeComponentItem {
label = {
@@ -54,7 +54,7 @@ export default class TreeComponent extends ComponentBase implements IComponent,
@ViewChild('input', { read: ElementRef }) private _inputContainer: ElementRef;
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
@Inject(IThemeService) private themeService: IThemeService,
@Inject(IInstantiationService) private _instantiationService: IInstantiationService,
@Inject(forwardRef(() => ElementRef)) el: ElementRef
) {
@@ -96,7 +96,7 @@ export default class TreeComponent extends ComponentBase implements IComponent,
private createTreeControl(): void {
if (!this._tree && this._dataProvider) {
const dataSource = this._instantiationService.createInstance(TreeComponentDataSource, this._dataProvider);
const renderer = this._instantiationService.createInstance(TreeComponentRenderer, this._dataProvider, this.themeService, { withCheckbox: this.withCheckbox });
const renderer = new TreeComponentRenderer(this._dataProvider, this.themeService, { withCheckbox: this.withCheckbox });
this._treeRenderer = renderer;
const controller = new DefaultController();
const filter = new DefaultFilter();

View File

@@ -5,11 +5,10 @@
import * as dom from 'vs/base/browser/dom';
import { ITree, IRenderer } from 'vs/base/parts/tree/browser/tree';
import { LIGHT } from 'vs/platform/theme/common/themeService';
import { LIGHT, IThemeService } from 'vs/platform/theme/common/themeService';
import { Disposable } from 'vs/base/common/lifecycle';
import { Event, Emitter } from 'vs/base/common/event';
import { ITreeComponentItem } from 'sql/workbench/common/views';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { TreeViewDataProvider } from './treeViewDataProvider';
import { URI } from 'vs/base/common/uri';
@@ -95,7 +94,7 @@ export class TreeComponentRenderer extends Disposable implements IRenderer {
constructor(
private _dataProvider: TreeViewDataProvider,
private themeService: IWorkbenchThemeService,
private themeService: IThemeService,
public options?: { withCheckbox: boolean }
) {
super();

View File

@@ -85,7 +85,7 @@ export default class WebViewComponent extends ComponentBase implements IComponen
});
this._ready.then(() => {
this._register(this._webview.onDidClickLink(link => this.onDidClickLink(link)));
this._register(this._webview.onDidClickLink(link => this.onDidClickLink(URI.parse(link))));
this._register(this._webview.onMessage(e => {
this.fireEvent({

View File

@@ -28,7 +28,6 @@ import { dirname, basename } from 'vs/base/common/resources';
import { LIGHT, FileThemeIcon, FolderThemeIcon, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { FileKind } from 'vs/platform/files/common/files';
import { WorkbenchAsyncDataTree, TreeResourceNavigator2 } from 'vs/platform/list/browser/listService';
import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet';
import { localize } from 'vs/nls';
import { timeout } from 'vs/base/common/async';
import { editorFindMatchHighlight, editorFindMatchHighlightBorder, textLinkForeground, textCodeBlockBackground, focusBorder } from 'vs/platform/theme/common/colorRegistry';
@@ -50,8 +49,9 @@ import { IOEShimService } from 'sql/workbench/contrib/objectExplorer/browser/obj
import { NodeContextKey } from 'sql/workbench/contrib/dataExplorer/browser/nodeContext';
import { UserCancelledConnectionError } from 'sql/base/common/errors';
import { firstIndex } from 'vs/base/common/arrays';
import { ViewletPane, IViewletPaneOptions } from 'vs/workbench/browser/parts/views/paneViewlet';
export class CustomTreeViewPanel extends ViewletPanel {
export class CustomTreeViewPanel extends ViewletPane {
private treeView: ITreeView;
@@ -63,7 +63,7 @@ export class CustomTreeViewPanel extends ViewletPanel {
@IConfigurationService configurationService: IConfigurationService,
@IContextKeyService contextKeyService: IContextKeyService,
) {
super({ ...(options as IViewletPanelOptions), ariaHeaderLabel: options.title }, keybindingService, contextMenuService, configurationService, contextKeyService);
super({ ...(options as IViewletPaneOptions), ariaHeaderLabel: options.title }, keybindingService, contextMenuService, configurationService, contextKeyService);
const { treeView } = (<ITreeViewDescriptor>Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getView(options.id));
this.treeView = treeView as ITreeView;
this._register(this.treeView.onDidChangeActions(() => this.updateActions(), this));

View File

@@ -9,7 +9,6 @@ import { IEditorService, IOpenEditorOverride } from 'vs/workbench/services/edito
import { IEditorInput } from 'vs/workbench/common/editor';
import { IEditorOptions, ITextEditorOptions } from 'vs/platform/editor/common/editor';
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { IModeService } from 'vs/editor/common/services/modeService';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -17,6 +16,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
import * as path from 'vs/base/common/path';
import { ILanguageAssociationRegistry, Extensions as LanguageAssociationExtensions } from 'sql/workbench/common/languageAssociation';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
const languageAssociationRegistry = Registry.as<ILanguageAssociationRegistry>(LanguageAssociationExtensions.LanguageAssociations);
@@ -39,14 +39,14 @@ export class EditorReplacementContribution implements IWorkbenchContribution {
// return undefined;
// }
if (!(editor instanceof FileEditorInput) && !(editor instanceof UntitledEditorInput)) {
if (!(editor instanceof FileEditorInput) && !(editor instanceof UntitledTextEditorInput)) {
return undefined;
}
let language: string;
if (editor instanceof FileEditorInput) {
language = editor.getPreferredMode();
} else if (editor instanceof UntitledEditorInput) {
} else if (editor instanceof UntitledTextEditorInput) {
language = editor.getMode();
} else {
return undefined;

View File

@@ -7,7 +7,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { IEditorInput, EditorInput } from 'vs/workbench/common/editor';
import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { find } from 'vs/base/common/arrays';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
import { getCodeEditor } from 'vs/editor/browser/editorBrowser';
@@ -38,7 +38,7 @@ export const Extensions = {
Registry.add(Extensions.LanguageAssociations, languageAssociationRegistery);
export function doHandleUpgrade(accessor: ServicesAccessor, editor: EditorInput): EditorInput {
if (editor instanceof UntitledEditorInput || editor instanceof FileEditorInput) {
if (editor instanceof UntitledTextEditorInput || editor instanceof FileEditorInput) {
const instantiationService = accessor.get(IInstantiationService);
const activeWidget = getCodeEditor(editor);
const textModel = activeWidget.getModel();

View File

@@ -17,7 +17,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { SplitView, Sizing } from 'vs/base/browser/ui/splitview/splitview';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { values } from 'vs/base/common/map';
@@ -36,13 +35,14 @@ import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { ViewletPane, IViewletPaneOptions } from 'vs/workbench/browser/parts/views/paneViewlet';
class AccountPanel extends ViewletPanel {
class AccountPanel extends ViewletPane {
public index: number;
private accountList: List<azdata.Account>;
constructor(
private options: IViewletPanelOptions,
private options: IViewletPaneOptions,
@IKeybindingService keybindingService: IKeybindingService,
@IContextMenuService contextMenuService: IContextMenuService,
@IConfigurationService configurationService: IConfigurationService,
@@ -174,7 +174,7 @@ export class AccountDialog extends Modal {
protected renderBody(container: HTMLElement) {
this._container = container;
this._splitViewContainer = DOM.$('div.account-view.monaco-panel-view');
this._splitViewContainer = DOM.$('div.account-view.monaco-pane-view');
DOM.append(container, this._splitViewContainer);
this._splitView = new SplitView(this._splitViewContainer);

View File

@@ -11,7 +11,6 @@ import { localize } from 'vs/nls';
import { Action } from 'vs/base/common/actions';
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
import { URI } from 'vs/base/common/uri';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IInsightsConfig } from 'sql/platform/dashboard/browser/insightRegistry';
import { IInsightOptions } from 'sql/workbench/contrib/charts/common/interfaces';
@@ -21,6 +20,7 @@ import { IFileDialogService, FileFilter } from 'vs/platform/dialogs/common/dialo
import { VSBuffer } from 'vs/base/common/buffer';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { assign } from 'vs/base/common/objects';
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
export interface IChartActionContext {
options: IInsightOptions;
@@ -35,7 +35,7 @@ export class CreateInsightAction extends Action {
constructor(
@IEditorService private editorService: IEditorService,
@INotificationService private notificationService: INotificationService,
@IUntitledEditorService private untitledEditorService: IUntitledEditorService
@IUntitledTextEditorService private untitledEditorService: IUntitledTextEditorService
) {
super(CreateInsightAction.ID, CreateInsightAction.LABEL, CreateInsightAction.ICON);
}

View File

@@ -29,12 +29,13 @@ import { UntitledQueryEditorInput } from 'sql/workbench/contrib/query/common/unt
import { TestQueryModelService } from 'sql/platform/query/test/common/testQueryModelService';
import { Event } from 'vs/base/common/event';
import { IQueryModelService } from 'sql/platform/query/common/queryModel';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
import { isUndefinedOrNull } from 'vs/base/common/types';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
import { SimpleUriLabelService } from 'vs/editor/standalone/browser/simpleServices';
class TestParsedArgs implements ParsedArgs {
[arg: string]: any;
@@ -391,7 +392,7 @@ suite('commandLineService tests', () => {
querymodelService.setup(c => c.onRunQueryComplete).returns(() => Event.None);
const instantiationService = new TestInstantiationService();
let uri = URI.file(args._[0]);
const untitledEditorInput = new UntitledEditorInput(uri, false, '', '', '', instantiationService, undefined, undefined);
const untitledEditorInput = new UntitledTextEditorInput(uri, false, '', '', '', instantiationService, undefined, new SimpleUriLabelService(), undefined, undefined, undefined);
const queryInput = new UntitledQueryEditorInput(undefined, untitledEditorInput, undefined, connectionManagementService.object, querymodelService.object, configurationService.object, undefined);
queryInput.state.connected = true;
const editorService: TypeMoq.Mock<IEditorService> = TypeMoq.Mock.ofType<IEditorService>(TestEditorService, TypeMoq.MockBehavior.Strict);

View File

@@ -31,7 +31,7 @@ const actionRegistry = <IWorkbenchActionRegistry>Registry.as(Extensions.Workbenc
// Connection Actions
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
ClearRecentConnectionsAction,
ClearRecentConnectionsAction.ID,
ClearRecentConnectionsAction.LABEL
@@ -40,7 +40,7 @@ actionRegistry.registerWorkbenchAction(
);
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
AddServerGroupAction,
AddServerGroupAction.ID,
AddServerGroupAction.LABEL
@@ -49,7 +49,7 @@ actionRegistry.registerWorkbenchAction(
);
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
AddServerAction,
AddServerAction.ID,
AddServerAction.LABEL
@@ -102,7 +102,7 @@ CommandsRegistry.registerCommand('azdata.connect',
});
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
GetCurrentConnectionStringAction,
GetCurrentConnectionStringAction.ID,
GetCurrentConnectionStringAction.LABEL

View File

@@ -130,7 +130,7 @@ const ConnectionProviderContrib: IJSONSchema = {
type: 'string'
},
defaultValue: {
type: 'any'
type: ['string', 'number', 'boolean', 'object', 'integer', 'null', 'array']
},
defaultValueOsOverrides: {
type: 'array',
@@ -142,22 +142,22 @@ const ConnectionProviderContrib: IJSONSchema = {
enum: ['Windows', 'Macintosh', 'Linux']
},
defaultValueOverride: {
type: 'any'
type: ['string', 'number', 'boolean', 'object', 'integer', 'null', 'array']
}
}
}
},
objectType: {
type: 'any'
type: ['string', 'number', 'boolean', 'object', 'integer', 'null', 'array']
},
categoryValues: {
type: 'any'
type: ['string', 'number', 'boolean', 'object', 'integer', 'null', 'array']
},
isRequired: {
type: 'boolean'
},
isArray: {
type: 'bolean'
type: 'boolean'
}
}
}

View File

@@ -29,7 +29,7 @@ import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import * as colors from 'vs/platform/theme/common/colorRegistry';
import * as themeColors from 'vs/workbench/common/theme';
import { Action } from 'vs/base/common/actions';
import { Action, IAction } from 'vs/base/common/actions';
import { Registry } from 'vs/platform/registry/common/platform';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { memoize } from 'vs/base/common/decorators';
@@ -117,7 +117,7 @@ export class DashboardWidgetWrapper extends AngularDisposable implements OnInit
this._collapseAction = this.instantiationService.createInstance(CollapseWidgetAction, this._bootstrap.getUnderlyingUri(), this.guid, this.collapsed);
this._actionbar.push(this._collapseAction, { icon: true, label: false });
}
this._actionbar.push(this.instantiationService.createInstance(ToggleMoreWidgetAction, this._actions, this._component.actionsContext), { icon: true, label: false });
this._actionbar.push(this.instantiationService.createInstance(ToggleMoreWidgetAction, this._actions as Array<IAction>, this._component.actionsContext), { icon: true, label: false });
}
this.layout();
}

View File

@@ -13,6 +13,7 @@ import { INewDashboardTabDialogService } from 'sql/workbench/services/dashboard/
import { IDashboardTab } from 'sql/workbench/contrib/dashboard/browser/dashboardRegistry';
import { subscriptionToDisposable } from 'sql/base/browser/lifecycle';
import { find, firstIndex } from 'vs/base/common/arrays';
import { CellContext } from 'sql/workbench/contrib/notebook/browser/cellViews/codeActions';
export class EditDashboardAction extends Action {
@@ -81,9 +82,9 @@ export class ToggleMoreWidgetAction extends Action {
private static readonly ICON = 'toggle-more';
constructor(
private _actions: Array<IAction>,
private _context: any,
@IContextMenuService private _contextMenuService: IContextMenuService
private readonly _actions: Array<IAction>,
private readonly _context: CellContext,
@IContextMenuService private readonly _contextMenuService: IContextMenuService
) {
super(ToggleMoreWidgetAction.ID, ToggleMoreWidgetAction.LABEL, ToggleMoreWidgetAction.ICON);
}
@@ -104,9 +105,9 @@ export class DeleteWidgetAction extends Action {
private static readonly ICON = 'close';
constructor(
private _widgetId,
private _uri,
@IAngularEventingService private angularEventService: IAngularEventingService
private _widgetId: string,
private _uri: string,
@IAngularEventingService private readonly angularEventService: IAngularEventingService
) {
super(DeleteWidgetAction.ID, DeleteWidgetAction.LABEL, DeleteWidgetAction.ICON);
}

View File

@@ -37,7 +37,7 @@ export class ExplorerController extends TreeDefaults.DefaultController {
constructor(
// URI for the dashboard for managing, should look into some other way of doing this
private _uri,
private _uri: string,
private _connectionService: SingleConnectionManagementService,
private _router: Router,
private readonly bootStrapService: CommonServiceInterface,

View File

@@ -10,7 +10,6 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet';
import { IAction } from 'vs/base/common/actions';
import { ServerTreeView } from 'sql/workbench/contrib/objectExplorer/browser/serverTreeView';
import {
@@ -20,8 +19,9 @@ import {
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/browser/objectExplorerService';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ITree } from 'vs/base/parts/tree/browser/tree';
import { ViewletPane, IViewletPaneOptions } from 'vs/workbench/browser/parts/views/paneViewlet';
export class ConnectionViewletPanel extends ViewletPanel {
export class ConnectionViewletPanel extends ViewletPane {
public static readonly ID = 'dataExplorer.servers';
@@ -40,7 +40,7 @@ export class ConnectionViewletPanel extends ViewletPanel {
@IObjectExplorerService private readonly objectExplorerService: IObjectExplorerService,
@IContextKeyService contextKeyService: IContextKeyService
) {
super({ ...(options as IViewletPanelOptions), ariaHeaderLabel: options.title }, keybindingService, contextMenuService, configurationService, contextKeyService);
super({ ...(options as IViewletPaneOptions), ariaHeaderLabel: options.title }, keybindingService, contextMenuService, configurationService, contextKeyService);
this._addServerAction = this.instantiationService.createInstance(AddServerAction,
AddServerAction.ID,
AddServerAction.LABEL);

View File

@@ -18,7 +18,7 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { DataExplorerContainerExtensionHandler } from 'sql/workbench/contrib/dataExplorer/browser/dataExplorerExtensionPoint';
// Data Explorer Viewlet
const viewletDescriptor = new ViewletDescriptor(
const viewletDescriptor = ViewletDescriptor.create(
DataExplorerViewlet,
VIEWLET_ID,
localize('workbench.dataExplorer', "Connections"),
@@ -32,7 +32,7 @@ const workbenchRegistry = Registry.as<IWorkbenchContributionsRegistry>(Workbench
workbenchRegistry.registerWorkbenchContribution(DataExplorerViewletViewsContribution, LifecyclePhase.Starting);
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
registry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
OpenDataExplorerViewletAction,
OpenDataExplorerViewletAction.ID,
OpenDataExplorerViewletAction.LABEL,

View File

@@ -16,7 +16,6 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IAddedViewDescriptorRef } from 'vs/workbench/browser/parts/views/views';
import { ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet';
import { ConnectionViewletPanel } from 'sql/workbench/contrib/dataExplorer/browser/connectionViewletPanel';
import { Extensions as ViewContainerExtensions, IViewDescriptor, IViewsRegistry, IViewContainersRegistry } from 'vs/workbench/common/views';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
@@ -27,6 +26,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ShowViewletAction } from 'vs/workbench/browser/viewlet';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { ViewletPane } from 'vs/workbench/browser/parts/views/paneViewlet';
export const VIEWLET_ID = 'workbench.view.connections';
@@ -134,13 +134,13 @@ export class DataExplorerViewlet extends ViewContainerViewlet {
return actions;
}
protected onDidAddViews(added: IAddedViewDescriptorRef[]): ViewletPanel[] {
protected onDidAddViews(added: IAddedViewDescriptorRef[]): ViewletPane[] {
const addedViews = super.onDidAddViews(added);
return addedViews;
}
protected createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): ViewletPanel {
let viewletPanel = this.instantiationService.createInstance(viewDescriptor.ctorDescriptor.ctor, options) as ViewletPanel;
protected createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): ViewletPane {
let viewletPanel = this.instantiationService.createInstance(viewDescriptor.ctorDescriptor.ctor, options) as ViewletPane;
this._register(viewletPanel);
return viewletPanel;
}

View File

@@ -5,6 +5,11 @@
/* Activity Bar */
.monaco-workbench .activitybar .monaco-action-bar .action-label.dataExplorer {
-webkit-mask: url('server_page_inverse.svg') no-repeat 50% 50%;
-webkit-mask-size: 25px 25px;
}
-webkit-mask: url('server_page_inverse.svg') 50% 50% / 24px no-repeat;
background-color: rgba(255, 255, 255, 0.4);
}
/* Activity Bar */
.monaco-workbench .activitybar .monaco-action-bar .checked .action-label.dataExplorer {
background-color: rgb(255, 255, 255); /* this is a patch, will need to find a better long term fix*/
}

View File

@@ -22,7 +22,7 @@ suite('Data Explorer Viewlet', () => {
}
test('ViewletDescriptor API', function () {
let d = new ViewletDescriptor(DataExplorerTestViewlet, 'id', 'name', 'class', 1);
let d = ViewletDescriptor.create(DataExplorerTestViewlet, 'id', 'name', 'class', 1);
assert.strictEqual(d.id, 'id');
assert.strictEqual(d.name, 'name');
assert.strictEqual(d.cssClass, 'class');
@@ -30,11 +30,11 @@ suite('Data Explorer Viewlet', () => {
});
test('Editor Aware ViewletDescriptor API', function () {
let d = new ViewletDescriptor(DataExplorerTestViewlet, 'id', 'name', 'class', 5);
let d = ViewletDescriptor.create(DataExplorerTestViewlet, 'id', 'name', 'class', 5);
assert.strictEqual(d.id, 'id');
assert.strictEqual(d.name, 'name');
d = new ViewletDescriptor(DataExplorerTestViewlet, 'id', 'name', 'class', 5);
d = ViewletDescriptor.create(DataExplorerTestViewlet, 'id', 'name', 'class', 5);
assert.strictEqual(d.id, 'id');
assert.strictEqual(d.name, 'name');
});
@@ -45,11 +45,11 @@ suite('Data Explorer Viewlet', () => {
assert(Types.isFunction(Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).getViewlets));
let oldCount = Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).getViewlets().length;
let d = new ViewletDescriptor(DataExplorerTestViewlet, 'dataExplorer-test-id', 'name');
let d = ViewletDescriptor.create(DataExplorerTestViewlet, 'dataExplorer-test-id', 'name');
Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).registerViewlet(d);
let retrieved = Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).getViewlet('dataExplorer-test-id');
assert(d === retrieved);
let newCount = Platform.Registry.as<ViewletRegistry>(Extensions.Viewlets).getViewlets().length;
assert.equal(oldCount + 1, newCount);
});
});
});

View File

@@ -29,7 +29,7 @@ import {
import { TextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
import { IFlexibleSash, HorizontalFlexibleSash } from 'sql/workbench/contrib/query/browser/flexibleSash';
import { EditDataResultsEditor } from 'sql/workbench/contrib/editData/browser/editDataResultsEditor';
import { EditDataResultsInput } from 'sql/workbench/contrib/editData/browser/editDataResultsInput';
@@ -491,7 +491,7 @@ export class EditDataEditor extends BaseEditor {
/**
* Sets input for the SQL editor after it has been created.
*/
private _onSqlEditorCreated(sqlEditor: TextResourceEditor, sqlInput: UntitledEditorInput, options: EditorOptions): Thenable<void> {
private _onSqlEditorCreated(sqlEditor: TextResourceEditor, sqlInput: UntitledTextEditorInput, options: EditorOptions): Thenable<void> {
this._sqlEditor = sqlEditor;
return this._sqlEditor.setInput(sqlInput, options, CancellationToken.None);
}
@@ -522,7 +522,7 @@ export class EditDataEditor extends BaseEditor {
createEditors = () => {
return Promise.all([
this._createEditor(<EditDataResultsInput>newInput.results, this._resultsEditorContainer),
this._createEditor(<UntitledEditorInput>newInput.sql, this._sqlEditorContainer)
this._createEditor(<UntitledTextEditorInput>newInput.sql, this._sqlEditorContainer)
]);
};
onEditorsCreated = (result: IEditor[]) => {
@@ -535,7 +535,7 @@ export class EditDataEditor extends BaseEditor {
// If only the sql editor exists, create a promise and wait for the sql editor to be created
} else {
createEditors = () => {
return this._createEditor(<UntitledEditorInput>newInput.sql, this._sqlEditorContainer);
return this._createEditor(<UntitledTextEditorInput>newInput.sql, this._sqlEditorContainer);
};
onEditorsCreated = (result: TextResourceEditor) => {
return Promise.all([

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { EditorInput, EditorModel, ConfirmResult, EncodingMode } from 'vs/workbench/common/editor';
import { EditorInput, EditorModel, EncodingMode } from 'vs/workbench/common/editor';
import { IConnectionManagementService, IConnectableInput, INewConnectionParams } from 'sql/platform/connection/common/connectionManagement';
import { IQueryModelService } from 'sql/platform/query/common/queryModel';
import { Event, Emitter } from 'vs/base/common/event';
@@ -12,9 +12,9 @@ import { URI } from 'vs/base/common/uri';
import * as nls from 'vs/nls';
import { INotificationService } from 'vs/platform/notification/common/notification';
import Severity from 'vs/base/common/severity';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { EditDataResultsInput } from 'sql/workbench/contrib/editData/browser/editDataResultsInput';
import { IEditorViewState } from 'vs/editor/common/editorCommon';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
/**
* Input for the EditDataEditor.
@@ -38,9 +38,9 @@ export class EditDataInput extends EditorInput implements IConnectableInput {
constructor(
private _uri: URI,
private _schemaName,
private _tableName,
private _sql: UntitledEditorInput,
private _schemaName: string,
private _tableName: string,
private _sql: UntitledTextEditorInput,
private _queryString: string,
private _results: EditDataResultsInput,
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
@@ -92,7 +92,7 @@ export class EditDataInput extends EditorInput implements IConnectableInput {
public get tableName(): string { return this._tableName; }
public get schemaName(): string { return this._schemaName; }
public get uri(): string { return this._uri.toString(); }
public get sql(): UntitledEditorInput { return this._sql; }
public get sql(): UntitledTextEditorInput { return this._sql; }
public get results(): EditDataResultsInput { return this._results; }
public getResultsInputResource(): string { return this._results.uri; }
public get updateTaskbarEvent(): Event<EditDataInput> { return this._updateTaskbar.event; }
@@ -108,7 +108,6 @@ export class EditDataInput extends EditorInput implements IConnectableInput {
public showResultsEditor(): void { this._showResultsEditor.fire(undefined); }
public isDirty(): boolean { return false; }
public save(): Promise<boolean> { return Promise.resolve(false); }
public confirmSave(): Promise<ConfirmResult> { return Promise.resolve(ConfirmResult.DONT_SAVE); }
public getTypeId(): string { return EditDataInput.ID; }
public setBootstrappedTrue(): void { this._hasBootstrapped = true; }
public getResource(): URI { return this._uri; }

View File

@@ -21,7 +21,6 @@ import { SimpleEditorProgressService } from 'vs/editor/standalone/browser/simple
import { IProgressService } from 'vs/platform/progress/common/progress';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITextModel } from 'vs/editor/common/model';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import * as DOM from 'vs/base/browser/dom';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IModelService } from 'vs/editor/common/services/modelService';
@@ -30,11 +29,12 @@ import { Event, Emitter } from 'vs/base/common/event';
import { CellTypes } from 'sql/workbench/contrib/notebook/common/models/contracts';
import { OVERRIDE_EDITOR_THEMING_SETTING } from 'sql/workbench/services/notebook/browser/notebookService';
import * as notebookUtils from 'sql/workbench/contrib/notebook/browser/models/notebookUtils';
import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { ILogService } from 'vs/platform/log/common/log';
import { CollapseComponent } from 'sql/workbench/contrib/notebook/browser/cellViews/collapse.component';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
import { UntitledTextEditorModel } from 'vs/workbench/common/editor/untitledTextEditorModel';
export const CODE_SELECTOR: string = 'code-component';
const MARKDOWN_CLASS = 'markdown';
@@ -93,7 +93,7 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange
private readonly _maximumHeight = 4000;
private _cellModel: ICellModel;
private _editor: QueryTextEditor;
private _editorInput: UntitledEditorInput;
private _editorInput: UntitledTextEditorInput;
private _editorModel: ITextModel;
private _model: NotebookModel;
private _activeCellId: string;
@@ -197,11 +197,11 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange
let uri = this.cellModel.cellUri;
let cellModelSource: string;
cellModelSource = Array.isArray(this.cellModel.source) ? this.cellModel.source.join('') : this.cellModel.source;
this._editorInput = instantiationService.createInstance(UntitledEditorInput, uri, false, this.cellModel.language, cellModelSource, '');
this._editorInput = instantiationService.createInstance(UntitledTextEditorInput, uri, false, this.cellModel.language, cellModelSource, '');
await this._editor.setInput(this._editorInput, undefined);
this.setFocusAndScroll();
let untitledEditorModel: UntitledEditorModel = await this._editorInput.resolve();
let untitledEditorModel: UntitledTextEditorModel = await this._editorInput.resolve();
this._editorModel = untitledEditorModel.textEditorModel;
let isActive = this.cellModel.id === this._activeCellId;

View File

@@ -3,8 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IEditorModel } from 'vs/platform/editor/common/editor';
import { EditorInput, EditorModel, ConfirmResult } from 'vs/workbench/common/editor';
import { EditorInput, EditorModel, ISaveOptions } from 'vs/workbench/common/editor';
import { Emitter, Event } from 'vs/base/common/event';
import { URI } from 'vs/base/common/uri';
import * as resources from 'vs/base/common/resources';
@@ -16,12 +15,10 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { INotebookModel, IContentManager, NotebookContentChange } from 'sql/workbench/contrib/notebook/browser/models/modelInterfaces';
import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel';
import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel';
import { Schemas } from 'vs/base/common/network';
import { ITextFileService, ISaveOptions, StateChange } from 'vs/workbench/services/textfile/common/textfiles';
import { ITextFileService, StateChange } from 'vs/workbench/services/textfile/common/textfiles';
import { LocalContentManager } from 'sql/workbench/services/notebook/common/localContentManager';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { IDisposable } from 'vs/base/common/lifecycle';
import { NotebookChangeType } from 'sql/workbench/contrib/notebook/common/models/contracts';
@@ -29,6 +26,8 @@ import { Deferred } from 'sql/base/common/promise';
import { NotebookTextFileModel } from 'sql/workbench/contrib/notebook/browser/models/notebookTextFileModel';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel';
import { UntitledTextEditorModel } from 'vs/workbench/common/editor/untitledTextEditorModel';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel';
@@ -42,7 +41,7 @@ export class NotebookEditorModel extends EditorModel {
private readonly _onDidChangeDirty: Emitter<void> = this._register(new Emitter<void>());
private _lastEditFullReplacement: boolean;
constructor(public readonly notebookUri: URI,
private textEditorModel: TextFileEditorModel | UntitledEditorModel | ResourceEditorModel,
private textEditorModel: TextFileEditorModel | UntitledTextEditorModel | ResourceEditorModel,
@INotebookService private notebookService: INotebookService,
@ITextFileService private textFileService: ITextFileService,
@ITextResourcePropertiesService private textResourcePropertiesService: ITextResourcePropertiesService
@@ -67,7 +66,7 @@ export class NotebookEditorModel extends EditorModel {
}, err => undefined);
}
}));
if (this.textEditorModel instanceof UntitledEditorModel) {
if (this.textEditorModel instanceof UntitledTextEditorModel) {
this._register(this.textEditorModel.onDidChangeDirty(e => {
let dirty = this.textEditorModel instanceof ResourceEditorModel ? false : this.textEditorModel.isDirty();
this.setDirty(dirty);
@@ -198,7 +197,7 @@ export class NotebookEditorModel extends EditorModel {
}
}
type TextInput = ResourceEditorInput | UntitledEditorInput | FileEditorInput;
type TextInput = ResourceEditorInput | UntitledTextEditorInput | FileEditorInput;
export abstract class NotebookInput extends EditorInput {
private _providerId: string;
@@ -211,7 +210,7 @@ export abstract class NotebookInput extends EditorInput {
private _parentContainer: HTMLElement;
private readonly _layoutChanged: Emitter<void> = this._register(new Emitter<void>());
private _model: NotebookEditorModel;
private _untitledEditorModel: UntitledEditorModel;
private _untitledEditorModel: UntitledTextEditorModel;
private _contentManager: IContentManager;
private _providersLoaded: Promise<void>;
private _dirtyListener: IDisposable;
@@ -241,10 +240,6 @@ export abstract class NotebookInput extends EditorInput {
return this._textInput;
}
public confirmSave(): Promise<ConfirmResult> {
return this._textInput.confirmSave();
}
public revert(): Promise<boolean> {
return this._textInput.revert();
}
@@ -329,11 +324,11 @@ export abstract class NotebookInput extends EditorInput {
return this.resource;
}
public get untitledEditorModel(): UntitledEditorModel {
public get untitledEditorModel(): UntitledTextEditorModel {
return this._untitledEditorModel;
}
public set untitledEditorModel(value: UntitledEditorModel) {
public set untitledEditorModel(value: UntitledTextEditorModel) {
this._untitledEditorModel = value;
}
@@ -347,7 +342,7 @@ export abstract class NotebookInput extends EditorInput {
if (this._model) {
return Promise.resolve(this._model);
} else {
let textOrUntitledEditorModel: UntitledEditorModel | IEditorModel;
let textOrUntitledEditorModel: TextFileEditorModel | UntitledTextEditorModel | ResourceEditorModel;
if (this.resource.scheme === Schemas.untitled) {
if (this._untitledEditorModel) {
this._untitledEditorModel.textEditorModel.onBeforeAttached();
@@ -357,12 +352,12 @@ export abstract class NotebookInput extends EditorInput {
if (!(resolvedInput instanceof BinaryEditorModel)) {
resolvedInput.textEditorModel.onBeforeAttached();
}
textOrUntitledEditorModel = resolvedInput;
textOrUntitledEditorModel = resolvedInput as TextFileEditorModel | UntitledTextEditorModel | ResourceEditorModel;
}
} else {
const textEditorModelReference = await this.textModelService.createModelReference(this.resource);
textEditorModelReference.object.textEditorModel.onBeforeAttached();
textOrUntitledEditorModel = await textEditorModelReference.object.load();
textOrUntitledEditorModel = await textEditorModelReference.object.load() as TextFileEditorModel | ResourceEditorModel;
}
this._model = this._register(this.instantiationService.createInstance(NotebookEditorModel, this.resource, textOrUntitledEditorModel));
this.hookDirtyListener(this._model.onDidChangeDirty, () => this._onDidChangeDirty.fire());

View File

@@ -7,7 +7,6 @@ import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } fro
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { localize } from 'vs/nls';
import { IEditorInputFactoryRegistry, Extensions as EditorInputFactoryExtensions } from 'vs/workbench/common/editor';
@@ -46,6 +45,7 @@ import { IHostService } from 'vs/workbench/services/host/browser/host';
import { MarkdownOutputComponent } from 'sql/workbench/contrib/notebook/browser/outputs/markdownOutput.component';
import { registerCellComponent } from 'sql/platform/notebooks/common/outputRegistry';
import { TextCellComponent } from 'sql/workbench/contrib/notebook/browser/cellViews/textCell.component';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
Registry.as<IEditorInputFactoryRegistry>(EditorInputFactoryExtensions.EditorInputFactories)
.registerEditorInputFactory(FileNotebookInput.ID, FileNoteBookEditorInputFactory);
@@ -58,7 +58,7 @@ Registry.as<ILanguageAssociationRegistry>(LanguageAssociationExtensions.Language
const instantiationService = accessor.get(IInstantiationService);
if (editor instanceof FileEditorInput) {
return instantiationService.createInstance(FileNotebookInput, editor.getName(), editor.getResource(), editor);
} else if (editor instanceof UntitledEditorInput) {
} else if (editor instanceof UntitledTextEditorInput) {
return instantiationService.createInstance(UntitledNotebookInput, editor.getName(), editor.getResource(), editor);
} else {
return undefined;
@@ -73,7 +73,7 @@ Registry.as<IEditorRegistry>(EditorExtensions.Editors)
const actionRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionsExtensions.WorkbenchActions);
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
NewNotebookAction,
NewNotebookAction.ID,
NewNotebookAction.LABEL,

View File

@@ -10,7 +10,6 @@ import { IGridDataProvider, getResultsString } from 'sql/platform/query/common/g
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { SaveFormat } from 'sql/workbench/contrib/grid/common/interfaces';
import { IDataResource } from 'sql/workbench/services/notebook/browser/sql/sqlSessionManager';
@@ -35,6 +34,7 @@ import { ResultSerializer, SaveResultsResponse } from 'sql/workbench/contrib/que
import { ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
import { values } from 'vs/base/common/collections';
import { assign } from 'vs/base/common/objects';
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
@Component({
selector: GridOutputComponent.SELECTOR,
@@ -138,7 +138,7 @@ class DataResourceTable extends GridTableBase<any> {
@IContextMenuService contextMenuService: IContextMenuService,
@IInstantiationService instantiationService: IInstantiationService,
@IEditorService editorService: IEditorService,
@IUntitledEditorService untitledEditorService: IUntitledEditorService,
@IUntitledTextEditorService untitledEditorService: IUntitledTextEditorService,
@IConfigurationService configurationService: IConfigurationService,
@ISerializationService private _serializationService: ISerializationService
) {

View File

@@ -6,11 +6,11 @@
import { IEditorInputFactory, IEditorInputFactoryRegistry, Extensions as EditorInputExtensions } from 'vs/workbench/common/editor';
import { Registry } from 'vs/platform/registry/common/platform';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { FILE_EDITOR_INPUT_ID } from 'vs/workbench/contrib/files/common/files';
import { FileNotebookInput } from 'sql/workbench/contrib/notebook/common/models/fileNotebookInput';
import { UntitledNotebookInput } from 'sql/workbench/contrib/notebook/common/models/untitledNotebookInput';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
const editorInputFactoryRegistry = Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactories);
@@ -32,7 +32,7 @@ export class FileNoteBookEditorInputFactory implements IEditorInputFactory {
export class UntitledNoteBookEditorInputFactory implements IEditorInputFactory {
serialize(editorInput: UntitledNotebookInput): string {
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledEditorInput.ID);
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledTextEditorInput.ID);
if (factory) {
return factory.serialize(editorInput.textInput); // serialize based on the underlying input
}
@@ -40,8 +40,8 @@ export class UntitledNoteBookEditorInputFactory implements IEditorInputFactory {
}
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): UntitledNotebookInput | undefined {
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledEditorInput.ID);
const untitledEditorInput = factory.deserialize(instantiationService, serializedEditorInput) as UntitledEditorInput;
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledTextEditorInput.ID);
const untitledEditorInput = factory.deserialize(instantiationService, serializedEditorInput) as UntitledTextEditorInput;
return instantiationService.createInstance(UntitledNotebookInput, untitledEditorInput.getName(), untitledEditorInput.getResource(), untitledEditorInput);
}
}

View File

@@ -7,9 +7,9 @@ import { URI } from 'vs/base/common/uri';
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { NotebookInput } from 'sql/workbench/contrib/notebook/browser/models/notebookInput';
import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
export class UntitledNotebookInput extends NotebookInput {
public static ID: string = 'workbench.editorinputs.untitledNotebookInput';
@@ -17,7 +17,7 @@ export class UntitledNotebookInput extends NotebookInput {
constructor(
title: string,
resource: URI,
textInput: UntitledEditorInput,
textInput: UntitledTextEditorInput,
@ITextModelService textModelService: ITextModelService,
@IInstantiationService instantiationService: IInstantiationService,
@INotebookService notebookService: INotebookService,
@@ -26,14 +26,19 @@ export class UntitledNotebookInput extends NotebookInput {
super(title, resource, textInput, textModelService, instantiationService, notebookService, extensionService);
}
public get textInput(): UntitledEditorInput {
return super.textInput as UntitledEditorInput;
public get textInput(): UntitledTextEditorInput {
return super.textInput as UntitledTextEditorInput;
}
public setMode(mode: string): void {
this.textInput.setMode(mode);
}
isUntitled(): boolean {
// Subclasses need to explicitly opt-in to being untitled.
return true;
}
public getTypeId(): string {
return UntitledNotebookInput.ID;
}

View File

@@ -867,7 +867,7 @@ suite('Notebook Editor Model', function (): void {
async function createTextEditorModel(self: Mocha.ITestCallbackContext): Promise<NotebookEditorModel> {
let textFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(self, defaultUri.toString()), 'utf8', undefined);
(<TextFileEditorModelManager>accessor.textFileService.models).add(textFileEditorModel.getResource(), textFileEditorModel);
(<TextFileEditorModelManager>accessor.textFileService.models).add(textFileEditorModel.resource, textFileEditorModel);
await textFileEditorModel.load();
return new NotebookEditorModel(defaultUri, textFileEditorModel, mockNotebookService.object, accessor.textFileService, testResourcePropertiesService);
}

View File

@@ -53,11 +53,11 @@ suite('Local Content Manager', function (): void {
const fileService = new class extends TestFileService {
async readFile(resource: URI, options?: IReadFileOptions | undefined): Promise<IFileContent> {
const content = await pfs.readFile(resource.fsPath);
return { name: ',', size: 0, etag: '', mtime: 0, value: VSBuffer.fromString(content.toString()), resource };
return { name: ',', size: 0, etag: '', mtime: 0, value: VSBuffer.fromString(content.toString()), resource, ctime: 0 };
}
async writeFile(resource: URI, bufferOrReadable: VSBuffer | VSBufferReadable, options?: IWriteFileOptions): Promise<IFileStatWithMetadata> {
await pfs.writeFile(resource.fsPath, bufferOrReadable.toString());
return { resource: resource, mtime: 0, etag: '', size: 0, name: '', isDirectory: false };
return { resource: resource, mtime: 0, etag: '', size: 0, name: '', isDirectory: false, ctime: 0, isFile: true, isSymbolicLink: false };
}
};
instantiationService.set(IFileService, fileService);

View File

@@ -20,7 +20,6 @@ import { ProfilerResourceEditor } from 'sql/workbench/contrib/profiler/browser/p
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { ITextModel } from 'vs/editor/common/model';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { URI } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
import * as nls from 'vs/nls';
@@ -52,6 +51,7 @@ import { CellSelectionModel } from 'sql/base/browser/ui/table/plugins/cellSelect
import { handleCopyRequest } from 'sql/workbench/contrib/profiler/browser/profilerCopyHandler';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
import { find } from 'vs/base/common/arrays';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
class BasicView implements IView {
public get element(): HTMLElement {
@@ -120,7 +120,7 @@ export class ProfilerEditor extends BaseEditor {
private _editor: ProfilerResourceEditor;
private _editorModel: ITextModel;
private _editorInput: UntitledEditorInput;
private _editorInput: UntitledTextEditorInput;
private _splitView: SplitView;
private _container: HTMLElement;
private _body: HTMLElement;
@@ -432,7 +432,7 @@ export class ProfilerEditor extends BaseEditor {
editorContainer.className = 'profiler-editor';
this._editor.create(editorContainer);
this._editor.setVisible(true);
this._editorInput = this._instantiationService.createInstance(UntitledEditorInput, URI.from({ scheme: Schemas.untitled }), false, 'sql', '', '');
this._editorInput = this._instantiationService.createInstance(UntitledTextEditorInput, URI.from({ scheme: Schemas.untitled }), false, 'sql', '', '');
this._editor.setInput(this._editorInput, undefined);
this._editorInput.resolve().then(model => this._editorModel = model.textEditorModel);
return editorContainer;

View File

@@ -11,15 +11,13 @@ import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import * as azdata from 'azdata';
import * as nls from 'vs/nls';
import { EditorInput, ConfirmResult } from 'vs/workbench/common/editor';
import { EditorInput } from 'vs/workbench/common/editor';
import { IEditorModel } from 'vs/platform/editor/common/editor';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { Event, Emitter } from 'vs/base/common/event';
import { generateUuid } from 'vs/base/common/uuid';
import { IDialogService, IShowResult } from 'vs/platform/dialogs/common/dialogs';
import * as types from 'vs/base/common/types';
import { URI } from 'vs/base/common/uri';
import Severity from 'vs/base/common/severity';
import { FilterData } from 'sql/workbench/services/profiler/browser/profilerFilter';
import { uriPrefixes } from 'sql/platform/connection/common/utils';
import { find } from 'vs/base/common/arrays';
@@ -46,8 +44,7 @@ export class ProfilerInput extends EditorInput implements IProfilerSession {
constructor(
public connection: IConnectionProfile,
@IProfilerService private _profilerService: IProfilerService,
@INotificationService private _notificationService: INotificationService,
@IDialogService private _dialogService: IDialogService
@INotificationService private _notificationService: INotificationService
) {
super();
this._state = new ProfilerState();
@@ -282,29 +279,6 @@ export class ProfilerInput extends EditorInput implements IProfilerSession {
this.data.clearFilter();
}
confirmSave(): Promise<ConfirmResult> {
if (this.state.isRunning || this.state.isPaused) {
return this._dialogService.show(Severity.Warning,
nls.localize('confirmStopProfilerSession', "Would you like to stop the running XEvent session?"),
[
nls.localize('profilerClosingActions.yes', "Yes"),
nls.localize('profilerClosingActions.no', "No"),
nls.localize('profilerClosingActions.cancel', "Cancel")
]).then((selection: IShowResult) => {
if (selection.choice === 0) {
this._profilerService.stopSession(this.id);
return ConfirmResult.DONT_SAVE;
} else if (selection.choice === 1) {
return ConfirmResult.DONT_SAVE;
} else {
return ConfirmResult.CANCEL;
}
});
} else {
return Promise.resolve(ConfirmResult.DONT_SAVE);
}
}
isDirty(): boolean {
return this.state.isRunning || this.state.isPaused;
}

View File

@@ -6,7 +6,6 @@
import { IEditorOptions } from 'vs/editor/common/config/editorOptions';
import * as nls from 'vs/nls';
import * as DOM from 'vs/base/browser/dom';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel';
import * as editorCommon from 'vs/editor/common/editorCommon';
@@ -16,13 +15,12 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { EditorOptions } from 'vs/workbench/common/editor';
import { StandaloneCodeEditor } from 'vs/editor/standalone/browser/standaloneCodeEditor';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { CancellationToken } from 'vs/base/common/cancellation';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IHostService } from 'vs/workbench/services/host/browser/host';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
class ProfilerResourceCodeEditor extends StandaloneCodeEditor {
@@ -47,13 +45,11 @@ export class ProfilerResourceEditor extends BaseTextEditor {
@IStorageService storageService: IStorageService,
@ITextResourceConfigurationService configurationService: ITextResourceConfigurationService,
@IThemeService themeService: IThemeService,
@ITextFileService textFileService: ITextFileService,
@IEditorService protected editorService: IEditorService,
@IEditorGroupsService editorGroupService: IEditorGroupsService,
@IHostService hostService: IHostService
@IEditorGroupsService editorGroupService: IEditorGroupsService
) {
super(ProfilerResourceEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, textFileService, editorService, editorGroupService, hostService);
super(ProfilerResourceEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, editorService, editorGroupService);
}
public createEditorControl(parent: HTMLElement, configuration: IEditorOptions): editorCommon.IEditor {
@@ -79,7 +75,7 @@ export class ProfilerResourceEditor extends BaseTextEditor {
return options;
}
setInput(input: UntitledEditorInput, options: EditorOptions): Promise<void> {
setInput(input: UntitledTextEditorInput, options: EditorOptions): Promise<void> {
return super.setInput(input, options, CancellationToken.None)
.then(() => this.input.resolve()
.then(editorModel => editorModel.load())

View File

@@ -37,7 +37,6 @@ import { generateUuid } from 'vs/base/common/uuid';
import { Separator, ActionBar, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
import { isInDOM, Dimension } from 'vs/base/browser/dom';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IAction } from 'vs/base/common/actions';
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
@@ -47,6 +46,7 @@ import { IGridDataProvider } from 'sql/platform/query/common/gridDataProvider';
import { formatDocumentWithSelectedProvider, FormattingMode } from 'vs/editor/contrib/format/format';
import { CancellationToken } from 'vs/base/common/cancellation';
import { GridPanelState, GridTableState } from 'sql/workbench/contrib/query/common/gridPanelState';
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
const ROW_HEIGHT = 29;
const HEADER_HEIGHT = 26;
@@ -356,7 +356,7 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
protected contextMenuService: IContextMenuService,
protected instantiationService: IInstantiationService,
protected editorService: IEditorService,
protected untitledEditorService: IUntitledEditorService,
protected untitledEditorService: IUntitledTextEditorService,
protected configurationService: IConfigurationService
) {
super();
@@ -751,7 +751,7 @@ class GridTable<T> extends GridTableBase<T> {
@IInstantiationService instantiationService: IInstantiationService,
@IContextKeyService private contextKeyService: IContextKeyService,
@IEditorService editorService: IEditorService,
@IUntitledEditorService untitledEditorService: IUntitledEditorService,
@IUntitledTextEditorService untitledEditorService: IUntitledTextEditorService,
@IConfigurationService configurationService: IConfigurationService
) {
super(state, resultSet, contextMenuService, instantiationService, editorService, untitledEditorService, configurationService);

View File

@@ -24,7 +24,6 @@ import { isArray } from 'vs/base/common/types';
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { $, Dimension, createStyleSheet } from 'vs/base/browser/dom';
import { QueryEditor } from 'sql/workbench/contrib/query/browser/queryEditor';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
@@ -76,7 +75,6 @@ export class MessagePanel extends Disposable {
constructor(
@IInstantiationService instantiationService: IInstantiationService,
@IThemeService private readonly themeService: IThemeService,
@IClipboardService private readonly clipboardService: IClipboardService,
@IContextMenuService private readonly contextMenuService: IContextMenuService
) {
super();
@@ -107,7 +105,7 @@ export class MessagePanel extends Disposable {
selection: document.getSelection(),
tree: this.tree,
};
let copyMessageAction = instantiationService.createInstance(CopyMessagesAction, this.clipboardService);
let copyMessageAction = instantiationService.createInstance(CopyMessagesAction);
copyMessageAction.run(context);
event.preventDefault();
event.stopPropagation();
@@ -134,8 +132,8 @@ export class MessagePanel extends Disposable {
},
getActions: () => {
return [
instantiationService.createInstance(CopyMessagesAction, this.clipboardService),
instantiationService.createInstance(CopyAllMessagesAction, this.tree, this.clipboardService)
instantiationService.createInstance(CopyMessagesAction),
instantiationService.createInstance(CopyAllMessagesAction, this.tree)
];
},
getActionsContext: () => {

View File

@@ -8,7 +8,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
import { IConfigurationRegistry, Extensions as ConfigExtensions } from 'vs/platform/configuration/common/configurationRegistry';
import { IConfigurationRegistry, Extensions as ConfigExtensions, IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry';
import { SyncActionDescriptor, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
@@ -39,13 +39,13 @@ import { UntitledQueryEditorInput } from 'sql/workbench/contrib/query/common/unt
import { ILanguageAssociationRegistry, Extensions as LanguageAssociationExtensions } from 'sql/workbench/common/languageAssociation';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
import { QueryEditorInput } from 'sql/workbench/contrib/query/common/queryEditorInput';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { NewQueryTask, OE_NEW_QUERY_ACTION_ID, DE_NEW_QUERY_COMMAND_ID } from 'sql/workbench/contrib/query/browser/queryActions';
import { TreeNodeContextKey } from 'sql/workbench/contrib/objectExplorer/common/treeNodeContextKey';
import { MssqlNodeContext } from 'sql/workbench/contrib/dataExplorer/browser/mssqlNodeContext';
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
import { ManageActionContext } from 'sql/workbench/browser/actions';
import { ItemContextKey } from 'sql/workbench/contrib/dashboard/browser/widgets/explorer/explorerTreeContext';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
export const QueryEditorVisibleCondition = ContextKeyExpr.has(queryContext.queryEditorVisibleId);
export const ResultsGridFocusCondition = ContextKeyExpr.and(ContextKeyExpr.has(queryContext.resultsVisibleId), ContextKeyExpr.has(queryContext.resultsGridFocussedId));
@@ -63,7 +63,7 @@ Registry.as<ILanguageAssociationRegistry>(LanguageAssociationExtensions.Language
const queryResultsInput = instantiationService.createInstance(QueryResultsInput, editor.getResource().toString(true));
if (editor instanceof FileEditorInput) {
return instantiationService.createInstance(FileQueryEditorInput, '', editor, queryResultsInput);
} else if (editor instanceof UntitledEditorInput) {
} else if (editor instanceof UntitledTextEditorInput) {
return instantiationService.createInstance(UntitledQueryEditorInput, '', editor, queryResultsInput);
} else {
return undefined;
@@ -118,7 +118,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerWidgetContext, {
// Query Actions
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
RunQueryKeyboardAction,
RunQueryKeyboardAction.ID,
RunQueryKeyboardAction.LABEL,
@@ -135,7 +135,7 @@ MenuRegistry.appendMenuItem(MenuId.TouchBarContext, {
});
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
RunCurrentQueryKeyboardAction,
RunCurrentQueryKeyboardAction.ID,
RunCurrentQueryKeyboardAction.LABEL,
@@ -145,7 +145,7 @@ actionRegistry.registerWorkbenchAction(
);
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
RunCurrentQueryWithActualPlanKeyboardAction,
RunCurrentQueryWithActualPlanKeyboardAction.ID,
RunCurrentQueryWithActualPlanKeyboardAction.LABEL,
@@ -155,7 +155,7 @@ actionRegistry.registerWorkbenchAction(
);
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
CancelQueryKeyboardAction,
CancelQueryKeyboardAction.ID,
CancelQueryKeyboardAction.LABEL,
@@ -165,7 +165,7 @@ actionRegistry.registerWorkbenchAction(
);
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
RefreshIntellisenseKeyboardAction,
RefreshIntellisenseKeyboardAction.ID,
RefreshIntellisenseKeyboardAction.LABEL
@@ -174,7 +174,7 @@ actionRegistry.registerWorkbenchAction(
);
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
FocusOnCurrentQueryKeyboardAction,
FocusOnCurrentQueryKeyboardAction.ID,
FocusOnCurrentQueryKeyboardAction.LABEL,
@@ -184,7 +184,7 @@ actionRegistry.registerWorkbenchAction(
);
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
ParseSyntaxAction,
ParseSyntaxAction.ID,
ParseSyntaxAction.LABEL
@@ -195,7 +195,7 @@ actionRegistry.registerWorkbenchAction(
// Grid actions
actionRegistry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
ToggleQueryResultsKeyboardAction,
ToggleQueryResultsKeyboardAction.ID,
ToggleQueryResultsKeyboardAction.LABEL,
@@ -310,7 +310,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
});
// Intellisense and other configuration options
const registryProperties = {
const registryProperties: { [path: string]: IConfigurationPropertySchema; } = {
'sql.saveAsCsv.includeHeaders': {
'type': 'boolean',
'description': localize('sql.saveAsCsv.includeHeaders', "[Optional] When true, column headers are included when saving results as CSV"),
@@ -322,7 +322,7 @@ const registryProperties = {
'default': ','
},
'sql.saveAsCsv.lineSeperator': {
'type': '',
'type': 'string',
'description': localize('sql.saveAsCsv.lineSeperator', "[Optional] Character(s) used for seperating rows when saving results as CSV"),
'default': null
},

View File

@@ -14,6 +14,7 @@ import { EncodingMode } from 'vs/workbench/common/editor';
import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel';
import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel';
import { IFileService } from 'vs/platform/files/common/files';
import { ITextFileSaveOptions } from 'vs/workbench/services/textfile/common/textfiles';
type PublicPart<T> = { [K in keyof T]: T[K] };
@@ -81,6 +82,14 @@ export class FileQueryEditorInput extends QueryEditorInput implements PublicPart
this.text.setForceOpenAsBinary();
}
save(groupId: number, options?: ITextFileSaveOptions): Promise<boolean> {
return this.text.save(groupId, options);
}
saveAs(group: number, options?: ITextFileSaveOptions): Promise<boolean> {
return this.text.saveAs(group, options);
}
public isResolved(): boolean {
return this.text.isResolved();
}

View File

@@ -7,7 +7,7 @@ import { localize } from 'vs/nls';
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
import { Emitter } from 'vs/base/common/event';
import { URI } from 'vs/base/common/uri';
import { EditorInput, ConfirmResult } from 'vs/workbench/common/editor';
import { EditorInput } from 'vs/workbench/common/editor';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IFileService } from 'vs/platform/files/common/files';
@@ -186,9 +186,7 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
}
// Forwarding resource functions to the inline sql file editor
public save(): Promise<boolean> { return this._text.save(); }
public isDirty(): boolean { return this._text.isDirty(); }
public confirmSave(): Promise<ConfirmResult> { return this._text.confirmSave(); }
public getResource(): URI { return this._text.getResource(); }
public matchInputInstanceType(inputType: any): boolean {
@@ -295,15 +293,6 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
this.state.executing = false;
}
public close(): void {
this.queryModelService.disposeQuery(this.uri);
this.connectionManagementService.disconnectEditor(this, true);
this._text.close();
this._results.close();
super.close();
}
/**
* Get the color that should be displayed
*/
@@ -311,6 +300,13 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
return this.connectionManagementService.getTabColorForUri(this.uri);
}
public dispose() {
this.queryModelService.disposeQuery(this.uri);
this.connectionManagementService.disconnectEditor(this, true);
super.dispose();
}
public get isSharedSession(): boolean {
return !!(this.uri && startsWith(this.uri, 'vsls:'));
}

View File

@@ -6,12 +6,12 @@
import { IEditorInputFactory, IEditorInputFactoryRegistry, Extensions as EditorInputExtensions } from 'vs/workbench/common/editor';
import { Registry } from 'vs/platform/registry/common/platform';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { QueryResultsInput } from 'sql/workbench/contrib/query/common/queryResultsInput';
import { FILE_EDITOR_INPUT_ID } from 'vs/workbench/contrib/files/common/files';
import { UntitledQueryEditorInput } from 'sql/workbench/contrib/query/common/untitledQueryEditorInput';
import { FileQueryEditorInput } from 'sql/workbench/contrib/query/common/fileQueryEditorInput';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
const editorInputFactoryRegistry = Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactories);
@@ -34,7 +34,7 @@ export class FileQueryEditorInputFactory implements IEditorInputFactory {
export class UntitledQueryEditorInputFactory implements IEditorInputFactory {
serialize(editorInput: UntitledQueryEditorInput): string {
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledEditorInput.ID);
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledTextEditorInput.ID);
if (factory) {
return factory.serialize(editorInput.text); // serialize based on the underlying input
}
@@ -42,8 +42,8 @@ export class UntitledQueryEditorInputFactory implements IEditorInputFactory {
}
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): UntitledQueryEditorInput | undefined {
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledEditorInput.ID);
const untitledEditorInput = factory.deserialize(instantiationService, serializedEditorInput) as UntitledEditorInput;
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledTextEditorInput.ID);
const untitledEditorInput = factory.deserialize(instantiationService, serializedEditorInput) as UntitledTextEditorInput;
const queryResultsInput = instantiationService.createInstance(QueryResultsInput, untitledEditorInput.getResource().toString());
return instantiationService.createInstance(UntitledQueryEditorInput, '', untitledEditorInput, queryResultsInput);
}

View File

@@ -52,12 +52,6 @@ export class QueryResultsInput extends EditorInput {
super();
}
close() {
this.state!.dispose();
this._state = undefined;
super.close();
}
getTypeId(): string {
return QueryResultsInput.ID;
}

View File

@@ -9,15 +9,16 @@ import { IConnectionManagementService } from 'sql/platform/connection/common/con
import { IQueryModelService } from 'sql/platform/query/common/queryModel';
import { IEncodingSupport, EncodingMode } from 'vs/workbench/common/editor';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel';
import { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService';
import { IFileService } from 'vs/platform/files/common/files';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
import { UntitledTextEditorModel } from 'vs/workbench/common/editor/untitledTextEditorModel';
import { ITextFileSaveOptions } from 'vs/workbench/services/textfile/common/textfiles';
type PublicPart<T> = { [K in keyof T]: T[K] };
export class UntitledQueryEditorInput extends QueryEditorInput implements IEncodingSupport, PublicPart<UntitledEditorInput> {
export class UntitledQueryEditorInput extends QueryEditorInput implements IEncodingSupport, PublicPart<UntitledTextEditorInput> {
public static readonly ID = 'workbench.editorInput.untitledQueryInput';
@@ -26,7 +27,7 @@ export class UntitledQueryEditorInput extends QueryEditorInput implements IEncod
constructor(
description: string,
text: UntitledEditorInput,
text: UntitledTextEditorInput,
results: QueryResultsInput,
@IConnectionManagementService connectionManagementService: IConnectionManagementService,
@IQueryModelService queryModelService: IQueryModelService,
@@ -36,12 +37,12 @@ export class UntitledQueryEditorInput extends QueryEditorInput implements IEncod
super(description, text, results, connectionManagementService, queryModelService, configurationService, fileService);
}
public resolve(): Promise<UntitledEditorModel & IResolvedTextEditorModel> {
public resolve(): Promise<UntitledTextEditorModel & IResolvedTextEditorModel> {
return this.text.resolve();
}
public get text(): UntitledEditorInput {
return this._text as UntitledEditorInput;
public get text(): UntitledTextEditorInput {
return this._text as UntitledTextEditorInput;
}
public get hasAssociatedFilePath(): boolean {
@@ -72,6 +73,19 @@ export class UntitledQueryEditorInput extends QueryEditorInput implements IEncod
this.text.setEncoding(encoding, mode);
}
save(groupId: number, options?: ITextFileSaveOptions): Promise<boolean> {
return this.text.save(groupId, options);
}
saveAs(group: number, options?: ITextFileSaveOptions): Promise<boolean> {
return this.text.saveAs(group, options);
}
isUntitled(): boolean {
// Subclasses need to explicitly opt-in to being untitled.
return true;
}
hasBackup(): boolean {
if (this.text) {
return this.text.hasBackup();

View File

@@ -28,11 +28,12 @@ import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKe
import { UntitledQueryEditorInput } from 'sql/workbench/contrib/query/common/untitledQueryEditorInput';
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
import { TestQueryModelService } from 'sql/platform/query/test/common/testQueryModelService';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { URI } from 'vs/base/common/uri';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { TestConnectionManagementService } from 'sql/platform/connection/test/common/testConnectionManagementService';
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
import { SimpleUriLabelService } from 'vs/editor/standalone/browser/simpleServices';
suite('SQL QueryAction Tests', () => {
@@ -69,7 +70,7 @@ suite('SQL QueryAction Tests', () => {
connectionManagementService = TypeMoq.Mock.ofType<TestConnectionManagementService>(TestConnectionManagementService);
connectionManagementService.setup(q => q.onDisconnect).returns(() => Event.None);
const instantiationService = new TestInstantiationService();
let fileInput = new UntitledEditorInput(URI.parse('file://testUri'), false, '', '', '', instantiationService, undefined, undefined);
let fileInput = new UntitledTextEditorInput(URI.parse('file://testUri'), false, '', '', '', instantiationService, undefined, new SimpleUriLabelService(), undefined, undefined, undefined);
// Setup a reusable mock QueryInput
testQueryInput = TypeMoq.Mock.ofType(UntitledQueryEditorInput, TypeMoq.MockBehavior.Strict, undefined, fileInput, undefined, connectionManagementService.object, queryModelService.object, configurationService.object);
testQueryInput.setup(x => x.uri).returns(() => testUri);
@@ -177,7 +178,7 @@ suite('SQL QueryAction Tests', () => {
queryModelService.setup(x => x.onRunQueryStart).returns(() => Event.None);
queryModelService.setup(x => x.onRunQueryComplete).returns(() => Event.None);
const instantiationService = new TestInstantiationService();
let fileInput = new UntitledEditorInput(URI.parse('file://testUri'), false, '', '', '', instantiationService, undefined, undefined);
let fileInput = new UntitledTextEditorInput(URI.parse('file://testUri'), false, '', '', '', instantiationService, undefined, new SimpleUriLabelService(), undefined, undefined, undefined);
// ... Mock "isSelectionEmpty" in QueryEditor
let queryInput = TypeMoq.Mock.ofType(UntitledQueryEditorInput, TypeMoq.MockBehavior.Strict, undefined, fileInput, undefined, connectionManagementService.object, queryModelService.object, configurationService.object);
@@ -227,7 +228,7 @@ suite('SQL QueryAction Tests', () => {
// ... Mock "getSelection" in QueryEditor
const instantiationService = new TestInstantiationService();
let fileInput = new UntitledEditorInput(URI.parse('file://testUri'), false, '', '', '', instantiationService, undefined, undefined);
let fileInput = new UntitledTextEditorInput(URI.parse('file://testUri'), false, '', '', '', instantiationService, undefined, new SimpleUriLabelService(), undefined, undefined, undefined);
let queryInput = TypeMoq.Mock.ofType(UntitledQueryEditorInput, TypeMoq.MockBehavior.Loose, undefined, fileInput, undefined, connectionManagementService.object, queryModelService.object, configurationService.object);
queryInput.setup(x => x.uri).returns(() => testUri);

View File

@@ -7,7 +7,6 @@ import { InstantiationService } from 'vs/platform/instantiation/common/instantia
import { IEditorDescriptor } from 'vs/workbench/browser/editor';
import { URI } from 'vs/base/common/uri';
import { Memento } from 'vs/workbench/common/memento';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { QueryResultsInput } from 'sql/workbench/contrib/query/common/queryResultsInput';
import { INewConnectionParams, ConnectionType, RunQueryOnConnectionMode } from 'sql/platform/connection/common/connectionManagement';
@@ -21,9 +20,11 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
import { TestStorageService } from 'vs/workbench/test/workbenchTestServices';
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
import { UntitledQueryEditorInput } from 'sql/workbench/contrib/query/common/untitledQueryEditorInput';
import { TestQueryModelService } from 'sql/platform/query/test/common/testQueryModelService';
import { Event } from 'vs/base/common/event';
import { SimpleUriLabelService } from 'vs/editor/standalone/browser/simpleServices';
suite('SQL QueryEditor Tests', () => {
let instantiationService: TypeMoq.Mock<InstantiationService>;
@@ -284,7 +285,7 @@ suite('SQL QueryEditor Tests', () => {
return new RunQueryAction(undefined, undefined, undefined);
});
let fileInput = new UntitledEditorInput(URI.parse('file://testUri'), false, '', '', '', instantiationService.object, undefined, undefined);
let fileInput = new UntitledTextEditorInput(URI.parse('file://testUri'), false, '', '', '', instantiationService.object, undefined, new SimpleUriLabelService(), undefined, undefined, undefined);
queryModelService = TypeMoq.Mock.ofType(TestQueryModelService, TypeMoq.MockBehavior.Strict);
queryModelService.setup(x => x.disposeQuery(TypeMoq.It.isAny()));
queryModelService.setup(x => x.onRunQueryComplete).returns(() => Event.None);
@@ -321,7 +322,7 @@ suite('SQL QueryEditor Tests', () => {
test('Test that we attempt to dispose query when the queryInput is disposed', () => {
let queryResultsInput = new QueryResultsInput('testUri');
queryInput['_results'] = queryResultsInput;
queryInput.close();
queryInput.dispose();
queryModelService.verify(x => x.disposeQuery(TypeMoq.It.isAnyString()), TypeMoq.Times.once());
});
});

View File

@@ -75,14 +75,14 @@ export class OpenQueryAction extends Action {
constructor(
id: string,
label: string,
@IInstantiationService private _instantiationService
@IInstantiationService private _instantiationService: IInstantiationService
) {
super(id, label);
}
public async run(element: QueryHistoryNode): Promise<void> {
if (element instanceof QueryHistoryNode && element.info) {
return this._instantiationService.invokeFunction(openNewQuery, element.info.connectionProfile, element.info.queryText, RunQueryOnConnectionMode.none).then(() => true, () => false);
return this._instantiationService.invokeFunction(openNewQuery, element.info.connectionProfile, element.info.queryText, RunQueryOnConnectionMode.none).then();
}
}
}
@@ -94,14 +94,14 @@ export class RunQueryAction extends Action {
constructor(
id: string,
label: string,
@IInstantiationService private _instantiationService
@IInstantiationService private _instantiationService: IInstantiationService
) {
super(id, label);
}
public async run(element: QueryHistoryNode): Promise<void> {
if (element instanceof QueryHistoryNode && element.info) {
return this._instantiationService.invokeFunction(openNewQuery, element.info.connectionProfile, element.info.queryText, RunQueryOnConnectionMode.executeQuery).catch(() => true, () => false);
return this._instantiationService.invokeFunction(openNewQuery, element.info.connectionProfile, element.info.queryText, RunQueryOnConnectionMode.executeQuery).then();
}
}
}

View File

@@ -73,7 +73,7 @@ export class QueryHistoryWorkbenchContribution implements IWorkbenchContribution
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
registry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
ToggleQueryHistoryAction,
ToggleQueryHistoryAction.ID,
ToggleQueryHistoryAction.LABEL,
@@ -83,7 +83,7 @@ export class QueryHistoryWorkbenchContribution implements IWorkbenchContribution
);
// Register Output Panel
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(new PanelDescriptor(
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(PanelDescriptor.create(
QueryHistoryPanel,
QUERY_HISTORY_PANEL_ID,
localize('queryHistory', "Query History"),

View File

@@ -4,10 +4,10 @@
*--------------------------------------------------------------------------------------------*/
import { EditorInput, EditorModel } from 'vs/workbench/common/editor';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { IFileService } from 'vs/platform/files/common/files';
import { URI } from 'vs/base/common/uri';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
export class QueryPlanInput extends EditorInput {
@@ -29,7 +29,7 @@ export class QueryPlanInput extends EditorInput {
}
public getTypeId(): string {
return UntitledEditorInput.ID;
return UntitledTextEditorInput.ID;
}
public getName(): string {

View File

@@ -61,7 +61,7 @@ export class StatusUpdater extends lifecycle.Disposable implements ext.IWorkbenc
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
registry.registerWorkbenchAction(
new SyncActionDescriptor(
SyncActionDescriptor.create(
ToggleTasksAction,
ToggleTasksAction.ID,
ToggleTasksAction.LABEL,
@@ -71,7 +71,7 @@ registry.registerWorkbenchAction(
);
// Register Output Panel
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(new PanelDescriptor(
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(PanelDescriptor.create(
TasksPanel,
TASKS_PANEL_ID,
localize('tasks', "Tasks"),

View File

@@ -15,12 +15,12 @@ import { DialogModule } from 'sql/workbench/services/dialog/browser/dialog.modul
import { DialogComponentParams, LayoutRequestParams } from 'sql/workbench/services/dialog/browser/dialogContainer.component';
import * as DOM from 'vs/base/browser/dom';
import { IThemable } from 'vs/platform/theme/common/styler';
import { Disposable } from 'vs/base/common/lifecycle';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { Emitter } from 'vs/base/common/event';
import { attachTabbedPanelStyler } from 'sql/platform/theme/common/styler';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IThemable } from 'vs/base/common/styler';
export class DialogPane extends Disposable implements IThemable {
private _tabbedPanel: TabbedPanel;

View File

@@ -33,7 +33,6 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { MenuRegistry, ExecuteCommandAction } from 'vs/platform/actions/common/actions';
import { SplitView, Orientation, Sizing } from 'vs/base/browser/ui/splitview/splitview';
import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ILogService } from 'vs/platform/log/common/log';
@@ -42,13 +41,14 @@ import { IInsightsConfigDetails } from 'sql/platform/dashboard/browser/insightRe
import { TaskRegistry } from 'sql/platform/tasks/browser/tasksRegistry';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { ViewletPane, IViewletPaneOptions } from 'vs/workbench/browser/parts/views/paneViewlet';
import { onUnexpectedError } from 'vs/base/common/errors';
const labelDisplay = nls.localize("insights.item", "Item");
const valueDisplay = nls.localize("insights.value", "Value");
const iconClass = 'codicon';
class InsightTableView<T> extends ViewletPanel {
class InsightTableView<T> extends ViewletPane {
private _table: Table<T>;
public get table(): Table<T> {
return this._table;
@@ -58,7 +58,7 @@ class InsightTableView<T> extends ViewletPanel {
private columns: Slick.Column<T>[],
private data: IDisposableDataProvider<T> | Array<T>,
private tableOptions: Slick.GridOptions<T>,
options: IViewletPanelOptions,
options: IViewletPaneOptions,
@IKeybindingService keybindingService: IKeybindingService,
@IContextMenuService contextMenuService: IContextMenuService,
@IConfigurationService configurationService: IConfigurationService,
@@ -401,7 +401,7 @@ export class InsightsDialogView extends Modal {
let task = tasks.some(x => x === action);
let commandAction = MenuRegistry.getCommand(action);
if (task) {
returnActions.push(this._instantiationService.createInstance(ExecuteCommandAction, commandAction.id, commandAction.title));
returnActions.push(this._instantiationService.createInstance(ExecuteCommandAction, commandAction.id as string, commandAction.title as string));
}
}
return returnActions;

View File

@@ -25,6 +25,7 @@ import { getRandomTestPath } from 'vs/base/test/node/testUtils';
import { IWorkbenchConstructionOptions } from 'vs/workbench/workbench.web.api';
class TestEnvironmentService implements IWorkbenchEnvironmentService {
keybindingsSyncPreviewResource: URI;
argvResource: URI;
userDataSyncLogResource: URI;
settingsSyncPreviewResource: URI;

View File

@@ -10,7 +10,6 @@ import { IConnectableInput, IConnectionManagementService } from 'sql/platform/co
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
import { UntitledQueryEditorInput } from 'sql/workbench/contrib/query/common/untitledQueryEditorInput';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { URI } from 'vs/base/common/uri';
@@ -21,6 +20,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { replaceConnection } from 'sql/workbench/browser/taskUtilities';
import { EditDataResultsInput } from 'sql/workbench/contrib/editData/browser/editDataResultsInput';
import { ILogService } from 'vs/platform/log/common/log';
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
/**
* Service wrapper for opening and creating SQL documents as sql editor inputs
@@ -30,7 +30,7 @@ export class QueryEditorService implements IQueryEditorService {
public _serviceBrand: undefined;
constructor(
@IUntitledEditorService private _untitledEditorService: IUntitledEditorService,
@IUntitledTextEditorService private _untitledEditorService: IUntitledTextEditorService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IEditorService private _editorService: IEditorService,
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,

View File

@@ -10,4 +10,4 @@ import { Registry } from 'vs/platform/registry/common/platform';
// add product update and release notes contributions
Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions)
.registerWorkbenchAction(new SyncActionDescriptor(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), 'Show Getting Started');
.registerWorkbenchAction(SyncActionDescriptor.create(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), 'Show Getting Started');

View File

@@ -10,6 +10,7 @@
"alwaysStrict": true,
"strictBindCallApply": true,
"strictNullChecks": false,
"strictPropertyInitialization": false,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {

View File

@@ -14,7 +14,6 @@
},
"include": [
"typings/require.d.ts",
"typings/require-monaco.d.ts",
"typings/thenable.d.ts",
"typings/es6-promise.d.ts",
"typings/lib.es2018.promise.d.ts",

View File

@@ -1,218 +0,0 @@
/**
* The singleton meta class for the default client of the client. This class is used to setup/start and configure
* the auto-collection behavior of the application insights module.
*/
declare module ApplicationInsights {
/**
* The default client, initialized when setup was called. To initialize a different client
* with its own configuration, use `new TelemetryClient(instrumentationKey?)`.
*/
var defaultClient: TelemetryClient;
/**
* Initializes the default client. Should be called after setting
* configuration options.
*
* @param instrumentationKey the instrumentation key to use. Optional, if
* this is not specified, the value will be read from the environment
* variable APPINSIGHTS_INSTRUMENTATIONKEY.
* @returns {Configuration} the configuration class to initialize
* and start the SDK.
*/
function setup(instrumentationKey?: string): typeof Configuration;
/**
* Starts automatic collection of telemetry. Prior to calling start no
* telemetry will be *automatically* collected, though manual collection
* is enabled.
* @returns {ApplicationInsights} this class
*/
function start(): typeof Configuration;
/**
* The active configuration for global SDK behaviors, such as autocollection.
*/
class Configuration {
static start: typeof start;
/**
* Sets the state of console and logger tracking (enabled by default for third-party loggers only)
* @param value if true logger activity will be sent to Application Insights
* @param collectConsoleLog if true, logger autocollection will include console.log calls (default false)
* @returns {Configuration} this class
*/
static setAutoCollectConsole(value: boolean, collectConsoleLog?: boolean): typeof Configuration;
/**
* Sets the state of exception tracking (enabled by default)
* @param value if true uncaught exceptions will be sent to Application Insights
* @returns {Configuration} this class
*/
static setAutoCollectExceptions(value: boolean): typeof Configuration;
/**
* Sets the state of performance tracking (enabled by default)
* @param value if true performance counters will be collected every second and sent to Application Insights
* @returns {Configuration} this class
*/
static setAutoCollectPerformance(value: boolean): typeof Configuration;
/**
* Sets the state of request tracking (enabled by default)
* @param value if true requests will be sent to Application Insights
* @returns {Configuration} this class
*/
static setAutoCollectRequests(value: boolean): typeof Configuration;
/**
* Sets the state of dependency tracking (enabled by default)
* @param value if true dependencies will be sent to Application Insights
* @returns {Configuration} this class
*/
static setAutoCollectDependencies(value: boolean): typeof Configuration;
/**
* Sets the state of automatic dependency correlation (enabled by default)
* @param value if true dependencies will be correlated with requests
* @returns {Configuration} this class
*/
static setAutoDependencyCorrelation(value: boolean): typeof Configuration;
/**
* Enable or disable disk-backed retry caching to cache events when client is offline (enabled by default)
* Note that this method only applies to the default client. Disk-backed retry caching is disabled by default for additional clients.
* For enable for additional clients, use client.channel.setUseDiskRetryCaching(true).
* These cached events are stored in your system or user's temporary directory and access restricted to your user when possible.
* @param value if true events that occured while client is offline will be cached on disk
* @param resendInterval The wait interval for resending cached events.
* @param maxBytesOnDisk The maximum size (in bytes) that the created temporary directory for cache events can grow to, before caching is disabled.
* @returns {Configuration} this class
*/
static setUseDiskRetryCaching(value: boolean, resendInterval?: number, maxBytesOnDisk?: number): typeof Configuration;
/**
* Enables debug and warning logging for AppInsights itself.
* @param enableDebugLogging if true, enables debug logging
* @param enableWarningLogging if true, enables warning logging
* @returns {Configuration} this class
*/
static setInternalLogging(enableDebugLogging?: boolean, enableWarningLogging?: boolean): typeof Configuration;
}
/**
* Disposes the default client and all the auto collectors so they can be reinitialized with different configuration
*/
function dispose(): void;
interface ITelemetryClient {
config: Config;
channel: Channel;
/**
* Log a user action or other occurrence.
* @param telemetry Object encapsulating tracking options
*/
trackEvent(telemetry: EventTelemetry): void;
/**
* Immediately send all queued telemetry.
* @param options Flush options, including indicator whether app is crashing and callback
*/
flush(options?: FlushOptions): void;
}
class TelemetryClient implements ITelemetryClient {
config: Config;
channel: Channel;
/**
* Constructs a new client of the client
* @param iKey the instrumentation key to use (read from environment variable if not specified)
*/
constructor(iKey?: string);
/**
* Log a user action or other occurrence.
* @param telemetry Object encapsulating tracking options
*/
trackEvent(telemetry: EventTelemetry): void;
/**
* Immediately send all queued telemetry.
* @param options Flush options, including indicator whether app is crashing and callback
*/
flush(options?: FlushOptions): void;
}
class Config {
static ENV_azurePrefix: string;
static ENV_iKey: string;
static legacy_ENV_iKey: string;
static ENV_profileQueryEndpoint: string;
static ENV_http_proxy: string;
static ENV_https_proxy: string;
/** An identifier for your Application Insights resource */
instrumentationKey: string;
/** The id for cross-component correlation. READ ONLY. */
correlationId: string;
/** The ingestion endpoint to send telemetry payloads to */
endpointUrl: string;
/** The maximum number of telemetry items to include in a payload to the ingestion endpoint (Default 250) */
maxBatchSize: number;
/** The maximum amount of time to wait for a payload to reach maxBatchSize (Default 15000) */
maxBatchIntervalMs: number;
/** A flag indicating if telemetry transmission is disabled (Default false) */
disableAppInsights: boolean;
/** The percentage of telemetry items tracked that should be transmitted (Default 100) */
samplingPercentage: number;
/** The time to wait before retrying to retrieve the id for cross-component correlation (Default 30000) */
correlationIdRetryIntervalMs: number;
/** A list of domains to exclude from cross-component header injection */
correlationHeaderExcludedDomains: string[];
/** A proxy server for SDK HTTP traffic (Optional, Default pulled from `http_proxy` environment variable) */
proxyHttpUrl: string;
/** A proxy server for SDK HTTPS traffic (Optional, Default pulled from `https_proxy` environment variable) */
proxyHttpsUrl: string;
}
interface Channel {
/**
* Enable or disable disk-backed retry caching to cache events when client is offline (enabled by default)
* These cached events are stored in your system or user's temporary directory and access restricted to your user when possible.
* @param value if true events that occured while client is offline will be cached on disk
* @param resendInterval The wait interval for resending cached events.
* @param maxBytesOnDisk The maximum size (in bytes) that the created temporary directory for cache events can grow to, before caching is disabled.
* @returns {Configuration} this class
*/
setUseDiskRetryCaching(value: boolean, resendInterval?: number, maxBytesOnDisk?: number): void;
}
/**
* Telemetry about the custom event of interest, such application workflow event, business logic event (purchase) and anything that
* you would like to track and aggregate by count. Event can contain measurements such as purchase amount associated with purchase event
*/
interface EventTelemetry {
/**
* Name of the event
*/
name: string;
/**
* Metrics associated with this event, displayed in Metrics Explorer on the portal.
*/
measurements?: {
[key: string]: number;
};
/**
* Additional data used to filter events and metrics in the portal. Defaults to empty.
*/
properties?: {
[key: string]: string;
};
}
/**
* Encapsulates options passed into client.flush() function
*/
interface FlushOptions {
/**
* Flag indicating whether application is crashing. When this flag is set to true
* and storing data locally is enabled, Node.JS SDK will attempt to store data on disk
*/
isAppCrashing?: boolean;
/**
* Callback that will be invoked with the response from server, in case of isAppCrashing set to true,
* with immediate notification that data was stored
*/
callback?: (v: string) => void;
}
}
declare module 'applicationinsights' {
export = ApplicationInsights;
}

View File

@@ -1,59 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module '@microsoft/applicationinsights-web' {
export interface IConfig {
instrumentationKey?: string;
endpointUrl?: string;
emitLineDelimitedJson?: boolean;
accountId?: string;
sessionRenewalMs?: number;
sessionExpirationMs?: number;
maxBatchSizeInBytes?: number;
maxBatchInterval?: number;
enableDebug?: boolean;
disableExceptionTracking?: boolean;
disableTelemetry?: boolean;
verboseLogging?: boolean;
diagnosticLogInterval?: number;
samplingPercentage?: number;
autoTrackPageVisitTime?: boolean;
disableAjaxTracking?: boolean;
overridePageViewDuration?: boolean;
maxAjaxCallsPerView?: number;
disableDataLossAnalysis?: boolean;
disableCorrelationHeaders?: boolean;
correlationHeaderExcludedDomains?: string[];
disableFlushOnBeforeUnload?: boolean;
enableSessionStorageBuffer?: boolean;
isCookieUseDisabled?: boolean;
cookieDomain?: string;
isRetryDisabled?: boolean;
url?: string;
isStorageUseDisabled?: boolean;
isBeaconApiDisabled?: boolean;
sdkExtension?: string;
isBrowserLinkTrackingEnabled?: boolean;
appId?: string;
enableCorsCorrelation?: boolean;
}
export interface ISnippet {
config: IConfig;
}
export interface IEventTelemetry {
name: string;
properties?: { [key: string]: string };
measurements?: { [key: string]: number };
}
export class ApplicationInsights {
constructor(config: ISnippet);
loadAppInsights(): void;
trackEvent(data: IEventTelemetry): void;
flush(): void;
}
}

View File

@@ -1,200 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'chokidar' {
// TypeScript Version: 3.0
import * as fs from "fs";
import { EventEmitter } from "events";
/**
* The object's keys are all the directories (using absolute paths unless the `cwd` option was
* used), and the values are arrays of the names of the items contained in each directory.
*/
export interface WatchedPaths {
[directory: string]: string[];
}
export class FSWatcher extends EventEmitter implements fs.FSWatcher {
readonly options?: WatchOptions;
/**
* Constructs a new FSWatcher instance with optional WatchOptions parameter.
*/
constructor(options?: WatchOptions);
/**
* Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
* string.
*/
add(paths: string | string[]): void;
/**
* Stop watching files, directories, or glob patterns. Takes an array of strings or just one
* string.
*/
unwatch(paths: string | string[]): void;
/**
* Returns an object representing all the paths on the file system being watched by this
* `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
* the `cwd` option was used), and the values are arrays of the names of the items contained in
* each directory.
*/
getWatched(): WatchedPaths;
/**
* Removes all listeners from watched files.
*/
close(): void;
on(event: 'add' | 'addDir' | 'change', listener: (path: string, stats?: fs.Stats) => void): this;
on(event: 'all', listener: (eventName: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', path: string, stats?: fs.Stats) => void): this;
/**
* Error occured
*/
on(event: 'error', listener: (error: Error) => void): this;
/**
* Exposes the native Node `fs.FSWatcher events`
*/
on(event: 'raw', listener: (eventName: string, path: string, details: any) => void): this;
/**
* Fires when the initial scan is complete
*/
on(event: 'ready', listener: () => void): this;
on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this;
on(event: string, listener: (...args: any[]) => void): this;
}
export interface WatchOptions {
/**
* Indicates whether the process should continue to run as long as files are being watched. If
* set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
* even if the process continues to run.
*/
persistent?: boolean;
/**
* ([anymatch](https://github.com/es128/anymatch)-compatible definition) Defines files/paths to
* be ignored. The whole relative or absolute path is tested, not just filename. If a function
* with two arguments is provided, it gets called twice per path - once with a single argument
* (the path), second time with two arguments (the path and the
* [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
*/
ignored?: any;
/**
* If set to `false` then `add`/`addDir` events are also emitted for matching paths while
* instantiating the watching as chokidar discovers these file paths (before the `ready` event).
*/
ignoreInitial?: boolean;
/**
* When `false`, only the symlinks themselves will be watched for changes instead of following
* the link references and bubbling events through the link's path.
*/
followSymlinks?: boolean;
/**
* The base directory from which watch `paths` are to be derived. Paths emitted with events will
* be relative to this.
*/
cwd?: string;
/**
* If set to true then the strings passed to .watch() and .add() are treated as literal path
* names, even if they look like globs. Default: false.
*/
disableGlobbing?: boolean;
/**
* Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
* utilization, consider setting this to `false`. It is typically necessary to **set this to
* `true` to successfully watch files over a network**, and it may be necessary to successfully
* watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
* the `useFsEvents` default.
*/
usePolling?: boolean;
/**
* Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
* and `fsevents` is available this supercedes the `usePolling` setting. When set to `false` on
* OS X, `usePolling: true` becomes the default.
*/
useFsEvents?: boolean;
/**
* If relying upon the [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) object that
* may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
* provided even in cases where it wasn't already available from the underlying watch events.
*/
alwaysStat?: boolean;
/**
* If set, limits how many levels of subdirectories will be traversed.
*/
depth?: number;
/**
* Interval of file system polling.
*/
interval?: number;
/**
* Interval of file system polling for binary files. ([see list of binary extensions](https://gi
* thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
*/
binaryInterval?: number;
/**
* Indicates whether to watch files that don't have read permissions if possible. If watching
* fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
* silently.
*/
ignorePermissionErrors?: boolean;
/**
* `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts
* that occur when using editors that use "atomic writes" instead of writing directly to the
* source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
* event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
* you can override it by setting `atomic` to a custom value, in milliseconds.
*/
atomic?: boolean | number;
/**
* can be set to an object in order to adjust timing params:
*/
awaitWriteFinish?: AwaitWriteFinishOptions | boolean;
}
export interface AwaitWriteFinishOptions {
/**
* Amount of time in milliseconds for a file size to remain constant before emitting its event.
*/
stabilityThreshold?: number;
/**
* File size polling interval.
*/
pollInterval?: number;
}
/**
* produces an instance of `FSWatcher`.
*/
export function watch(
paths: string | string[],
options?: WatchOptions
): FSWatcher;
}

View File

@@ -1,4 +1,4 @@
// Type definitions for Electron 6.0.12
// Type definitions for Electron 6.1.5
// Project: http://electronjs.org/
// Definitions by: The Electron Team <https://github.com/electron/electron>
// Definitions: https://github.com/electron/electron-typescript-definitions
@@ -70,6 +70,7 @@ declare namespace Electron {
interface RendererInterface extends CommonInterface {
BrowserWindowProxy: typeof BrowserWindowProxy;
contextBridge: ContextBridge;
desktopCapturer: DesktopCapturer;
ipcRenderer: IpcRenderer;
remote: Remote;
@@ -83,6 +84,7 @@ declare namespace Electron {
const autoUpdater: AutoUpdater;
const clipboard: Clipboard;
const contentTracing: ContentTracing;
const contextBridge: ContextBridge;
const crashReporter: CrashReporter;
const desktopCapturer: DesktopCapturer;
const dialog: Dialog;
@@ -2511,6 +2513,13 @@ declare namespace Electron {
stopRecording(resultFilePath: string): Promise<string>;
}
interface ContextBridge extends EventEmitter {
// Docs: http://electronjs.org/docs/api/context-bridge
exposeInMainWorld(apiKey: string, api: Record<string, any>): void;
}
interface Cookie {
// Docs: http://electronjs.org/docs/api/structures/cookie

View File

@@ -1,8 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'graceful-fs' {
export function gracefulify(fsModule: any): void;
}

View File

@@ -1,18 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference types='node'/>
declare module 'iconv-lite' {
export function decode(buffer: Buffer, encoding: string): string;
export function encode(content: string | Buffer, encoding: string, options?: { addBOM?: boolean }): Buffer;
export function encodingExists(encoding: string): boolean;
export function decodeStream(encoding: string): NodeJS.ReadWriteStream;
export function encodeStream(encoding: string, options?: { addBOM?: boolean }): NodeJS.ReadWriteStream;
}

View File

@@ -1,11 +0,0 @@
declare module 'jschardet' {
export interface IDetectedMap {
encoding: string,
confidence: number
}
export function detect(buffer: Buffer): IDetectedMap;
export const Constants: {
MINIMUM_THRESHOLD: number,
}
}

View File

@@ -1,10 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'native-is-elevated' {
function isElevated(): boolean;
export = isElevated;
}

View File

@@ -1,93 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'native-keymap' {
export interface IWindowsKeyMapping {
vkey: string;
value: string;
withShift: string;
withAltGr: string;
withShiftAltGr: string;
}
export interface IWindowsKeyboardMapping {
[code: string]: IWindowsKeyMapping;
}
export interface ILinuxKeyMapping {
value: string;
withShift: string;
withAltGr: string;
withShiftAltGr: string;
}
export interface ILinuxKeyboardMapping {
[code: string]: ILinuxKeyMapping;
}
export interface IMacKeyMapping {
value: string;
withShift: string;
withAltGr: string;
withShiftAltGr: string;
valueIsDeadKey: boolean;
withShiftIsDeadKey: boolean;
withAltGrIsDeadKey: boolean;
withShiftAltGrIsDeadKey: boolean;
}
export interface IMacKeyboardMapping {
[code: string]: IMacKeyMapping;
}
export type IKeyboardMapping = IWindowsKeyboardMapping | ILinuxKeyboardMapping | IMacKeyboardMapping;
export function getKeyMap(): IKeyboardMapping;
/* __GDPR__FRAGMENT__
"IKeyboardLayoutInfo" : {
"name" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"id": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"text": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
export interface IWindowsKeyboardLayoutInfo {
name: string;
id: string;
text: string;
}
/* __GDPR__FRAGMENT__
"IKeyboardLayoutInfo" : {
"model" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"layout": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"variant": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"options": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"rules": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
export interface ILinuxKeyboardLayoutInfo {
model: string;
layout: string;
variant: string;
options: string;
rules: string;
}
/* __GDPR__FRAGMENT__
"IKeyboardLayoutInfo" : {
"id" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"lang": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
export interface IMacKeyboardLayoutInfo {
id: string;
lang: string;
}
export type IKeyboardLayoutInfo = IWindowsKeyboardLayoutInfo | ILinuxKeyboardLayoutInfo | IMacKeyboardLayoutInfo;
export function getCurrentKeyboardLayout(): IKeyboardLayoutInfo;
export function onDidChangeKeyboardLayout(callback: () => void): void;
export function isISOKeyboard(): boolean;
}

View File

@@ -1,17 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'native-watchdog' {
/**
* Start monitoring for a certain pid to exist.
* If the process indicated by pid ceases to execute,
* the current process will exit in 6 seconds with exit code 87
*/
export function start(pid: number): void;
export function exit(exitCode: number): void;
}

View File

@@ -1,143 +0,0 @@
/**
* Copyright (c) 2017, Daniel Imms (Source EULA).
* Copyright (c) 2018, Microsoft Corporation (Source EULA).
*/
declare module 'node-pty' {
/**
* Forks a process as a pseudoterminal.
* @param file The file to launch.
* @param args The file's arguments as argv (string[]) or in a pre-escaped CommandLine format
* (string). Note that the CommandLine option is only available on Windows and is expected to be
* escaped properly.
* @param options The options of the terminal.
* @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx
* @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
* @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx
*/
export function spawn(file: string, args: string[] | string, options: IPtyForkOptions | IWindowsPtyForkOptions): IPty;
export interface IPtyForkOptions {
name?: string;
cols?: number;
rows?: number;
cwd?: string;
env?: { [key: string]: string };
uid?: number;
gid?: number;
encoding?: string;
}
export interface IWindowsPtyForkOptions {
name?: string;
cols?: number;
rows?: number;
cwd?: string;
env?: { [key: string]: string };
encoding?: string;
/**
* Whether to use the experimental ConPTY system on Windows. When this is not set, ConPTY will
* be used when the Windows build number is >= 18309 (it's available in 17134 and 17692 but is
* too unstable to enable by default).
*
* This setting does nothing on non-Windows.
*/
experimentalUseConpty?: boolean;
/**
* Whether to use PSEUDOCONSOLE_INHERIT_CURSOR in conpty.
* @see https://docs.microsoft.com/en-us/windows/console/createpseudoconsole
*/
conptyInheritCursor?: boolean;
}
/**
* An interface representing a pseudoterminal, on Windows this is emulated via the winpty library.
*/
export interface IPty {
/**
* The process ID of the outer process.
*/
readonly pid: number;
/**
* The column size in characters.
*/
readonly cols: number;
/**
* The row size in characters.
*/
readonly rows: number;
/**
* The title of the active process.
*/
readonly process: string;
/**
* Adds an event listener for when a data event fires. This happens when data is returned from
* the pty.
* @returns an `IDisposable` to stop listening.
*/
readonly onData: IEvent<string>;
/**
* Adds an event listener for when an exit event fires. This happens when the pty exits.
* @returns an `IDisposable` to stop listening.
*/
readonly onExit: IEvent<{ exitCode: number, signal?: number }>;
/**
* Adds a listener to the data event, fired when data is returned from the pty.
* @param event The name of the event.
* @param listener The callback function.
* @deprecated Use IPty.onData
*/
on(event: 'data', listener: (data: string) => void): void;
/**
* Adds a listener to the exit event, fired when the pty exits.
* @param event The name of the event.
* @param listener The callback function, exitCode is the exit code of the process and signal is
* the signal that triggered the exit. signal is not supported on Windows.
* @deprecated Use IPty.onExit
*/
on(event: 'exit', listener: (exitCode: number, signal?: number) => void): void;
/**
* Resizes the dimensions of the pty.
* @param columns THe number of columns to use.
* @param rows The number of rows to use.
*/
resize(columns: number, rows: number): void;
/**
* Writes data to the pty.
* @param data The data to write.
*/
write(data: string): void;
/**
* Kills the pty.
* @param signal The signal to use, defaults to SIGHUP. This parameter is not supported on
* Windows.
* @throws Will throw when signal is used on Windows.
*/
kill(signal?: string): void;
}
/**
* An object that can be disposed via a dispose function.
*/
export interface IDisposable {
dispose(): void;
}
/**
* An event that can be listened to.
* @returns an `IDisposable` to stop listening.
*/
export interface IEvent<T> {
(listener: (e: T) => any): IDisposable;
}
}

41
src/typings/nsfw.d.ts vendored
View File

@@ -1,41 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'nsfw' {
interface NsfwWatcher {
start(): any;
stop(): any;
}
interface NsfwWatchingPromise {
then(): void;
}
interface NsfwStartWatchingPromise {
then(fn: (watcher: NsfwWatcher) => void): NsfwWatchingPromise;
}
interface NsfwEvent {
action: number;
directory: string;
file?: string;
newFile?: string;
newDirectory?: string;
oldFile?: string;
}
interface NsfwFunction {
(dir: string, eventHandler: (events: NsfwEvent[]) => void, options?: any): NsfwStartWatchingPromise;
actions: {
CREATED: number;
DELETED: number;
MODIFIED: number;
RENAMED: number;
}
}
var nsfw: NsfwFunction;
export = nsfw;
}

View File

@@ -1,33 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module "onigasm-umd" {
function loadWASM(data: string | ArrayBuffer): Promise<void>;
class OnigString {
constructor(content: string);
readonly content: string;
readonly dispose?: () => void;
}
class OnigScanner {
constructor(patterns: string[]);
findNextMatchSync(string: string | OnigString, startPosition: number): IOnigMatch;
}
export interface IOnigCaptureIndex {
index: number
start: number
end: number
length: number
}
export interface IOnigMatch {
index: number
captureIndices: IOnigCaptureIndex[]
scanner: OnigScanner
}
}

View File

@@ -1,12 +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 NodeRequire {
toUrl(path: string): string;
(dependencies: string[], callback: (...args: any[]) => any, errorback?: (err: any) => void): any;
config(data: any): any;
}
declare var require: NodeRequire;

View File

@@ -46,5 +46,7 @@ interface NodeRequire {
config(data: any): any;
onError: Function;
__$__nodeRequire<T>(moduleName: string): T;
getStats(): ReadonlyArray<LoaderEvent>
getStats(): ReadonlyArray<LoaderEvent>;
}
declare var require: NodeRequire;

View File

@@ -1,40 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'spdlog' {
export const version: string;
export function setAsyncMode(bufferSize: number, flushInterval: number): void;
export function createRotatingLogger(name: string, filename: string, filesize: number, filecount: number): RotatingLogger;
export function createRotatingLoggerAsync(name: string, filename: string, filesize: number, filecount: number): Promise<RotatingLogger>;
export enum LogLevel {
CRITICAL,
ERROR,
WARN,
INFO,
DEBUG,
TRACE,
OFF
}
export class RotatingLogger {
constructor(name: string, filename: string, filesize: number, filecount: number);
trace(message: string): void;
debug(message: string): void;
info(message: string): void;
warn(message: string): void;
error(message: string): void;
critical(message: string): void;
setLevel(level: number): void;
clearFormatters(): void;
/**
* A synchronous operation to flush the contents into file
*/
flush(): void;
drop(): void;
}
}

View File

@@ -1,13 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'sudo-prompt' {
type SudoOptions = {
name?: string;
icns?: string;
env?: NodeJS.ProcessEnv;
};
export function exec(cmd: string, options: SudoOptions, callback: (error: string, stdout: string, stderr: string) => void): void;
}

View File

@@ -1,55 +0,0 @@
declare module 'v8-inspect-profiler' {
export interface ProfileResult {
profile: Profile;
}
export interface Profile {
nodes: ProfileNode[];
samples?: number[];
timeDeltas?: number[];
startTime: number;
endTime: number;
}
export interface ProfileNode {
id: number;
hitCount?: number;
children?: number[];
callFrame: {
url: string;
scriptId: string;
functionName: string;
lineNumber: number;
columnNumber: number;
};
deoptReason?: string;
positionTicks?: { line: number; ticks: number }[];
}
export interface ProfilingSession {
stop(afterDelay?: number): PromiseLike<ProfileResult>;
}
export interface Target {
description: string;
devtoolsFrontendUrl: string;
id: string;
title: string;
type: string;
url: string;
webSocketDebuggerUrl: string;
}
export interface StartOptions {
port: number;
tries?: number;
retyWait?: number;
checkForPaused?: boolean;
target?: (targets: Target[]) => Target;
}
export function startProfiling(options: StartOptions): PromiseLike<ProfilingSession>;
export function writeProfile(profile: ProfileResult, name?: string): PromiseLike<void>;
export function rewriteAbsolutePaths(profile: ProfileResult, replaceWith?: string): ProfileResult;
}

View File

@@ -1,92 +0,0 @@
// Type definitions for minimist 1.2.0
// Project: https://github.com/substack/minimist
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Necroskillz <https://github.com/Necroskillz>, kamranayub <https://github.com/kamranayub>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Return an argument object populated with the array arguments from args
*
* @param args An optional argument array (typically `process.argv.slice(2)`)
* @param opts An optional options object to customize the parsing
*/
declare function minimist(args?: string[], opts?: minimist.Opts): minimist.ParsedArgs;
/**
* Return an argument object populated with the array arguments from args. Strongly-typed
* to be the intersect of type T with minimist.ParsedArgs.
*
* @type T The type that will be intersected with minimist.ParsedArgs to represent the argument object
* @param args An optional argument array (typically `process.argv.slice(2)`)
* @param opts An optional options object to customize the parsing
*/
declare function minimist<T>(args?: string[], opts?: minimist.Opts): T & minimist.ParsedArgs;
/**
* Return an argument object populated with the array arguments from args. Strongly-typed
* to be the the type T which should extend minimist.ParsedArgs
*
* @type T The type that extends minimist.ParsedArgs and represents the argument object
* @param args An optional argument array (typically `process.argv.slice(2)`)
* @param opts An optional options object to customize the parsing
*/
declare function minimist<T extends minimist.ParsedArgs>(args?: string[], opts?: minimist.Opts): T;
declare namespace minimist {
export interface Opts {
/**
* A string or array of strings argument names to always treat as strings
*/
string?: string | string[];
/**
* A boolean, string or array of strings to always treat as booleans. If true will treat
* all double hyphenated arguments without equals signs as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`)
*/
boolean?: boolean | string | string[];
/**
* An object mapping string names to strings or arrays of string argument names to use as aliases
*/
alias?: { [key: string]: string | string[] };
/**
* An object mapping string argument names to default values
*/
default?: { [key: string]: any };
/**
* When true, populate argv._ with everything after the first non-option
*/
stopEarly?: boolean;
/**
* A function which is invoked with a command line parameter not defined in the opts
* configuration object. If the function returns false, the unknown option is not added to argv
*/
unknown?: (arg: string) => boolean;
/**
* When true, populate argv._ with everything before the -- and argv['--'] with everything after the --.
* Note that with -- set, parsing for arguments still stops after the `--`.
*/
'--'?: boolean;
}
export interface ParsedArgs {
[arg: string]: any;
/**
* If opts['--'] is true, populated with everything after the --
*/
'--'?: string[];
/**
* Contains all the arguments that didn't have an option associated with them
*/
_: string[];
}
}
declare module "vscode-minimist" {
export = minimist;
}

View File

@@ -1,6 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode-proxy-agent';

View File

@@ -1,3 +0,0 @@
declare module 'vscode-ripgrep' {
export const rgPath: string;
}

View File

@@ -1,115 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Type definitions for sqlite3 3.1
// Project: http://github.com/mapbox/node-sqlite3
// Definitions by: Nick Malaguti <https://github.com/nmalaguti>
// Sumant Manne <https://github.com/dpyro>
// Behind The Math <https://github.com/BehindTheMath>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare module 'vscode-sqlite3' {
import events = require("events");
export const OPEN_READONLY: number;
export const OPEN_READWRITE: number;
export const OPEN_CREATE: number;
export const OPEN_SHAREDCACHE: number;
export const OPEN_PRIVATECACHE: number;
export const OPEN_URI: number;
export const cached: {
Database(filename: string, callback?: (this: Database, err: Error | null) => void): Database;
Database(filename: string, mode?: number, callback?: (this: Database, err: Error | null) => void): Database;
};
export interface RunResult extends Statement {
lastID: number;
changes: number;
}
export class Statement extends events.EventEmitter {
bind(callback?: (err: Error | null) => void): this;
bind(...params: any[]): this;
reset(callback?: (err: null) => void): this;
finalize(callback?: (err: Error) => void): Database;
run(callback?: (err: Error | null) => void): this;
run(params: any, callback?: (this: RunResult, err: Error | null) => void): this;
run(...params: any[]): this;
get(callback?: (err: Error | null, row?: any) => void): this;
get(params: any, callback?: (this: RunResult, err: Error | null, row?: any) => void): this;
get(...params: any[]): this;
all(callback?: (err: Error | null, rows: any[]) => void): this;
all(params: any, callback?: (this: RunResult, err: Error | null, rows: any[]) => void): this;
all(...params: any[]): this;
each(callback?: (err: Error | null, row: any) => void, complete?: (err: Error | null, count: number) => void): this;
each(params: any, callback?: (this: RunResult, err: Error | null, row: any) => void, complete?: (err: Error | null, count: number) => void): this;
each(...params: any[]): this;
}
export class Database extends events.EventEmitter {
constructor(filename: string, callback?: (err: Error | null) => void);
constructor(filename: string, mode?: number, callback?: (err: Error | null) => void);
close(callback?: (err: Error | null) => void): void;
run(sql: string, callback?: (this: RunResult, err: Error | null) => void): this;
run(sql: string, params: any, callback?: (this: RunResult, err: Error | null) => void): this;
run(sql: string, ...params: any[]): this;
get(sql: string, callback?: (this: Statement, err: Error | null, row: any) => void): this;
get(sql: string, params: any, callback?: (this: Statement, err: Error | null, row: any) => void): this;
get(sql: string, ...params: any[]): this;
all(sql: string, callback?: (this: Statement, err: Error | null, rows: any[]) => void): this;
all(sql: string, params: any, callback?: (this: Statement, err: Error | null, rows: any[]) => void): this;
all(sql: string, ...params: any[]): this;
each(sql: string, callback?: (this: Statement, err: Error | null, row: any) => void, complete?: (err: Error | null, count: number) => void): this;
each(sql: string, params: any, callback?: (this: Statement, err: Error | null, row: any) => void, complete?: (err: Error | null, count: number) => void): this;
each(sql: string, ...params: any[]): this;
exec(sql: string, callback?: (this: Statement, err: Error | null) => void): this;
prepare(sql: string, callback?: (this: Statement, err: Error | null) => void): Statement;
prepare(sql: string, params: any, callback?: (this: Statement, err: Error | null) => void): Statement;
prepare(sql: string, ...params: any[]): Statement;
serialize(callback?: () => void): void;
parallelize(callback?: () => void): void;
on(event: "trace", listener: (sql: string) => void): this;
on(event: "profile", listener: (sql: string, time: number) => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "open" | "close", listener: () => void): this;
on(event: string, listener: (...args: any[]) => void): this;
configure(option: "busyTimeout", value: number): void;
}
export function verbose(): sqlite3;
export interface sqlite3 {
OPEN_READONLY: number;
OPEN_READWRITE: number;
OPEN_CREATE: number;
OPEN_SHAREDCACHE: number;
OPEN_PRIVATECACHE: number;
OPEN_URI: number;
cached: typeof cached;
RunResult: RunResult;
Statement: typeof Statement;
Database: typeof Database;
verbose(): this;
}
}

View File

@@ -1,256 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module "vscode-textmate" {
/**
* A single theme setting.
*/
export interface IRawThemeSetting {
readonly name?: string;
readonly scope?: string | string[];
readonly settings: {
readonly fontStyle?: string;
readonly foreground?: string;
readonly background?: string;
};
}
/**
* A TextMate theme.
*/
export interface IRawTheme {
readonly name?: string;
readonly settings: IRawThemeSetting[];
}
export interface Thenable<T> extends PromiseLike<T> {
}
/**
* A registry helper that can locate grammar file paths given scope names.
*/
export interface RegistryOptions {
theme?: IRawTheme;
loadGrammar(scopeName: string): Thenable<IRawGrammar | undefined | null>;
getInjections?(scopeName: string): string[];
getOnigLib?(): Thenable<IOnigLib>;
}
/**
* A map from scope name to a language id. Please do not use language id 0.
*/
export interface IEmbeddedLanguagesMap {
[scopeName: string]: number;
}
/**
* A map from selectors to token types.
*/
export interface ITokenTypeMap {
[selector: string]: StandardTokenType;
}
export const enum StandardTokenType {
Other = 0,
Comment = 1,
String = 2,
RegEx = 4,
}
export interface IGrammarConfiguration {
embeddedLanguages?: IEmbeddedLanguagesMap;
tokenTypes?: ITokenTypeMap;
}
/**
* The registry that will hold all grammars.
*/
export class Registry {
private readonly _locator;
private readonly _syncRegistry;
constructor(locator?: RegistryOptions);
/**
* Change the theme. Once called, no previous `ruleStack` should be used anymore.
*/
setTheme(theme: IRawTheme): void;
/**
* Returns a lookup array for color ids.
*/
getColorMap(): string[];
/**
* Load the grammar for `scopeName` and all referenced included grammars asynchronously.
* Please do not use language id 0.
*/
loadGrammarWithEmbeddedLanguages(initialScopeName: string, initialLanguage: number, embeddedLanguages: IEmbeddedLanguagesMap): Thenable<IGrammar>;
/**
* Load the grammar for `scopeName` and all referenced included grammars asynchronously.
* Please do not use language id 0.
*/
loadGrammarWithConfiguration(initialScopeName: string, initialLanguage: number, configuration: IGrammarConfiguration): Thenable<IGrammar>;
/**
* Load the grammar for `scopeName` and all referenced included grammars asynchronously.
*/
loadGrammar(initialScopeName: string): Thenable<IGrammar>;
private _loadGrammar;
/**
* Adds a rawGrammar.
*/
addGrammar(rawGrammar: IRawGrammar, injections?: string[], initialLanguage?: number, embeddedLanguages?: IEmbeddedLanguagesMap): Thenable<IGrammar>;
/**
* Get the grammar for `scopeName`. The grammar must first be created via `loadGrammar` or `addGrammar`.
*/
grammarForScopeName(scopeName: string, initialLanguage?: number, embeddedLanguages?: IEmbeddedLanguagesMap, tokenTypes?: ITokenTypeMap): Thenable<IGrammar>;
}
/**
* A grammar
*/
export interface IGrammar {
/**
* Tokenize `lineText` using previous line state `prevState`.
*/
tokenizeLine(lineText: string, prevState: StackElement | null): ITokenizeLineResult;
/**
* Tokenize `lineText` using previous line state `prevState`.
* The result contains the tokens in binary format, resolved with the following information:
* - language
* - token type (regex, string, comment, other)
* - font style
* - foreground color
* - background color
* e.g. for getting the languageId: `(metadata & MetadataConsts.LANGUAGEID_MASK) >>> MetadataConsts.LANGUAGEID_OFFSET`
*/
tokenizeLine2(lineText: string, prevState: StackElement | null): ITokenizeLineResult2;
}
export interface ITokenizeLineResult {
readonly tokens: IToken[];
/**
* The `prevState` to be passed on to the next line tokenization.
*/
readonly ruleStack: StackElement;
}
/**
* Helpers to manage the "collapsed" metadata of an entire StackElement stack.
* The following assumptions have been made:
* - languageId < 256 => needs 8 bits
* - unique color count < 512 => needs 9 bits
*
* The binary format is:
* - -------------------------------------------
* 3322 2222 2222 1111 1111 1100 0000 0000
* 1098 7654 3210 9876 5432 1098 7654 3210
* - -------------------------------------------
* xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
* bbbb bbbb bfff ffff ffFF FTTT LLLL LLLL
* - -------------------------------------------
* - L = LanguageId (8 bits)
* - T = StandardTokenType (3 bits)
* - F = FontStyle (3 bits)
* - f = foreground color (9 bits)
* - b = background color (9 bits)
*/
export const enum MetadataConsts {
LANGUAGEID_MASK = 255,
TOKEN_TYPE_MASK = 1792,
FONT_STYLE_MASK = 14336,
FOREGROUND_MASK = 8372224,
BACKGROUND_MASK = 4286578688,
LANGUAGEID_OFFSET = 0,
TOKEN_TYPE_OFFSET = 8,
FONT_STYLE_OFFSET = 11,
FOREGROUND_OFFSET = 14,
BACKGROUND_OFFSET = 23,
}
export interface ITokenizeLineResult2 {
/**
* The tokens in binary format. Each token occupies two array indices. For token i:
* - at offset 2*i => startIndex
* - at offset 2*i + 1 => metadata
*
*/
readonly tokens: Uint32Array;
/**
* The `prevState` to be passed on to the next line tokenization.
*/
readonly ruleStack: StackElement;
}
export interface IToken {
startIndex: number;
readonly endIndex: number;
readonly scopes: string[];
}
/**
* **IMPORTANT** - Immutable!
*/
export interface StackElement {
_stackElementBrand: void;
readonly depth: number;
clone(): StackElement;
equals(other: StackElement): boolean;
}
export const INITIAL: StackElement;
export const parseRawGrammar: (content: string, filePath?: string) => IRawGrammar;
export interface ILocation {
readonly filename: string;
readonly line: number;
readonly char: number;
}
export interface ILocatable {
readonly $vscodeTextmateLocation?: ILocation;
}
export interface IRawGrammar extends ILocatable {
repository: IRawRepository;
readonly scopeName: string;
readonly patterns: IRawRule[];
readonly injections?: {
[expression: string]: IRawRule;
};
readonly injectionSelector?: string;
readonly fileTypes?: string[];
readonly name?: string;
readonly firstLineMatch?: string;
}
export interface IRawRepositoryMap {
[name: string]: IRawRule;
$self: IRawRule;
$base: IRawRule;
}
export type IRawRepository = IRawRepositoryMap & ILocatable;
export interface IRawRule extends ILocatable {
id?: number;
readonly include?: string;
readonly name?: string;
readonly contentName?: string;
readonly match?: string;
readonly captures?: IRawCaptures;
readonly begin?: string;
readonly beginCaptures?: IRawCaptures;
readonly end?: string;
readonly endCaptures?: IRawCaptures;
readonly while?: string;
readonly whileCaptures?: IRawCaptures;
readonly patterns?: IRawRule[];
readonly repository?: IRawRepository;
readonly applyEndPatternLast?: boolean;
}
export interface IRawCapturesMap {
[captureId: string]: IRawRule;
}
export type IRawCaptures = IRawCapturesMap & ILocatable;
export interface IOnigLib {
createOnigScanner(sources: string[]): OnigScanner;
createOnigString(sources: string): OnigString;
}
export interface IOnigCaptureIndex {
start: number;
end: number;
length: number;
}
export interface IOnigMatch {
index: number;
captureIndices: IOnigCaptureIndex[];
scanner: OnigScanner;
}
export interface OnigScanner {
findNextMatchSync(string: string | OnigString, startPosition: number): IOnigMatch;
}
export interface OnigString {
readonly content: string;
readonly dispose?: () => void;
}
}

View File

@@ -1,6 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode-windows-ca-certs';

View File

@@ -1,63 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'windows-process-tree' {
export enum ProcessDataFlag {
None = 0,
Memory = 1,
CommandLine = 2
}
export interface IProcessInfo {
pid: number;
ppid: number;
name: string;
/**
* The working set size of the process, in bytes.
*/
memory?: number;
/**
* The string returned is at most 512 chars, strings exceeding this length are truncated.
*/
commandLine?: string;
}
export interface IProcessCpuInfo extends IProcessInfo {
cpu?: number;
}
export interface IProcessTreeNode {
pid: number;
name: string;
memory?: number;
commandLine?: string;
children: IProcessTreeNode[];
}
/**
* Returns a tree of processes with the rootPid process as the root.
* @param rootPid - The pid of the process that will be the root of the tree.
* @param callback - The callback to use with the returned list of processes.
* @param flags - The flags for what process data should be included.
*/
export function getProcessTree(rootPid: number, callback: (tree: IProcessTreeNode) => void, flags?: ProcessDataFlag): void;
/**
* Returns a list of processes containing the rootPid process and all of its descendants.
* @param rootPid - The pid of the process of interest.
* @param callback - The callback to use with the returned set of processes.
* @param flags - The flags for what process data should be included.
*/
export function getProcessList(rootPid: number, callback: (processList: IProcessInfo[]) => void, flags?: ProcessDataFlag): void;
/**
* Returns the list of processes annotated with cpu usage information.
* @param processList - The list of processes.
* @param callback - The callback to use with the returned list of processes.
*/
export function getProcessCpuUsage(processList: IProcessInfo[], callback: (processListWithCpu: IProcessCpuInfo[]) => void): void;
}

View File

@@ -1,69 +0,0 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
// HACK: gulp-tsb doesn't play nice with importing from typings
// import { Terminal, ITerminalAddon } from 'xterm';
declare module 'xterm-addon-search' {
/**
* Options for a search.
*/
export interface ISearchOptions {
/**
* Whether the search term is a regex.
*/
regex?: boolean;
/**
* Whether to search for a whole word, the result is only valid if it's
* suppounded in "non-word" characters such as `_`, `(`, `)` or space.
*/
wholeWord?: boolean;
/**
* Whether the search is case sensitive.
*/
caseSensitive?: boolean;
/**
* Whether to do an indcremental search, this will expand the selection if it
* still matches the term the user typed. Note that this only affects
* `findNext`, not `findPrevious`.
*/
incremental?: boolean;
}
/**
* An xterm.js addon that provides search functionality.
*/
export class SearchAddon {
/**
* Activates the addon
* @param terminal The terminal the addon is being loaded in.
*/
public activate(terminal: any): void;
/**
* Disposes the addon.
*/
public dispose(): void;
/**
* Search forwards for the next result that matches the search term and
* options.
* @param term The search term.
* @param searchOptions The options for the search.
*/
public findNext(term: string, searchOptions?: ISearchOptions): boolean;
/**
* Search backwards for the previous result that matches the search term and
* options.
* @param term The search term.
* @param searchOptions The options for the search.
*/
public findPrevious(term: string, searchOptions?: ISearchOptions): boolean;
}
}

View File

@@ -1,71 +0,0 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
// HACK: gulp-tsb doesn't play nice with importing from typings
// import { Terminal, ITerminalAddon } from 'xterm';
interface ILinkMatcherOptions {
/**
* The index of the link from the regex.match(text) call. This defaults to 0
* (for regular expressions without capture groups).
*/
matchIndex?: number;
/**
* A callback that validates whether to create an individual link, pass
* whether the link is valid to the callback.
*/
validationCallback?: (uri: string, callback: (isValid: boolean) => void) => void;
/**
* A callback that fires when the mouse hovers over a link for a moment.
*/
tooltipCallback?: (event: MouseEvent, uri: string) => boolean | void;
/**
* A callback that fires when the mouse leaves a link. Note that this can
* happen even when tooltipCallback hasn't fired for the link yet.
*/
leaveCallback?: () => void;
/**
* The priority of the link matcher, this defines the order in which the link
* matcher is evaluated relative to others, from highest to lowest. The
* default value is 0.
*/
priority?: number;
/**
* A callback that fires when the mousedown and click events occur that
* determines whether a link will be activated upon click. This enables
* only activating a link when a certain modifier is held down, if not the
* mouse event will continue propagation (eg. double click to select word).
*/
willLinkActivate?: (event: MouseEvent, uri: string) => boolean;
}
declare module 'xterm-addon-web-links' {
/**
* An xterm.js addon that enables web links.
*/
export class WebLinksAddon {
/**
* Creates a new web links addon.
* @param handler The callback when the link is called.
* @param options Options for the link matcher.
*/
constructor(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions);
/**
* Activates the addon
* @param terminal The terminal the addon is being loaded in.
*/
public activate(terminal: any): void;
/**
* Disposes the addon.
*/
public dispose(): void;
}
}

1098
src/typings/xterm.d.ts vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,49 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'yauzl' {
import { EventEmitter } from 'events';
import { Readable } from 'stream';
export class Entry {
fileName: string;
extraFields: { id: number; data: Buffer; }[];
comment: string;
versionMadeBy: number;
versionNeededToExtract: number;
generalPurposeBitFlag: number;
compressionMethod: number;
lastModFileTime: number;
lastModFileDate: number;
crc32: number;
compressedSize: number;
uncompressedSize: number;
fileNameLength: number;
extraFieldLength: number;
fileCommentLength: number;
internalFileAttributes: number;
externalFileAttributes: number;
relativeOffsetOfLocalHeader: number;
getLastModDate(): Date;
}
export class ZipFile extends EventEmitter {
readEntry(): void;
openReadStream(entry: Entry, callback: (err?: Error, stream?: Readable) => void): void;
close(): void;
isOpen: boolean;
entryCount: number;
comment: string;
}
export interface IOptions {
autoClose?: boolean;
lazyEntries?: boolean;
}
export function open(path: string, callback: (err?: Error, zipfile?: ZipFile) => void): void;
export function open(path: string, options: IOptions | undefined, callback: (err?: Error, zipfile?: ZipFile) => void): void;
}

15
src/typings/yazl.d.ts vendored
View File

@@ -1,15 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'yazl' {
import * as stream from 'stream';
class ZipFile {
outputStream: stream.Stream;
addBuffer(buffer: Buffer, path: string): void;
addFile(localPath: string, path: string): void;
end(): void;
}
}

View File

@@ -123,20 +123,3 @@ export const isWebkitWebView = (!isChrome && !isSafari && isWebKit);
export const isIPad = (userAgent.indexOf('iPad') >= 0);
export const isEdgeWebView = isEdge && (userAgent.indexOf('WebView/') >= 0);
export const isStandalone = (window.matchMedia && window.matchMedia('(display-mode: standalone)').matches);
export function hasClipboardSupport() {
if (isIE) {
return false;
}
if (isEdge) {
let index = userAgent.indexOf('Edge/');
let version = parseInt(userAgent.substring(index + 5, userAgent.indexOf('.', index)), 10);
if (!version || (version >= 12 && version <= 16)) {
return false;
}
}
return true;
}

Some files were not shown because too many files have changed in this diff Show More