mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 03:28:33 -05:00
Merge VS Code 1.26.1 (#2394)
* Squash merge commits for 1.26 (#1) (#2323) * Polish tag search as per feedback (#55269) * Polish tag search as per feedback * Updated regex * Allow users to opt-out of features that send online requests in the background (#55097) * settings sweep #54690 * Minor css tweaks to enable eoverflow elipsis in more places (#55277) * fix an issue with titlebarheight when not scaling with zoom * Settings descriptions update #54690 * fixes #55209 * Settings editor - many padding fixes * More space above level 2 label * Fixing Cannot debug npm script using Yarn #55103 * Settings editor - show ellipsis when description overflows * Settings editor - ... fix measuring around links, relayout * Setting descriptions * Settings editor - fix ... for some short lines, fix select container width * Settings editor - overlay trees so scrollable shadow is full width * Fix #54133 - missing extension settings after reload * Settings color token description tweak * Settings editor - disable overflow indicator temporarily, needs to be faster * Added command to Run the selected npm script * fixes #54452 * fixes #54929 * fixes #55248 * prefix command with extension name * Contribute run selected to the context menu * node-debug@1.26.6 * Allow terminal rendererType to be swapped out at runtime Part of #53274 Fixes #55344 * Settings editor - fix not focusing search when restoring editor setInput must be actually async. Will be fixed naturally when we aren't using winJS promises... * Settings editor - TOC should only expand the section with a selected item * Bump node-debug2 * Settings editor - Tree focus outlines * Settings editor - don't blink the scrollbar when toc selection changes And hide TOC correctly when the editor is narrow * Settings editor - header rows should not be selectable * fixes #54877 * change debug assignee to isi * Settings sweep (#54690) * workaround for #55051 * Settings sweep (#54690) * settings sweep #54690 * Don't try closing tags when you type > after another > * Describe what implementation code lens does Fixes #55370 * fix javadoc formatter setting description * fixes #55325 * update to officical TS version * Settings editor - Even more padding, use semibold instead of bold * Fix #55357 - fix TOC twistie * fixes #55288 * explorer: refresh on di change file system provider registration fixes #53256 * Disable push to Linux repo to test standalone publisher * New env var to notify log level to extensions #54001 * Disable snippets in extension search (when not in suggest dropdown) (#55281) * Disable snippits in extension search (when not in suggest dropdown) * Add monaco input contributions * Fix bug preventing snippetSuggestions from taking effect in sub-editors * Latest emmet helper to fix #52366 * Fix comment updates for threads within same file * Allow extensions to log telemetry to log files #54001 * Pull latest css grammar * files.exclude control - use same style for "add" vs "edit" * files.exclude control - focus/keyboard behavior * don't show menubar too early * files.exclude - better styling * Place cursor at end of extensions search box on autofill (#55254) * Place cursor at end of extensions search box on autofill * Use position instead of selection * fix linux build issue (empty if block) * Settings editor - fix extension category prefixes * Settings editor - add simple ellipsis for first line that overflows, doesn't cover case when first line does not overflow but there is more text, TODO * File/Text search provider docs * Fixes #52655 * Include epoch (#55008) * Fixes #53385 * Fixes #49480 * VS Code Insiders (Users) not opening Fixes #55353 * Better handling of the case when the extension host fails to start * Fixes #53966 * Remove confusing Start from wordPartLeft commands ID * vscode-xterm@3.6.0-beta12 Fixes #55488 * Initial size is set to infinity!! Fixes #55461 * Polish embeddedEditorBackground * configuration service misses event * Fix #55224 - fix duplicate results in multiroot workspace from splitting the diskseach query * Select all not working in issue reporter on mac, fixes #55424 * Disable fuzzy matching for extensions autosuggest (#55498) * Fix clipping of extensions search border in some third party themes (#55504) * fixes #55538 * Fix bug causing an aria alert to not be shown the third time (and odd numbers thereafter) * Settings editor - work around rendering glitch with webkit-line-clamp * Settings editor - revert earlier '...' changes * Settings editor - move enumDescription to its own div, because it disturbs -webkit-line-clamp for some reason * Settings editor - better overflow indicator * Don't show existing filters in autocomplete (#55495) * Dont show existing filters in autocomplete * Simplify * Settings Editor: Add aria labels for input elements Fixes: #54836 (#55543) * fixes #55223 * Update vscode-css-languageservice to 3.0.10-next.1 * Fix #55509 - settings navigation * Fix #55519 * Fix #55520 * FIx #55524 * Fix #55556 - include wordSeparators in all search queries, so findTextInFiles can respect isWordMatch correctly * oss updates for endgame * Fix unit tests * fixes #55522 * Avoid missing manifest error from bubbling up #54757 * Settings format crawl * Search provider - Fix FileSearchProvider to return array, not progress * Fix #55598 * Settings editor - fix NPE rendering settings with no description * dont render inden guides in search box (#55600) * fixes #55454 * More settings crawl * Another change for #55598 - maxResults applies to FileSearch and TextSearch but not FileIndex * Fix FileSearchProvider unit tests for progress change * fixes #55561 * Settings description update for #54690 * Update setting descriptions for online services * Minor edits * fixes #55513 * fixes #55451 * Fix #55612 - fix findTextInFiles cancellation * fixes #55539 * More setting description tweaks * Setting to disable online experiments #54354 * fixes #55507 * fixes #55515 * Show online services action only in Insiders for now * Settings editor - change toc behavior default to 'filter' * Settings editor - nicer filter count style during search * Fix #55617 - search viewlet icons * Settings editor - better styling for element count indicator * SearchProvider - fix NPE when searching extraFileResources * Allow extends to work without json suffix Fixes #16905 * Remove accessability options logic entirely Follow up on #55451 * use latest version of DAP * fixes #55490 * fixes #55122 * fixes #52332 * Avoid assumptions about git: URIs (fixes #36236) * relative path for descriptions * resourece: get rid of isFile context key fixes #48275 * Register previous ids for compatibility (#53497) * more tuning for #48275 * no need to always re-read "files explorer" fixes #52003 * read out active composites properly fixes #51967 * Update link colors for hc theme to meet color contrast ratio, fixes #55651 Also updated link color for `textLinkActiveForeground` to be the same as `textLinkForeground` as it wasn't properly updated * detect 'winpty-agent.exe'; fixes #55672 * node-debug@1.26.7 * reset counter on new label * Settings editor - fix multiple setting links in one description * Settings editor - color code blocks in setting descriptions, fix #55532 * Settings editor - hover color in TOC * Settings editor - fix navigation NPE * Settings editor - fix text control width * Settings editor - maybe fix #55684 * Fix bug causing cursor to not move on paste * fixes #53582 * Use ctrlCmd instead of ctrl for go down from search box * fixes #55264 * fixes #55456 * filter for spcaes before triggering search (#55611) * Fix #55698 - don't lose filtered TOC counts when refreshing TOC * fixes #55421 * fixes #28979 * fixes #55576 * only add check for updates to windows/linux help * readonly files: append decoration to label fixes #53022 * debug: do not show toolbar while initialising fixes #55026 * Opening launch.json should not activate debug extensions fixes #55029 * fixes #55435 * fixes #55434 * fixes #55439 * trigger menu only on altkey up * Fix #50555 - fix settings editor memory leak * Fix #55712 - no need to focus 'a' anymore when restoring control focus after tree render * fixes #55335 * proper fix for readonly model fixes #53022 * improve FoldingRangeKind spec (for #55686) * Use class with static fields (fixes #55494) * Fixes #53671 * fixes #54630 * [html] should disable ionic suggestions by default. Currently forces deprecated Ionic v1 suggestions in .html files while typing. Fixes #53324 * cleanup deps * debug issues back to andre * update electron for smoketest * Fix #55757 - prevent settings tabs from overflowing * Fix #53897 - revert setting menu defaults to old editor * Add enum descriptions to `typescript.preferences.importModuleSpecifier` * Fix #55767 - leaking style elements from settings editor * Fix #55521 - prevent flashing when clicking in exclude control * Update Git modified color for contrast ratio, fixes #53140 * Revert "Merge branch 'master' of github.com:Microsoft/vscode" This reverts commit bf46b6bfbae0cab99c2863e1244a916181fa9fbc, reversing changes made to e275a424483dfb4ed33b428c97d5e2c441d6b917. * Revert "Revert "Merge branch 'master' of github.com:Microsoft/vscode"" This reverts commit 53949d963f39e40757557c6526332354a31d9154. * don't ask to install an incomplete menu * Fix NPE in terminal AccessibilityManager Fixes #55744 * don't display fallback menu unless we've closed the last window * fixes #55547 * Fix smoke tests for extension search box * Update OSSREADME.json for Electron 2.0.5 * Update distro Includes Chromium license changes * fix #55455 * fix #55865 * fixes #55893 * Fix bug causing workspace recommendations to go away upon ignoring a recommendation (#55805) * Fix bug causing workspace recommendations to go away upon ignoring a recommendation * ONly show on @recommended or @recommended:workspace * Make more consistant * Fix #55911 * Understand json activity (#55926) * Understand json file activity * Refactoring * adding composer.json * Distro update for experiments * use terminal.processId for auto-attach; fixes #55918 * Reject invalid URI with vscode.openFolder (for #55891) * improve win32 setup system vs user detection fixes #55840 fixes #55840 delay winreg import related to #55840 show notification earlier related to #55840 fix #55840 update inno setup message related to #55840 * Fix #55593 - this code only operates on local paths, so use fsPath and Uri.file instead * Bring back the old menu due to electron 2.0 issues (#55913) * add the old menu back for native menus * make menu labels match * `vscode.openFolder`: treat missing URI schema gracefully (for #55891) * delay EH reattach; fixes #55955 * Mark all json files under appSettingsHome as settings * Use localized strings for telemetry opt-out * Exception when saving file editor opened from remote file provider (fixes #55051) * Remove terminal menu from stable Fixes 56003 * VSCode Insiders crashes on open with TypeError: Cannot read property 'lastIndexOf' of undefined. Fixes #54933 * improve fix for #55891 * fix #55916 * Improve #55891 * increase EH debugging restart delay; fixes #55955 * Revert "Don't include non-resource entries in history quick pick" This reverts commit 37209a838e9f7e9abe6dc53ed73cdf1e03b72060. * Diff editor: horizontal scrollbar height is smaller (fixes #56062) * improve openFolder uri fix (correctly treat backslashes) * fixes #56116 repair ipc for native menubar keybindings * Fix #56240 - Open the JSON settings editor instead of the UI editor * Fix #55536 * uriDisplay: if no formatter is registered fall back to getPathlabel fixes #56104 * VSCode hangs when opening python file. Fixes #56377 * VS Code Hangs When Opening Specific PowerShell File. Fixes #56430 * Fix #56433 - search extraFileResources even when no folders open * Workaround #55649 * Fix in master #56371 * Fix tests #56371 * Fix in master #56317 * increase version to 1.26.1 * Fixes #56387: Handle SIGPIPE in extension host * fixes #56185 * Fix merge issues (part 1) * Fix build breaks (part 1) * Build breaks (part 2) * Build breaks (part 3) * More build breaks (part 4) * Fix build breaks (part 5) * WIP * Fix menus * Render query result and message panels (#2363) * Put back query editor hot exit changes * Fix grid changes that broke profiler (#2365) * Update APIs for saving query editor state * Fix restore view state for profiler and edit data * Updating custom default themes to support 4.5:1 contrast ratio * Test updates * Fix Extension Manager and Windows Setup * Update license headers * Add appveyor and travis files back * Fix hidden modal dropdown issue
This commit is contained in:
@@ -10,11 +10,13 @@ import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEdi
|
||||
import { Promise, TPromise } from 'vs/base/common/winjs.base';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
import * as resources from 'vs/base/common/resources';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService';
|
||||
import { IEditorGroup, ConfirmResult, IEditorOpeningEvent } from 'vs/workbench/common/editor';
|
||||
import { ConfirmResult, IEditorInputWithOptions, CloseDirection, IEditorIdentifier, IUntitledResourceInput, IResourceDiffInput, IResourceSideBySideInput, IEditorInput, IEditor, IEditorCloseEvent } from 'vs/workbench/common/editor';
|
||||
import { IEditorOpeningEvent, EditorServiceImpl, IEditorGroupView, EditorGroupsServiceImpl } from 'vs/workbench/browser/parts/editor/editor';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
|
||||
@@ -23,14 +25,11 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag
|
||||
import { IPartService, Parts, Position as PartPosition, IDimension } from 'vs/workbench/services/part/common/partService';
|
||||
import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService';
|
||||
import { ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
import { IEditorInput, IEditorOptions, Position, IEditor, IResourceInput } from 'vs/platform/editor/common/editor';
|
||||
import { IEditorOptions, IResourceInput } from 'vs/platform/editor/common/editor';
|
||||
import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { IWorkspaceContextService, IWorkspace as IWorkbenchWorkspace, WorkbenchState, IWorkspaceFolder, IWorkspaceFoldersChangeEvent } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkspaceContextService, IWorkspace as IWorkbenchWorkspace, WorkbenchState, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, Workspace } from 'vs/platform/workspace/common/workspace';
|
||||
import { ILifecycleService, ShutdownEvent, ShutdownReason, StartupKind, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { EditorStacksModel } from 'vs/workbench/common/editor/editorStacksModel';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { IEditorGroupService, GroupArrangement, GroupOrientation, IEditorTabOptions, IMoveOptions } from 'vs/workbench/services/group/common/groupService';
|
||||
import { TextFileService } from 'vs/workbench/services/textfile/common/textFileService';
|
||||
import { FileOperationEvent, IFileService, IResolveContentOptions, FileOperationError, IFileStat, IResolveFileResult, FileChangesEvent, IResolveFileOptions, IContent, IUpdateContentOptions, IStreamContent, ICreateFileOptions, ITextSnapshot, IResourceEncodings } from 'vs/platform/files/common/files';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
@@ -40,31 +39,43 @@ import { IRawTextContent, ITextFileService } from 'vs/workbench/services/textfil
|
||||
import { parseArgs } from 'vs/platform/environment/node/argv';
|
||||
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IWorkbenchEditorService, ICloseEditorsFilter } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IHistoryService } from 'vs/workbench/services/history/common/history';
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IInstantiationService, ServicesAccessor, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { IWindowsService, IWindowService, INativeOpenDialogOptions, IEnterWorkspaceResult, IMessageBoxResult, IWindowConfiguration } from 'vs/platform/windows/common/windows';
|
||||
import { IWindowsService, IWindowService, INativeOpenDialogOptions, IEnterWorkspaceResult, IMessageBoxResult, IWindowConfiguration, MenuBarVisibility } from 'vs/platform/windows/common/windows';
|
||||
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
|
||||
import { createTextBufferFactory } from 'vs/editor/common/model/textModel';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { isLinux } from 'vs/base/common/platform';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
|
||||
import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IWorkspaceIdentifier, IWorkspaceFolderCreationData, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IRecentlyOpened } from 'vs/platform/history/common/history';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { IPosition, Position as EditorPosition } from 'vs/editor/common/core/position';
|
||||
import { ICommandAction } from 'vs/platform/actions/common/actions';
|
||||
import { IMenuService, MenuId, IMenu, ISerializableCommandAction } from 'vs/platform/actions/common/actions';
|
||||
import { IHashService } from 'vs/workbench/services/hash/common/hashService';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||
import { ITextBufferFactory, DefaultEndOfLine, EndOfLinePreference } from 'vs/editor/common/model';
|
||||
import { MockContextKeyService, MockKeybindingService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||
import { ITextBufferFactory, DefaultEndOfLine, EndOfLinePreference, IModelDecorationOptions, ITextModel } from 'vs/editor/common/model';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { IConfirmation, IConfirmationResult, IDialogService, IDialogOptions } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
import { IExtensionService, ProfileSession, IExtensionsStatus, ExtensionPointContribution, IExtensionDescription } from '../services/extensions/common/extensions';
|
||||
import { IExtensionPoint } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IDecorationsService, IResourceDecorationChangeEvent, IDecoration, IDecorationData, IDecorationsProvider } from 'vs/workbench/services/decorations/browser/decorations';
|
||||
import { IDisposable, toDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IEditorGroupsService, IEditorGroup, GroupsOrder, GroupsArrangement, GroupDirection, IAddGroupOptions, IMergeGroupOptions, IMoveEditorOptions, ICopyEditorOptions, IEditorReplacement, IGroupChangeEvent, EditorsOrder, IFindGroupScope, EditorGroupLayout } from 'vs/workbench/services/group/common/editorGroupsService';
|
||||
import { IEditorService, IOpenEditorOverrideHandler } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { IDecorationRenderOptions } from 'vs/editor/common/editorCommon';
|
||||
import { EditorGroup } from 'vs/workbench/common/editor/editorGroup';
|
||||
import { Dimension } from 'vs/base/browser/dom';
|
||||
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
|
||||
import { IUriDisplayService, UriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
|
||||
|
||||
export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput {
|
||||
return instantiationService.createInstance(FileEditorInput, resource, void 0);
|
||||
@@ -75,7 +86,7 @@ export const TestEnvironmentService = new EnvironmentService(parseArgs(process.a
|
||||
export class TestContextService implements IWorkspaceContextService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
private workspace: IWorkbenchWorkspace;
|
||||
private workspace: Workspace;
|
||||
private options: any;
|
||||
|
||||
private readonly _onDidChangeWorkspaceName: Emitter<void>;
|
||||
@@ -122,7 +133,7 @@ export class TestContextService implements IWorkspaceContextService {
|
||||
}
|
||||
|
||||
public getWorkspaceFolder(resource: URI): IWorkspaceFolder {
|
||||
return this.isInsideWorkspace(resource) ? this.workspace.folders[0] : null;
|
||||
return this.workspace.getFolder(resource);
|
||||
}
|
||||
|
||||
public setWorkspace(workspace: any): void {
|
||||
@@ -139,7 +150,7 @@ export class TestContextService implements IWorkspaceContextService {
|
||||
|
||||
public isInsideWorkspace(resource: URI): boolean {
|
||||
if (resource && this.workspace) {
|
||||
return paths.isEqualOrParent(resource.fsPath, this.workspace.folders[0].uri.fsPath, !isLinux /* ignorecase */);
|
||||
return resources.isEqualOrParent(resource, this.workspace.folders[0].uri, resources.hasToIgnoreCase(resource));
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -150,16 +161,7 @@ export class TestContextService implements IWorkspaceContextService {
|
||||
}
|
||||
|
||||
public isCurrentWorkspace(workspaceIdentifier: ISingleFolderWorkspaceIdentifier | IWorkspaceIdentifier): boolean {
|
||||
return isSingleFolderWorkspaceIdentifier(workspaceIdentifier) && this.pathEquals(this.workspace.folders[0].uri.fsPath, workspaceIdentifier);
|
||||
}
|
||||
|
||||
private pathEquals(path1: string, path2: string): boolean {
|
||||
if (!isLinux) {
|
||||
path1 = path1.toLowerCase();
|
||||
path2 = path2.toLowerCase();
|
||||
}
|
||||
|
||||
return path1 === path2;
|
||||
return isSingleFolderWorkspaceIdentifier(workspaceIdentifier) && resources.isEqual(this.workspace.folders[0].uri, workspaceIdentifier, resources.hasToIgnoreCase(workspaceIdentifier));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +176,6 @@ export class TestTextFileService extends TextFileService {
|
||||
@ILifecycleService lifecycleService: ILifecycleService,
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
|
||||
@IFileService fileService: IFileService,
|
||||
@IUntitledEditorService untitledEditorService: IUntitledEditorService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@@ -241,15 +242,14 @@ export class TestTextFileService extends TextFileService {
|
||||
export function workbenchInstantiationService(): IInstantiationService {
|
||||
let instantiationService = new TestInstantiationService(new ServiceCollection([ILifecycleService, new TestLifecycleService()]));
|
||||
instantiationService.stub(IContextKeyService, <IContextKeyService>instantiationService.createInstance(MockContextKeyService));
|
||||
instantiationService.stub(IWorkspaceContextService, new TestContextService(TestWorkspace));
|
||||
const workspaceContextService = new TestContextService(TestWorkspace);
|
||||
instantiationService.stub(IWorkspaceContextService, workspaceContextService);
|
||||
const configService = new TestConfigurationService();
|
||||
instantiationService.stub(IConfigurationService, configService);
|
||||
instantiationService.stub(ITextResourceConfigurationService, new TestTextResourceConfigurationService(configService));
|
||||
instantiationService.stub(IUntitledEditorService, instantiationService.createInstance(UntitledEditorService));
|
||||
instantiationService.stub(IStorageService, new TestStorageService());
|
||||
instantiationService.stub(IWorkbenchEditorService, new TestEditorService());
|
||||
instantiationService.stub(IPartService, new TestPartService());
|
||||
instantiationService.stub(IEditorGroupService, new TestEditorGroupService());
|
||||
instantiationService.stub(IModeService, ModeServiceImpl);
|
||||
instantiationService.stub(IHistoryService, new TestHistoryService());
|
||||
instantiationService.stub(IModelService, instantiationService.createInstance(ModelServiceImpl));
|
||||
@@ -259,16 +259,75 @@ export function workbenchInstantiationService(): IInstantiationService {
|
||||
instantiationService.stub(INotificationService, new TestNotificationService());
|
||||
instantiationService.stub(IUntitledEditorService, instantiationService.createInstance(UntitledEditorService));
|
||||
instantiationService.stub(IWindowService, new TestWindowService());
|
||||
instantiationService.stub(IMenuService, new TestMenuService());
|
||||
instantiationService.stub(IKeybindingService, new MockKeybindingService());
|
||||
instantiationService.stub(IDecorationsService, new TestDecorationsService());
|
||||
instantiationService.stub(IExtensionService, new TestExtensionService());
|
||||
instantiationService.stub(IWindowsService, new TestWindowsService());
|
||||
instantiationService.stub(ITextFileService, <ITextFileService>instantiationService.createInstance(TestTextFileService));
|
||||
instantiationService.stub(ITextModelService, <ITextModelService>instantiationService.createInstance(TextModelResolverService));
|
||||
instantiationService.stub(IEnvironmentService, TestEnvironmentService);
|
||||
instantiationService.stub(IThemeService, new TestThemeService());
|
||||
instantiationService.stub(IHashService, new TestHashService());
|
||||
instantiationService.stub(ILogService, new TestLogService());
|
||||
instantiationService.stub(IEditorGroupsService, new TestEditorGroupsService([new TestEditorGroup(0)]));
|
||||
instantiationService.stub(IUriDisplayService, new UriDisplayService(TestEnvironmentService, workspaceContextService));
|
||||
const editorService = new TestEditorService();
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
instantiationService.stub(ICodeEditorService, new TestCodeEditorService());
|
||||
|
||||
return instantiationService;
|
||||
}
|
||||
|
||||
export class TestLogService implements ILogService {
|
||||
_serviceBrand: any; onDidChangeLogLevel: Event<LogLevel>;
|
||||
getLevel(): LogLevel { return LogLevel.Info; }
|
||||
setLevel(level: LogLevel): void { }
|
||||
trace(message: string, ...args: any[]): void { }
|
||||
debug(message: string, ...args: any[]): void { }
|
||||
info(message: string, ...args: any[]): void { }
|
||||
warn(message: string, ...args: any[]): void { }
|
||||
error(message: string | Error, ...args: any[]): void { }
|
||||
critical(message: string | Error, ...args: any[]): void { }
|
||||
dispose(): void { }
|
||||
}
|
||||
|
||||
export class TestDecorationsService implements IDecorationsService {
|
||||
_serviceBrand: any;
|
||||
onDidChangeDecorations: Event<IResourceDecorationChangeEvent> = Event.None;
|
||||
registerDecorationsProvider(provider: IDecorationsProvider): IDisposable { return Disposable.None; }
|
||||
getDecoration(uri: URI, includeChildren: boolean, overwrite?: IDecorationData): IDecoration { return void 0; }
|
||||
}
|
||||
|
||||
export class TestExtensionService implements IExtensionService {
|
||||
_serviceBrand: any;
|
||||
onDidRegisterExtensions: Event<void> = Event.None;
|
||||
onDidChangeExtensionsStatus: Event<string[]> = Event.None;
|
||||
activateByEvent(activationEvent: string): Promise<void> { return TPromise.as(void 0); }
|
||||
whenInstalledExtensionsRegistered(): Promise<boolean> { return TPromise.as(true); }
|
||||
getExtensions(): Promise<IExtensionDescription[]> { return TPromise.as([]); }
|
||||
readExtensionPointContributions<T>(extPoint: IExtensionPoint<T>): Promise<ExtensionPointContribution<T>[]> { return TPromise.as(Object.create(null)); }
|
||||
getExtensionsStatus(): { [id: string]: IExtensionsStatus; } { return Object.create(null); }
|
||||
canProfileExtensionHost(): boolean { return false; }
|
||||
startExtensionHostProfile(): Promise<ProfileSession> { return TPromise.as(Object.create(null)); }
|
||||
restartExtensionHost(): void { }
|
||||
startExtensionHost(): void { }
|
||||
stopExtensionHost(): void { }
|
||||
}
|
||||
|
||||
export class TestMenuService implements IMenuService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
createMenu(id: MenuId, scopedKeybindingService: IContextKeyService): IMenu {
|
||||
return {
|
||||
onDidChange: Event.None,
|
||||
dispose: () => void 0,
|
||||
getActions: () => []
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export class TestHistoryService implements IHistoryService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
@@ -325,12 +384,17 @@ export class TestPartService implements IPartService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
private _onTitleBarVisibilityChange = new Emitter<void>();
|
||||
private _onMenubarVisibilityChange = new Emitter<Dimension>();
|
||||
private _onEditorLayout = new Emitter<IDimension>();
|
||||
|
||||
public get onTitleBarVisibilityChange(): Event<void> {
|
||||
return this._onTitleBarVisibilityChange.event;
|
||||
}
|
||||
|
||||
public get onMenubarVisibilityChange(): Event<Dimension> {
|
||||
return this._onMenubarVisibilityChange.event;
|
||||
}
|
||||
|
||||
public get onEditorLayout(): Event<IDimension> {
|
||||
return this._onEditorLayout.event;
|
||||
}
|
||||
@@ -389,6 +453,10 @@ export class TestPartService implements IPartService {
|
||||
return false;
|
||||
}
|
||||
|
||||
public getMenubarVisibility(): MenuBarVisibility {
|
||||
return null;
|
||||
}
|
||||
|
||||
public getSideBarPosition() {
|
||||
return 0;
|
||||
}
|
||||
@@ -445,207 +513,224 @@ export class TestStorageService implements IStorageService {
|
||||
}
|
||||
}
|
||||
|
||||
export class TestEditorGroupService implements IEditorGroupService {
|
||||
public _serviceBrand: any;
|
||||
export class TestEditorGroupsService implements EditorGroupsServiceImpl {
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
|
||||
private stacksModel: EditorStacksModel;
|
||||
constructor(public groups: TestEditorGroup[] = []) { }
|
||||
|
||||
private readonly _onEditorsChanged: Emitter<void>;
|
||||
private readonly _onEditorOpening: Emitter<IEditorOpeningEvent>;
|
||||
private readonly _onEditorOpenFail: Emitter<IEditorInput>;
|
||||
private readonly _onEditorsMoved: Emitter<void>;
|
||||
private readonly _onGroupOrientationChanged: Emitter<void>;
|
||||
private readonly _onTabOptionsChanged: Emitter<IEditorTabOptions>;
|
||||
onDidActiveGroupChange: Event<IEditorGroup> = Event.None;
|
||||
onDidAddGroup: Event<IEditorGroup> = Event.None;
|
||||
onDidRemoveGroup: Event<IEditorGroup> = Event.None;
|
||||
onDidMoveGroup: Event<IEditorGroup> = Event.None;
|
||||
|
||||
constructor(callback?: (method: string) => void) {
|
||||
this._onEditorsMoved = new Emitter<void>();
|
||||
this._onEditorsChanged = new Emitter<void>();
|
||||
this._onEditorOpening = new Emitter<IEditorOpeningEvent>();
|
||||
this._onGroupOrientationChanged = new Emitter<void>();
|
||||
this._onEditorOpenFail = new Emitter<IEditorInput>();
|
||||
this._onTabOptionsChanged = new Emitter<IEditorTabOptions>();
|
||||
orientation: any;
|
||||
whenRestored: TPromise<void> = TPromise.as(void 0);
|
||||
|
||||
let services = new ServiceCollection();
|
||||
|
||||
services.set(IStorageService, new TestStorageService());
|
||||
services.set(IConfigurationService, new TestConfigurationService());
|
||||
services.set(IWorkspaceContextService, new TestContextService());
|
||||
const lifecycle = new TestLifecycleService();
|
||||
services.set(ILifecycleService, lifecycle);
|
||||
services.set(ITelemetryService, NullTelemetryService);
|
||||
|
||||
let inst = new InstantiationService(services);
|
||||
|
||||
this.stacksModel = inst.createInstance(EditorStacksModel, true);
|
||||
get activeGroup(): IEditorGroup {
|
||||
return this.groups[0];
|
||||
}
|
||||
|
||||
public fireChange(): void {
|
||||
this._onEditorsChanged.fire();
|
||||
get count(): number {
|
||||
return this.groups.length;
|
||||
}
|
||||
|
||||
public get onEditorsChanged(): Event<void> {
|
||||
return this._onEditorsChanged.event;
|
||||
getGroups(order?: GroupsOrder): ReadonlyArray<IEditorGroup> {
|
||||
return this.groups;
|
||||
}
|
||||
|
||||
public get onEditorOpening(): Event<IEditorOpeningEvent> {
|
||||
return this._onEditorOpening.event;
|
||||
getGroup(identifier: number): IEditorGroup {
|
||||
for (let i = 0; i < this.groups.length; i++) {
|
||||
if (this.groups[i].id === identifier) {
|
||||
return this.groups[i];
|
||||
}
|
||||
}
|
||||
|
||||
return void 0;
|
||||
}
|
||||
|
||||
public get onEditorOpenFail(): Event<IEditorInput> {
|
||||
return this._onEditorOpenFail.event;
|
||||
getLabel(identifier: number): string {
|
||||
return 'Group 1';
|
||||
}
|
||||
|
||||
public get onEditorGroupMoved(): Event<void> {
|
||||
return this._onEditorsMoved.event;
|
||||
findGroup(scope: IFindGroupScope, source?: number | IEditorGroup, wrap?: boolean): IEditorGroup {
|
||||
return null;
|
||||
}
|
||||
|
||||
public get onGroupOrientationChanged(): Event<void> {
|
||||
return this._onGroupOrientationChanged.event;
|
||||
activateGroup(group: number | IEditorGroup): IEditorGroup {
|
||||
return null;
|
||||
}
|
||||
|
||||
public get onTabOptionsChanged(): Event<IEditorTabOptions> {
|
||||
return this._onTabOptionsChanged.event;
|
||||
getSize(group: number | IEditorGroup): number {
|
||||
return 100;
|
||||
}
|
||||
|
||||
public focusGroup(group: IEditorGroup): void;
|
||||
public focusGroup(position: Position): void;
|
||||
public focusGroup(arg1: any): void {
|
||||
setSize(group: number | IEditorGroup, size: number): void { }
|
||||
|
||||
arrangeGroups(arrangement: GroupsArrangement): void { }
|
||||
|
||||
applyLayout(layout: EditorGroupLayout): void { }
|
||||
|
||||
setGroupOrientation(orientation: any): void { }
|
||||
|
||||
addGroup(location: number | IEditorGroup, direction: GroupDirection, options?: IAddGroupOptions): IEditorGroup {
|
||||
return null;
|
||||
}
|
||||
|
||||
public activateGroup(group: IEditorGroup): void;
|
||||
public activateGroup(position: Position): void;
|
||||
public activateGroup(arg1: any): void {
|
||||
removeGroup(group: number | IEditorGroup): void { }
|
||||
|
||||
moveGroup(group: number | IEditorGroup, location: number | IEditorGroup, direction: GroupDirection): IEditorGroup {
|
||||
return null;
|
||||
}
|
||||
|
||||
public moveGroup(from: IEditorGroup, to: IEditorGroup): void;
|
||||
public moveGroup(from: Position, to: Position): void;
|
||||
public moveGroup(arg1: any, arg2: any): void {
|
||||
|
||||
mergeGroup(group: number | IEditorGroup, target: number | IEditorGroup, options?: IMergeGroupOptions): IEditorGroup {
|
||||
return null;
|
||||
}
|
||||
|
||||
public arrangeGroups(arrangement: GroupArrangement): void {
|
||||
|
||||
}
|
||||
|
||||
public setGroupOrientation(orientation: GroupOrientation): void {
|
||||
|
||||
}
|
||||
|
||||
public getGroupOrientation(): GroupOrientation {
|
||||
return 'vertical';
|
||||
}
|
||||
|
||||
public resizeGroup(position: Position, groupSizeChange: number): void {
|
||||
|
||||
}
|
||||
|
||||
public pinEditor(group: IEditorGroup, input: IEditorInput): void;
|
||||
public pinEditor(position: Position, input: IEditorInput): void;
|
||||
public pinEditor(arg1: any, input: IEditorInput): void {
|
||||
}
|
||||
|
||||
public moveEditor(input: IEditorInput, from: IEditorGroup, to: IEditorGroup, moveOptions?: IMoveOptions): void;
|
||||
public moveEditor(input: IEditorInput, from: Position, to: Position, moveOptions?: IMoveOptions): void;
|
||||
public moveEditor(input: IEditorInput, from: any, to: any, moveOptions?: IMoveOptions): void {
|
||||
}
|
||||
|
||||
public getStacksModel(): EditorStacksModel {
|
||||
return this.stacksModel;
|
||||
}
|
||||
|
||||
public getTabOptions(): IEditorTabOptions {
|
||||
return {};
|
||||
}
|
||||
|
||||
public invokeWithinEditorContext<T>(fn: (accessor: ServicesAccessor) => T): T {
|
||||
return fn(null);
|
||||
copyGroup(group: number | IEditorGroup, location: number | IEditorGroup, direction: GroupDirection): IEditorGroup {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export class TestEditorService implements IWorkbenchEditorService {
|
||||
public _serviceBrand: any;
|
||||
export class TestEditorGroup implements IEditorGroupView {
|
||||
|
||||
public activeEditorInput: IEditorInput;
|
||||
public activeEditorOptions: IEditorOptions;
|
||||
public activeEditorPosition: Position;
|
||||
public mockLineNumber: number;
|
||||
public mockSelectedText: string;
|
||||
constructor(public id: number) { }
|
||||
|
||||
private callback: (method: string) => void;
|
||||
group: EditorGroup = void 0;
|
||||
activeControl: IEditor;
|
||||
activeEditor: IEditorInput;
|
||||
previewEditor: IEditorInput;
|
||||
count: number;
|
||||
disposed: boolean;
|
||||
editors: ReadonlyArray<IEditorInput> = [];
|
||||
label: string;
|
||||
whenRestored: Promise<void, any> = TPromise.as(void 0);
|
||||
element: HTMLElement;
|
||||
minimumWidth: number;
|
||||
maximumWidth: number;
|
||||
minimumHeight: number;
|
||||
maximumHeight: number;
|
||||
|
||||
constructor(callback?: (method: string) => void) {
|
||||
this.callback = callback || ((s: string) => { });
|
||||
this.mockLineNumber = 15;
|
||||
this.mockSelectedText = 'selected text';
|
||||
}
|
||||
|
||||
public openEditors(inputs: any[]): Promise {
|
||||
return TPromise.as([]);
|
||||
}
|
||||
|
||||
public replaceEditors(editors: any[]): TPromise<IEditor[]> {
|
||||
return TPromise.as([]);
|
||||
}
|
||||
|
||||
public closeEditors(positions?: Position[]): TPromise<void>;
|
||||
public closeEditors(position: Position, filter?: ICloseEditorsFilter): TPromise<void>;
|
||||
public closeEditors(position: Position, editors: IEditorInput[]): TPromise<void>;
|
||||
public closeEditors(editors: { positionOne?: ICloseEditorsFilter, positionTwo?: ICloseEditorsFilter, positionThree?: ICloseEditorsFilter }): TPromise<void>;
|
||||
public closeEditors(editors: { positionOne?: IEditorInput[], positionTwo?: IEditorInput[], positionThree?: IEditorInput[] }): TPromise<void>;
|
||||
public closeEditors(positionOrEditors: any, filterOrEditors?: any): TPromise<void> {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
public getActiveEditor(): IEditor {
|
||||
this.callback('getActiveEditor');
|
||||
|
||||
return {
|
||||
input: null,
|
||||
options: null,
|
||||
position: null,
|
||||
getId: () => { return null; },
|
||||
getControl: () => {
|
||||
return {
|
||||
getSelection: () => { return { positionLineNumber: this.mockLineNumber }; },
|
||||
getModel: () => { return { getValueInRange: () => this.mockSelectedText }; }
|
||||
};
|
||||
},
|
||||
focus: () => { },
|
||||
isVisible: () => { return true; }
|
||||
};
|
||||
}
|
||||
|
||||
public getActiveEditorInput(): IEditorInput {
|
||||
this.callback('getActiveEditorInput');
|
||||
|
||||
return this.activeEditorInput;
|
||||
}
|
||||
|
||||
public getVisibleEditors(): IEditor[] {
|
||||
this.callback('getVisibleEditors');
|
||||
onWillDispose: Event<void> = Event.None;
|
||||
onDidGroupChange: Event<IGroupChangeEvent> = Event.None;
|
||||
onWillCloseEditor: Event<IEditorCloseEvent> = Event.None;
|
||||
onDidCloseEditor: Event<IEditorCloseEvent> = Event.None;
|
||||
onWillOpenEditor: Event<IEditorOpeningEvent> = Event.None;
|
||||
onDidOpenEditorFail: Event<IEditorInput> = Event.None;
|
||||
onDidFocus: Event<void> = Event.None;
|
||||
onDidChange: Event<{ width: number; height: number; }> = Event.None;
|
||||
|
||||
getEditors(order?: EditorsOrder): ReadonlyArray<IEditorInput> {
|
||||
return [];
|
||||
}
|
||||
|
||||
public openEditor(input: any, options?: any, position?: any): Promise {
|
||||
this.callback('openEditor');
|
||||
getEditor(index: number): IEditorInput {
|
||||
return null;
|
||||
}
|
||||
|
||||
this.activeEditorInput = input;
|
||||
this.activeEditorOptions = options;
|
||||
this.activeEditorPosition = position;
|
||||
getIndexOfEditor(editor: IEditorInput): number {
|
||||
return -1;
|
||||
}
|
||||
|
||||
openEditor(editor: IEditorInput, options?: IEditorOptions): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
openEditors(editors: IEditorInputWithOptions[]): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
isOpened(editor: IEditorInput): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
isPinned(editor: IEditorInput): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
isActive(editor: IEditorInput): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
moveEditor(editor: IEditorInput, target: IEditorGroup, options?: IMoveEditorOptions): void { }
|
||||
|
||||
copyEditor(editor: IEditorInput, target: IEditorGroup, options?: ICopyEditorOptions): void { }
|
||||
|
||||
closeEditor(editor?: IEditorInput): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
closeEditors(editors: IEditorInput[] | { except?: IEditorInput; direction?: CloseDirection; savedOnly?: boolean; }): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
closeAllEditors(): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
replaceEditors(editors: IEditorReplacement[]): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
pinEditor(editor?: IEditorInput): void { }
|
||||
|
||||
focus(): void { }
|
||||
|
||||
invokeWithinContext<T>(fn: (accessor: ServicesAccessor) => T): T {
|
||||
return fn(null);
|
||||
}
|
||||
|
||||
isEmpty(): boolean { return true; }
|
||||
setActive(isActive: boolean): void { }
|
||||
setLabel(label: string): void { }
|
||||
shutdown(): void { }
|
||||
dispose(): void { }
|
||||
toJSON(): object { return Object.create(null); }
|
||||
layout(width: number, height: number): void { }
|
||||
relayout() { }
|
||||
}
|
||||
|
||||
export class TestEditorService implements EditorServiceImpl {
|
||||
|
||||
_serviceBrand: ServiceIdentifier<any>;
|
||||
|
||||
onDidActiveEditorChange: Event<void> = Event.None;
|
||||
onDidVisibleEditorsChange: Event<void> = Event.None;
|
||||
onDidCloseEditor: Event<IEditorCloseEvent> = Event.None;
|
||||
onDidOpenEditorFail: Event<IEditorIdentifier> = Event.None;
|
||||
|
||||
activeControl: IEditor;
|
||||
activeTextEditorWidget: any;
|
||||
activeEditor: IEditorInput;
|
||||
editors: ReadonlyArray<IEditorInput> = [];
|
||||
visibleControls: ReadonlyArray<IEditor> = [];
|
||||
visibleTextEditorWidgets = [];
|
||||
visibleEditors: ReadonlyArray<IEditorInput> = [];
|
||||
|
||||
overrideOpenEditor(handler: IOpenEditorOverrideHandler): IDisposable {
|
||||
return toDisposable(() => void 0);
|
||||
}
|
||||
|
||||
openEditor(editor: any, options?: any, group?: any) {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
public closeEditor(position: Position, input: IEditorInput): TPromise<void> {
|
||||
this.callback('closeEditor');
|
||||
|
||||
openEditors(editors: any, group?: any) {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
public createInput(input: IResourceInput): IEditorInput {
|
||||
isOpen(editor: IEditorInput | IResourceInput | IUntitledResourceInput): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
replaceEditors(editors: any, group: any) {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
invokeWithinEditorContext<T>(fn: (accessor: ServicesAccessor) => T): T {
|
||||
return fn(null);
|
||||
}
|
||||
|
||||
createInput(input: IResourceInput | IUntitledResourceInput | IResourceDiffInput | IResourceSideBySideInput): IEditorInput {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -769,10 +854,6 @@ export class TestFileService implements IFileService {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
rename(resource: URI, newName: string): TPromise<IFileStat> {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
onDidChangeFileSystemProviderRegistrations = Event.None;
|
||||
|
||||
registerProvider(scheme: string, provider) {
|
||||
@@ -783,7 +864,7 @@ export class TestFileService implements IFileService {
|
||||
return resource.scheme === 'file';
|
||||
}
|
||||
|
||||
del(resource: URI, useTrash?: boolean): TPromise<void> {
|
||||
del(resource: URI, options?: { useTrash?: boolean, recursive?: boolean }): TPromise<void> {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
@@ -804,8 +885,6 @@ export class TestFileService implements IFileService {
|
||||
export class TestBackupFileService implements IBackupFileService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
public backupEnabled: boolean;
|
||||
|
||||
public hasBackups(): TPromise<boolean> {
|
||||
return TPromise.as(false);
|
||||
}
|
||||
@@ -864,16 +943,45 @@ export class TestBackupFileService implements IBackupFileService {
|
||||
}
|
||||
}
|
||||
|
||||
export class TestCodeEditorService implements ICodeEditorService {
|
||||
_serviceBrand: any;
|
||||
|
||||
onCodeEditorAdd: Event<ICodeEditor> = Event.None;
|
||||
onCodeEditorRemove: Event<ICodeEditor> = Event.None;
|
||||
onDiffEditorAdd: Event<IDiffEditor> = Event.None;
|
||||
onDiffEditorRemove: Event<IDiffEditor> = Event.None;
|
||||
|
||||
addCodeEditor(editor: ICodeEditor): void { }
|
||||
removeCodeEditor(editor: ICodeEditor): void { }
|
||||
listCodeEditors(): ICodeEditor[] { return []; }
|
||||
addDiffEditor(editor: IDiffEditor): void { }
|
||||
removeDiffEditor(editor: IDiffEditor): void { }
|
||||
listDiffEditors(): IDiffEditor[] { return []; }
|
||||
getFocusedCodeEditor(): ICodeEditor { return null; }
|
||||
registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void { }
|
||||
removeDecorationType(key: string): void { }
|
||||
resolveDecorationOptions(typeKey: string, writable: boolean): IModelDecorationOptions { return Object.create(null); }
|
||||
setTransientModelProperty(model: ITextModel, key: string, value: any): void { }
|
||||
getTransientModelProperty(model: ITextModel, key: string) { }
|
||||
getActiveCodeEditor(): ICodeEditor { return null; }
|
||||
openCodeEditor(input: IResourceInput, source: ICodeEditor, sideBySide?: boolean): TPromise<ICodeEditor> { return TPromise.as(null); }
|
||||
}
|
||||
|
||||
export class TestWindowService implements IWindowService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
onDidChangeFocus: Event<boolean> = new Emitter<boolean>().event;
|
||||
onDidChangeMaximize: Event<boolean>;
|
||||
|
||||
isFocused(): TPromise<boolean> {
|
||||
return TPromise.as(false);
|
||||
}
|
||||
|
||||
isMaximized(): TPromise<boolean> {
|
||||
return TPromise.as(false);
|
||||
}
|
||||
|
||||
getConfiguration(): IWindowConfiguration {
|
||||
return Object.create(null);
|
||||
}
|
||||
@@ -914,6 +1022,10 @@ export class TestWindowService implements IWindowService {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
enterWorkspace(path: string): TPromise<IEnterWorkspaceResult> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
createAndEnterWorkspace(folders?: IWorkspaceFolderCreationData[], path?: string): TPromise<IEnterWorkspaceResult> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
@@ -938,6 +1050,22 @@ export class TestWindowService implements IWindowService {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
maximizeWindow(): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
unmaximizeWindow(): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
minimizeWindow(): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
openWindow(paths: URI[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
closeWindow(): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
@@ -966,7 +1094,7 @@ export class TestWindowService implements IWindowService {
|
||||
return TPromise.wrap(void 0);
|
||||
}
|
||||
|
||||
updateTouchBar(items: ICommandAction[][]): Promise<void> {
|
||||
updateTouchBar(items: ISerializableCommandAction[][]): Promise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
}
|
||||
@@ -981,7 +1109,7 @@ export class TestLifecycleService implements ILifecycleService {
|
||||
private _onWillShutdown = new Emitter<ShutdownEvent>();
|
||||
private _onShutdown = new Emitter<ShutdownReason>();
|
||||
|
||||
when(): Thenable<void> {
|
||||
when(): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
@@ -1011,6 +1139,9 @@ export class TestWindowsService implements IWindowsService {
|
||||
onWindowOpen: Event<number>;
|
||||
onWindowFocus: Event<number>;
|
||||
onWindowBlur: Event<number>;
|
||||
onWindowMaximize: Event<number>;
|
||||
onWindowUnmaximize: Event<number>;
|
||||
onRecentlyOpenedChange: Event<void>;
|
||||
|
||||
isFocused(windowId: number): TPromise<boolean> {
|
||||
return TPromise.as(false);
|
||||
@@ -1048,6 +1179,10 @@ export class TestWindowsService implements IWindowsService {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
enterWorkspace(windowId: number, path: string): TPromise<IEnterWorkspaceResult> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
createAndEnterWorkspace(windowId: number, folders?: IWorkspaceFolderCreationData[], path?: string): TPromise<IEnterWorkspaceResult> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
@@ -1096,6 +1231,10 @@ export class TestWindowsService implements IWindowsService {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
minimizeWindow(windowId: number): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
unmaximizeWindow(windowId: number): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
@@ -1125,7 +1264,7 @@ export class TestWindowsService implements IWindowsService {
|
||||
}
|
||||
|
||||
// Global methods
|
||||
openWindow(paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }): TPromise<void> {
|
||||
openWindow(windowId: number, paths: URI[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean, forceOpenWorkspaceAsFile?: boolean }): TPromise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
@@ -1137,7 +1276,7 @@ export class TestWindowsService implements IWindowsService {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
getWindows(): TPromise<{ id: number; workspace?: IWorkspaceIdentifier; folderPath?: string; title: string; filename?: string; }[]> {
|
||||
getWindows(): TPromise<{ id: number; workspace?: IWorkspaceIdentifier; folderUri?: ISingleFolderWorkspaceIdentifier; title: string; filename?: string; }[]> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
@@ -1173,10 +1312,14 @@ export class TestWindowsService implements IWindowsService {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
updateTouchBar(windowId: number, items: ICommandAction[][]): Promise<void> {
|
||||
updateTouchBar(windowId: number, items: ISerializableCommandAction[][]): Promise<void> {
|
||||
return TPromise.as(void 0);
|
||||
}
|
||||
|
||||
getActiveWindowId(): TPromise<number | undefined> {
|
||||
return TPromise.as(undefined);
|
||||
}
|
||||
|
||||
// This needs to be handled from browser process to prevent
|
||||
// foreground ordering issues on Windows
|
||||
openExternal(url: string): TPromise<boolean> {
|
||||
|
||||
Reference in New Issue
Block a user