mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode d06f0e877ceaf3a35a283f1bfdc50927ec8dfd1e (#8767)
This commit is contained in:
@@ -122,7 +122,7 @@ suite.skip('BackupModelRestorer', () => { // {{SQL CARBON EDIT}} TODO @anthonydr
|
||||
|
||||
// Verify backups restored and opened as dirty
|
||||
await restorer.doRestoreBackups();
|
||||
assert.equal(editorService.editors.length, 4);
|
||||
assert.equal(editorService.count, 4);
|
||||
assert.ok(editorService.editors.every(editor => editor.isDirty()));
|
||||
|
||||
let counter = 0;
|
||||
|
||||
@@ -13,14 +13,14 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionRegistryExtensions } from 'vs/workbench/common/actions';
|
||||
import { ShowViewletAction, Extensions as ViewletExtensions, ViewletRegistry, ViewletDescriptor } from 'vs/workbench/browser/viewlet';
|
||||
import { ShowViewletAction } from 'vs/workbench/browser/viewlet';
|
||||
import { TogglePanelAction, Extensions as PanelExtensions, PanelRegistry, PanelDescriptor } from 'vs/workbench/browser/panel';
|
||||
import { BreakpointsView } from 'vs/workbench/contrib/debug/browser/breakpointsView';
|
||||
import { CallStackView } from 'vs/workbench/contrib/debug/browser/callStackView';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
import {
|
||||
IDebugService, VIEWLET_ID, REPL_ID, CONTEXT_IN_DEBUG_MODE, INTERNAL_CONSOLE_OPTIONS_SCHEMA,
|
||||
CONTEXT_DEBUG_STATE, VARIABLES_VIEW_ID, CALLSTACK_VIEW_ID, WATCH_VIEW_ID, BREAKPOINTS_VIEW_ID, VIEW_CONTAINER, LOADED_SCRIPTS_VIEW_ID, CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_STEP_BACK_SUPPORTED, CONTEXT_CALLSTACK_ITEM_TYPE, CONTEXT_RESTART_FRAME_SUPPORTED, CONTEXT_JUMP_TO_CURSOR_SUPPORTED, CONTEXT_DEBUG_UX,
|
||||
CONTEXT_DEBUG_STATE, VARIABLES_VIEW_ID, CALLSTACK_VIEW_ID, WATCH_VIEW_ID, BREAKPOINTS_VIEW_ID, LOADED_SCRIPTS_VIEW_ID, CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_FOCUSED_SESSION_IS_ATTACH, CONTEXT_STEP_BACK_SUPPORTED, CONTEXT_CALLSTACK_ITEM_TYPE, CONTEXT_RESTART_FRAME_SUPPORTED, CONTEXT_JUMP_TO_CURSOR_SUPPORTED, CONTEXT_DEBUG_UX,
|
||||
} from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
@@ -31,7 +31,7 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { registerCommands, ADD_CONFIGURATION_ID, TOGGLE_INLINE_BREAKPOINT_ID, COPY_STACK_TRACE_ID, REVERSE_CONTINUE_ID, STEP_BACK_ID, RESTART_SESSION_ID, TERMINATE_THREAD_ID, STEP_OVER_ID, STEP_INTO_ID, STEP_OUT_ID, PAUSE_ID, DISCONNECT_ID, STOP_ID, RESTART_FRAME_ID, CONTINUE_ID, FOCUS_REPL_ID, JUMP_TO_CURSOR_ID, RESTART_LABEL, STEP_INTO_LABEL, STEP_OVER_LABEL, STEP_OUT_LABEL, PAUSE_LABEL, DISCONNECT_LABEL, STOP_LABEL, CONTINUE_LABEL } from 'vs/workbench/contrib/debug/browser/debugCommands';
|
||||
import { IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen';
|
||||
import { StatusBarColorProvider } from 'vs/workbench/contrib/debug/browser/statusbarColorProvider';
|
||||
import { IViewsRegistry, Extensions as ViewExtensions } from 'vs/workbench/common/views';
|
||||
import { IViewsRegistry, Extensions as ViewExtensions, IViewContainersRegistry, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
@@ -46,9 +46,9 @@ import { WatchExpressionsView } from 'vs/workbench/contrib/debug/browser/watchEx
|
||||
import { VariablesView } from 'vs/workbench/contrib/debug/browser/variablesView';
|
||||
import { ClearReplAction, Repl } from 'vs/workbench/contrib/debug/browser/repl';
|
||||
import { DebugContentProvider } from 'vs/workbench/contrib/debug/common/debugContentProvider';
|
||||
import { DebugViewlet } from 'vs/workbench/contrib/debug/browser/debugViewlet';
|
||||
import { StartView } from 'vs/workbench/contrib/debug/browser/startView';
|
||||
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||
import { DebugViewPaneContainer } from 'vs/workbench/contrib/debug/browser/debugViewlet';
|
||||
|
||||
class OpenDebugViewletAction extends ShowViewletAction {
|
||||
public static readonly ID = VIEWLET_ID;
|
||||
@@ -79,14 +79,13 @@ class OpenDebugPanelAction extends TogglePanelAction {
|
||||
}
|
||||
}
|
||||
|
||||
// register viewlet
|
||||
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).registerViewlet(ViewletDescriptor.create(
|
||||
DebugViewlet,
|
||||
VIEWLET_ID,
|
||||
VIEW_CONTAINER.name,
|
||||
'codicon-debug-alt',
|
||||
13 // {{SQL CARBON EDIT}}
|
||||
));
|
||||
const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
|
||||
id: VIEWLET_ID,
|
||||
name: nls.localize('debugAndRun', "Debug and Run"),
|
||||
ctorDescriptor: { ctor: DebugViewPaneContainer },
|
||||
icon: 'codicon-debug-alt',
|
||||
order: 13 // {{SQL CARBON EDIT}}
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
const openViewletKb: IKeybindings = {
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_D
|
||||
@@ -107,12 +106,12 @@ Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(PanelDescriptor
|
||||
|
||||
// Register default debug views
|
||||
const viewsRegistry = Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry);
|
||||
viewsRegistry.registerViews([{ id: VARIABLES_VIEW_ID, name: nls.localize('variables', "Variables"), ctorDescriptor: { ctor: VariablesView }, order: 10, weight: 40, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusVariablesView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], VIEW_CONTAINER);
|
||||
viewsRegistry.registerViews([{ id: WATCH_VIEW_ID, name: nls.localize('watch', "Watch"), ctorDescriptor: { ctor: WatchExpressionsView }, order: 20, weight: 10, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusWatchView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], VIEW_CONTAINER);
|
||||
viewsRegistry.registerViews([{ id: CALLSTACK_VIEW_ID, name: nls.localize('callStack', "Call Stack"), ctorDescriptor: { ctor: CallStackView }, order: 30, weight: 30, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusCallStackView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], VIEW_CONTAINER);
|
||||
viewsRegistry.registerViews([{ id: BREAKPOINTS_VIEW_ID, name: nls.localize('breakpoints', "Breakpoints"), ctorDescriptor: { ctor: BreakpointsView }, order: 40, weight: 20, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusBreakpointsView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], VIEW_CONTAINER);
|
||||
viewsRegistry.registerViews([{ id: StartView.ID, name: StartView.LABEL, ctorDescriptor: { ctor: StartView }, order: 10, weight: 40, canToggleVisibility: true, when: CONTEXT_DEBUG_UX.isEqualTo('simple') }], VIEW_CONTAINER);
|
||||
viewsRegistry.registerViews([{ id: LOADED_SCRIPTS_VIEW_ID, name: nls.localize('loadedScripts', "Loaded Scripts"), ctorDescriptor: { ctor: LoadedScriptsView }, order: 35, weight: 5, canToggleVisibility: true, collapsed: true, when: ContextKeyExpr.and(CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_DEBUG_UX.isEqualTo('default')) }], VIEW_CONTAINER);
|
||||
viewsRegistry.registerViews([{ id: VARIABLES_VIEW_ID, name: nls.localize('variables', "Variables"), ctorDescriptor: { ctor: VariablesView }, order: 10, weight: 40, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusVariablesView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
|
||||
viewsRegistry.registerViews([{ id: WATCH_VIEW_ID, name: nls.localize('watch', "Watch"), ctorDescriptor: { ctor: WatchExpressionsView }, order: 20, weight: 10, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusWatchView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
|
||||
viewsRegistry.registerViews([{ id: CALLSTACK_VIEW_ID, name: nls.localize('callStack', "Call Stack"), ctorDescriptor: { ctor: CallStackView }, order: 30, weight: 30, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusCallStackView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
|
||||
viewsRegistry.registerViews([{ id: BREAKPOINTS_VIEW_ID, name: nls.localize('breakpoints', "Breakpoints"), ctorDescriptor: { ctor: BreakpointsView }, order: 40, weight: 20, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusBreakpointsView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
|
||||
viewsRegistry.registerViews([{ id: StartView.ID, name: StartView.LABEL, ctorDescriptor: { ctor: StartView }, order: 10, weight: 40, canToggleVisibility: true, when: CONTEXT_DEBUG_UX.isEqualTo('simple') }], viewContainer);
|
||||
viewsRegistry.registerViews([{ id: LOADED_SCRIPTS_VIEW_ID, name: nls.localize('loadedScripts', "Loaded Scripts"), ctorDescriptor: { ctor: LoadedScriptsView }, order: 35, weight: 5, canToggleVisibility: true, collapsed: true, when: ContextKeyExpr.and(CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);
|
||||
|
||||
registerCommands();
|
||||
|
||||
|
||||
@@ -157,25 +157,33 @@ export class StartDebugActionViewItem implements IActionViewItem {
|
||||
this.selected = 0;
|
||||
this.options = [];
|
||||
const manager = this.debugService.getConfigurationManager();
|
||||
const launches = manager.getLaunches();
|
||||
const inWorkspace = this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE;
|
||||
launches.forEach(launch =>
|
||||
launch.getConfigurationNames().forEach(name => {
|
||||
if (name === manager.selectedConfiguration.name && launch === manager.selectedConfiguration.launch) {
|
||||
this.selected = this.options.length;
|
||||
let lastGroup: string | undefined;
|
||||
const disabledIdxs: number[] = [];
|
||||
manager.getAllConfigurations().forEach(({ launch, name, presentation }) => {
|
||||
if (name === manager.selectedConfiguration.name && launch === manager.selectedConfiguration.launch) {
|
||||
this.selected = this.options.length;
|
||||
}
|
||||
if (lastGroup !== presentation?.group) {
|
||||
lastGroup = presentation?.group;
|
||||
if (this.options.length) {
|
||||
this.options.push({ label: StartDebugActionViewItem.SEPARATOR, handler: undefined });
|
||||
disabledIdxs.push(this.options.length - 1);
|
||||
}
|
||||
const label = inWorkspace ? `${name} (${launch.name})` : name;
|
||||
this.options.push({ label, handler: () => { manager.selectConfiguration(launch, name); return true; } });
|
||||
}));
|
||||
}
|
||||
|
||||
const label = inWorkspace ? `${name} (${launch.name})` : name;
|
||||
this.options.push({ label, handler: () => { manager.selectConfiguration(launch, name); return true; } });
|
||||
});
|
||||
|
||||
if (this.options.length === 0) {
|
||||
this.options.push({ label: nls.localize('noConfigurations', "No Configurations"), handler: () => false });
|
||||
} else {
|
||||
this.options.push({ label: StartDebugActionViewItem.SEPARATOR, handler: undefined });
|
||||
disabledIdxs.push(this.options.length - 1);
|
||||
}
|
||||
|
||||
const disabledIdx = this.options.length - 1;
|
||||
launches.filter(l => !l.hidden).forEach(l => {
|
||||
manager.getLaunches().filter(l => !l.hidden).forEach(l => {
|
||||
const label = inWorkspace ? nls.localize("addConfigTo", "Add Config ({0})...", l.name) : nls.localize('addConfiguration', "Add Configuration...");
|
||||
this.options.push({
|
||||
label, handler: () => {
|
||||
@@ -185,7 +193,7 @@ export class StartDebugActionViewItem implements IActionViewItem {
|
||||
});
|
||||
});
|
||||
|
||||
this.selectBox.setOptions(this.options.map((data, index) => <ISelectOptionItem>{ text: data.label, isDisabled: (index === disabledIdx ? true : undefined) }), this.selected);
|
||||
this.selectBox.setOptions(this.options.map((data, index) => <ISelectOptionItem>{ text: data.label, isDisabled: disabledIdxs.indexOf(index) !== -1 }), this.selected);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,8 +79,7 @@ export class ConfigureAction extends AbstractDebugAction {
|
||||
|
||||
private updateClass(): void {
|
||||
const configurationManager = this.debugService.getConfigurationManager();
|
||||
const configurationCount = configurationManager.getLaunches().map(l => l.getConfigurationNames().length).reduce((sum, current) => sum + current);
|
||||
this.class = configurationCount > 0 ? 'debug-action codicon codicon-gear' : 'debug-action codicon codicon-gear notification';
|
||||
this.class = configurationManager.selectedConfiguration.name ? 'debug-action codicon codicon-gear' : 'debug-action codicon codicon-gear notification';
|
||||
}
|
||||
|
||||
async run(event?: any): Promise<any> {
|
||||
@@ -145,7 +144,7 @@ export class StartAction extends AbstractDebugAction {
|
||||
if (debugService.state === State.Initializing) {
|
||||
return false;
|
||||
}
|
||||
if ((sessions.length > 0) && debugService.getConfigurationManager().getLaunches().every(l => l.getConfigurationNames().length === 0)) {
|
||||
if ((sessions.length > 0) && !debugService.getConfigurationManager().selectedConfiguration.name) {
|
||||
// There is already a debug session running and we do not have any launch configuration selected
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState, IWorkspaceFoldersChangeEvent } from 'vs/platform/workspace/common/workspace';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IDebugConfigurationProvider, ICompound, IDebugConfiguration, IConfig, IGlobalConfig, IConfigurationManager, ILaunch, IDebugAdapterDescriptorFactory, IDebugAdapter, IDebugSession, IAdapterDescriptor, CONTEXT_DEBUG_CONFIGURATION_TYPE, IDebugAdapterFactory } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { IDebugConfigurationProvider, ICompound, IDebugConfiguration, IConfig, IGlobalConfig, IConfigurationManager, ILaunch, IDebugAdapterDescriptorFactory, IDebugAdapter, IDebugSession, IAdapterDescriptor, CONTEXT_DEBUG_CONFIGURATION_TYPE, IDebugAdapterFactory, IConfigPresentation } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { Debugger } from 'vs/workbench/contrib/debug/common/debugger';
|
||||
import { IEditorService, ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
@@ -214,6 +214,43 @@ export class ConfigurationManager implements IConfigurationManager {
|
||||
return results.reduce((first, second) => first.concat(second), []);
|
||||
}
|
||||
|
||||
getAllConfigurations(): { launch: ILaunch; name: string; presentation?: IConfigPresentation }[] {
|
||||
const all: { launch: ILaunch, name: string, presentation?: IConfigPresentation }[] = [];
|
||||
for (let l of this.launches) {
|
||||
for (let name of l.getConfigurationNames()) {
|
||||
const config = l.getConfiguration(name) || l.getCompound(name);
|
||||
if (config && !config.presentation?.hidden) {
|
||||
all.push({ launch: l, name, presentation: config.presentation });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return all.sort((first, second) => {
|
||||
if (!first.presentation) {
|
||||
return 1;
|
||||
}
|
||||
if (!second.presentation) {
|
||||
return -1;
|
||||
}
|
||||
if (!first.presentation.group) {
|
||||
return 1;
|
||||
}
|
||||
if (!second.presentation.group) {
|
||||
return -1;
|
||||
}
|
||||
if (first.presentation.group !== second.presentation.group) {
|
||||
return first.presentation.group.localeCompare(second.presentation.group);
|
||||
}
|
||||
if (typeof first.presentation.order !== 'number') {
|
||||
return 1;
|
||||
}
|
||||
if (typeof second.presentation.order !== 'number') {
|
||||
return -1;
|
||||
}
|
||||
return first.presentation.order - second.presentation.order;
|
||||
});
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
debuggersExtPoint.setHandler((extensions, delta) => {
|
||||
delta.added.forEach(added => {
|
||||
|
||||
@@ -96,18 +96,24 @@ export class DebugQuickOpenHandler extends QuickOpenHandler {
|
||||
const configurations: QuickOpenEntry[] = [];
|
||||
|
||||
const configManager = this.debugService.getConfigurationManager();
|
||||
const launches = configManager.getLaunches();
|
||||
for (let launch of launches) {
|
||||
launch.getConfigurationNames().map(config => ({ config: config, highlights: matchesFuzzy(input, config, true) || undefined }))
|
||||
.filter(({ highlights }) => !!highlights)
|
||||
.forEach(({ config, highlights }) => {
|
||||
if (launch === configManager.selectedConfiguration.launch && config === configManager.selectedConfiguration.name) {
|
||||
this.autoFocusIndex = configurations.length;
|
||||
}
|
||||
configurations.push(new StartDebugEntry(this.debugService, this.contextService, this.notificationService, launch, config, highlights));
|
||||
});
|
||||
const allConfigurations = configManager.getAllConfigurations();
|
||||
let lastGroup: string | undefined;
|
||||
for (let config of allConfigurations) {
|
||||
const highlights = matchesFuzzy(input, config.name, true);
|
||||
if (highlights) {
|
||||
if (config.launch === configManager.selectedConfiguration.launch && config.name === configManager.selectedConfiguration.name) {
|
||||
this.autoFocusIndex = configurations.length;
|
||||
}
|
||||
let entry: QuickOpenEntry = new StartDebugEntry(this.debugService, this.contextService, this.notificationService, config.launch, config.name, highlights);
|
||||
if (lastGroup !== config.presentation?.group) {
|
||||
entry = new QuickOpenEntryGroup(entry, undefined, true);
|
||||
lastGroup = config.presentation?.group;
|
||||
}
|
||||
configurations.push(entry);
|
||||
}
|
||||
}
|
||||
launches.filter(l => !l.hidden).forEach((l, index) => {
|
||||
|
||||
configManager.getLaunches().filter(l => !l.hidden).forEach((l, index) => {
|
||||
|
||||
const label = this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE ? nls.localize("addConfigTo", "Add Config ({0})...", l.name) : nls.localize('addConfiguration', "Add Configuration...");
|
||||
const entry = new AddConfigEntry(label, l, this.commandService, this.contextService, matchesFuzzy(input, label, true) || undefined);
|
||||
|
||||
@@ -32,26 +32,8 @@ import { MenuEntryActionViewItem } from 'vs/platform/actions/browser/menuEntryAc
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { TogglePanelAction } from 'vs/workbench/browser/panel';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
import { Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
import { StartView } from 'vs/workbench/contrib/debug/browser/startView';
|
||||
|
||||
// Register a lightweight viewlet responsible for making the container
|
||||
export class DebugViewlet extends Viewlet {
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IStorageService protected storageService: IStorageService,
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextMenuService protected contextMenuService: IContextMenuService,
|
||||
@IExtensionService protected extensionService: IExtensionService,
|
||||
@IWorkspaceContextService protected contextService: IWorkspaceContextService,
|
||||
@IWorkbenchLayoutService protected layoutService: IWorkbenchLayoutService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService
|
||||
) {
|
||||
super(VIEWLET_ID, instantiationService.createInstance(DebugViewPaneContainer), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService);
|
||||
}
|
||||
}
|
||||
|
||||
export class DebugViewPaneContainer extends ViewPaneContainer {
|
||||
|
||||
private startDebugActionViewItem: StartDebugActionViewItem | undefined;
|
||||
|
||||
@@ -24,11 +24,8 @@ import { TaskIdentifier } from 'vs/workbench/contrib/tasks/common/tasks';
|
||||
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { Extensions as ViewContainerExtensions, IViewContainersRegistry, ViewContainer, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
|
||||
export const VIEWLET_ID = 'workbench.view.debug';
|
||||
export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: VIEWLET_ID, name: nls.localize('debugAndRun', "Debug and Run") }, ViewContainerLocation.Sidebar);
|
||||
|
||||
export const VARIABLES_VIEW_ID = 'workbench.debug.variablesView';
|
||||
export const WATCH_VIEW_ID = 'workbench.debug.watchExpressionsView';
|
||||
@@ -487,13 +484,19 @@ export interface IEnvConfig {
|
||||
noDebug?: boolean;
|
||||
}
|
||||
|
||||
export interface IConfigPresentation {
|
||||
hidden?: boolean;
|
||||
group?: string;
|
||||
order?: number;
|
||||
}
|
||||
|
||||
export interface IConfig extends IEnvConfig {
|
||||
|
||||
// fundamental attributes
|
||||
type: string;
|
||||
request: string;
|
||||
name: string;
|
||||
|
||||
presentation?: IConfigPresentation;
|
||||
// platform specifics
|
||||
windows?: IEnvConfig;
|
||||
osx?: IEnvConfig;
|
||||
@@ -510,6 +513,7 @@ export interface ICompound {
|
||||
name: string;
|
||||
preLaunchTask?: string | TaskIdentifier;
|
||||
configurations: (string | { name: string, folder: string })[];
|
||||
presentation?: IConfigPresentation;
|
||||
}
|
||||
|
||||
export interface IDebugAdapter extends IDisposable {
|
||||
@@ -631,6 +635,8 @@ export interface IConfigurationManager {
|
||||
|
||||
getLaunch(workspaceUri: uri | undefined): ILaunch | undefined;
|
||||
|
||||
getAllConfigurations(): { launch: ILaunch, name: string, presentation?: IConfigPresentation }[];
|
||||
|
||||
/**
|
||||
* Allows to register on change of selected debug configuration.
|
||||
*/
|
||||
|
||||
@@ -132,6 +132,33 @@ export const breakpointsExtPoint = extensionsRegistry.ExtensionsRegistry.registe
|
||||
});
|
||||
|
||||
// debug general schema
|
||||
|
||||
export const presentationSchema: IJSONSchema = {
|
||||
type: 'object',
|
||||
description: nls.localize('presentation', "Presentation options on how to show this configuration in the debug configuration dropdown and the command palette."),
|
||||
properties: {
|
||||
hidden: {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: nls.localize('presentation.hidden', "Controls if this configuration should be shown in the configuration dropdown and the command palette.")
|
||||
},
|
||||
group: {
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: nls.localize('presentation.group', "Group that this configuration belongs to. Used for grouping and sorting in the configuration dropdown and the command palette.")
|
||||
},
|
||||
order: {
|
||||
type: 'number',
|
||||
default: 1,
|
||||
description: nls.localize('presentation.order', "Order of this configuration within a group. Used for grouping and sorting in the configuration dropdown and the command palette.")
|
||||
}
|
||||
},
|
||||
default: {
|
||||
hidden: false,
|
||||
group: '',
|
||||
order: 1
|
||||
}
|
||||
};
|
||||
const defaultCompound: ICompound = { name: 'Compound', configurations: [] };
|
||||
export const launchSchema: IJSONSchema = {
|
||||
id: launchSchemaId,
|
||||
@@ -167,6 +194,7 @@ export const launchSchema: IJSONSchema = {
|
||||
type: 'string',
|
||||
description: nls.localize('app.launch.json.compound.name', "Name of compound. Appears in the launch configuration drop down menu.")
|
||||
},
|
||||
presentation: presentationSchema,
|
||||
configurations: {
|
||||
type: 'array',
|
||||
default: [],
|
||||
|
||||
@@ -22,6 +22,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { isDebuggerMainContribution } from 'vs/workbench/contrib/debug/common/debugUtils';
|
||||
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import { presentationSchema } from 'vs/workbench/contrib/debug/common/debugSchemas';
|
||||
|
||||
export class Debugger implements IDebugger {
|
||||
|
||||
@@ -222,7 +223,7 @@ export class Debugger implements IDebugger {
|
||||
};
|
||||
properties['name'] = {
|
||||
type: 'string',
|
||||
description: nls.localize('debugName', "Name of configuration; appears in the launch configuration drop down menu."),
|
||||
description: nls.localize('debugName', "Name of configuration; appears in the launch configuration dropdown menu."),
|
||||
default: 'Launch'
|
||||
};
|
||||
properties['request'] = {
|
||||
@@ -250,6 +251,7 @@ export class Debugger implements IDebugger {
|
||||
defaultSnippets: [{ body: { task: '', type: '' } }],
|
||||
description: nls.localize('debugPostDebugTask', "Task to run after debug session ends.")
|
||||
};
|
||||
properties['presentation'] = presentationSchema;
|
||||
properties['internalConsoleOptions'] = INTERNAL_CONSOLE_OPTIONS_SCHEMA;
|
||||
// Clear out windows, linux and osx fields to not have cycles inside the properties object
|
||||
delete properties['windows'];
|
||||
|
||||
@@ -61,7 +61,6 @@ import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { TokenizationRegistry } from 'vs/editor/common/modes';
|
||||
import { generateTokensCSSForColorMap } from 'vs/editor/common/modes/supports/tokenization';
|
||||
import { editorBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { ExtensionsViewlet, ExtensionsViewPaneContainer } from 'vs/workbench/contrib/extensions/browser/extensionsViewlet';
|
||||
|
||||
function removeEmbeddedSVGs(documentContent: string): string {
|
||||
const newDocument = new DOMParser().parseFromString(documentContent, 'text/html');
|
||||
@@ -393,7 +392,10 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
this.transientDisposables.add(this.onClick(template.publisher, () => {
|
||||
this.viewletService.openViewlet(VIEWLET_ID, true)
|
||||
.then((viewlet: ExtensionsViewlet) => (viewlet.getViewPaneContainer() as ExtensionsViewPaneContainer).search(`publisher:"${extension.publisherDisplayName}"`));
|
||||
.then(viewlet => viewlet?.getViewPaneContainer())
|
||||
.then((viewlet: IExtensionsViewPaneContainer) => {
|
||||
viewlet.search(`publisher:"${extension.publisherDisplayName}"`);
|
||||
});
|
||||
}));
|
||||
}
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
|
||||
@@ -14,7 +14,7 @@ import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } fro
|
||||
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/services/output/common/output';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { VIEWLET_ID, IExtensionsWorkbenchService, VIEW_CONTAINER } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { VIEWLET_ID, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService';
|
||||
import {
|
||||
OpenExtensionsViewletAction, InstallExtensionsAction, ShowOutdatedExtensionsAction, ShowRecommendedExtensionsAction, ShowRecommendedKeymapExtensionsAction, ShowPopularExtensionsAction,
|
||||
@@ -22,9 +22,8 @@ import {
|
||||
EnableAllAction, EnableAllWorkspaceAction, DisableAllAction, DisableAllWorkspaceAction, CheckForUpdatesAction, ShowLanguageExtensionsAction, ShowAzureExtensionsAction, EnableAutoUpdateAction, DisableAutoUpdateAction, ConfigureRecommendedExtensionsCommandsContributor, InstallVSIXAction, ReinstallAction, InstallSpecificVersionOfExtensionAction
|
||||
} from 'vs/workbench/contrib/extensions/browser/extensionsActions';
|
||||
import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput';
|
||||
import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor } from 'vs/workbench/browser/viewlet';
|
||||
import { ExtensionEditor } from 'vs/workbench/contrib/extensions/browser/extensionEditor';
|
||||
import { StatusUpdater, MaliciousExtensionChecker, ExtensionsViewletViewsContribution, ExtensionsViewlet } from 'vs/workbench/contrib/extensions/browser/extensionsViewlet';
|
||||
import { StatusUpdater, MaliciousExtensionChecker, ExtensionsViewletViewsContribution, ExtensionsViewPaneContainer } from 'vs/workbench/contrib/extensions/browser/extensionsViewlet';
|
||||
import { IQuickOpenRegistry, Extensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import * as jsonContributionRegistry from 'vs/platform/jsonschemas/common/jsonContributionRegistry';
|
||||
@@ -44,6 +43,7 @@ import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { ExtensionType, ExtensionsPolicy } from 'vs/platform/extensions/common/extensions'; // {{SQL CARBON EDIT}}
|
||||
import { RemoteExtensionsInstaller } from 'vs/workbench/contrib/extensions/browser/remoteExtensionsInstaller';
|
||||
import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/browser/extensionTipsService';
|
||||
import { IViewContainersRegistry, ViewContainerLocation, Extensions as ViewContainerExtensions } from 'vs/workbench/common/views';
|
||||
|
||||
// Singletons
|
||||
registerSingleton(IExtensionsWorkbenchService, ExtensionsWorkbenchService);
|
||||
@@ -75,17 +75,15 @@ Registry.as<IEditorRegistry>(EditorExtensions.Editors).registerEditor(
|
||||
new SyncDescriptor(ExtensionsInput)
|
||||
]);
|
||||
|
||||
// Viewlet
|
||||
const viewletDescriptor = ViewletDescriptor.create(
|
||||
ExtensionsViewlet,
|
||||
VIEWLET_ID,
|
||||
VIEW_CONTAINER.name,
|
||||
'codicon-extensions',
|
||||
14 // {{SQL CARBON EDIT}}
|
||||
);
|
||||
Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(
|
||||
{
|
||||
id: VIEWLET_ID,
|
||||
name: localize('extensions', "Extensions"),
|
||||
ctorDescriptor: { ctor: ExtensionsViewPaneContainer },
|
||||
icon: 'codicon-extensions',
|
||||
order: 14 // {{SQL CARBON EDIT}}
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets)
|
||||
.registerViewlet(viewletDescriptor);
|
||||
|
||||
// Global actions
|
||||
const actionRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions);
|
||||
|
||||
@@ -18,7 +18,7 @@ import { append, $, addClass, toggleClass, Dimension } from 'vs/base/browser/dom
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { IExtensionsWorkbenchService, IExtensionsViewPaneContainer, VIEWLET_ID, AutoUpdateConfigurationKey, ShowRecommendationsOnlyOnDemandKey, CloseExtensionDetailsOnViewChangeKey, VIEW_CONTAINER } from '../common/extensions';
|
||||
import { IExtensionsWorkbenchService, IExtensionsViewPaneContainer, VIEWLET_ID, AutoUpdateConfigurationKey, ShowRecommendationsOnlyOnDemandKey, CloseExtensionDetailsOnViewChangeKey } from '../common/extensions';
|
||||
import {
|
||||
ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowRecommendedExtensionsAction, /*ShowPopularExtensionsAction,*/ ShowDisabledExtensionsAction,
|
||||
ShowOutdatedExtensionsAction, ClearExtensionsInputAction, ChangeSortAction, UpdateAllAction, CheckForUpdatesAction, DisableAllAction, EnableAllAction,
|
||||
@@ -35,7 +35,7 @@ import Severity from 'vs/base/common/severity';
|
||||
import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IViewsRegistry, IViewDescriptor, Extensions } from 'vs/workbench/common/views';
|
||||
import { IViewsRegistry, IViewDescriptor, Extensions, ViewContainer, IViewContainersRegistry } from 'vs/workbench/common/views';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IContextKeyService, ContextKeyExpr, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
@@ -57,7 +57,6 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { RemoteNameContext } from 'vs/workbench/browser/contextkeys';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { MementoObject } from 'vs/workbench/common/memento';
|
||||
import { Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
|
||||
const NonEmptyWorkspaceContext = new RawContextKey<boolean>('nonEmptyWorkspace', false);
|
||||
const DefaultViewsContext = new RawContextKey<boolean>('defaultExtensionViews', true);
|
||||
@@ -89,10 +88,13 @@ const viewIdNameMappings: { [id: string]: string } = {
|
||||
|
||||
export class ExtensionsViewletViewsContribution implements IWorkbenchContribution {
|
||||
|
||||
private readonly container: ViewContainer;
|
||||
|
||||
constructor(
|
||||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService,
|
||||
@ILabelService private readonly labelService: ILabelService,
|
||||
) {
|
||||
this.container = Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).get(VIEWLET_ID)!;
|
||||
this.registerViews();
|
||||
}
|
||||
|
||||
@@ -119,7 +121,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
|
||||
viewDescriptors.push(...this.createExtensionsViewDescriptorsForServer(this.extensionManagementServerService.remoteExtensionManagementServer));
|
||||
}
|
||||
|
||||
Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).registerViews(viewDescriptors, VIEW_CONTAINER);
|
||||
Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).registerViews(viewDescriptors, this.container);
|
||||
}
|
||||
|
||||
// View used for any kind of searching
|
||||
@@ -318,22 +320,6 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
|
||||
|
||||
}
|
||||
|
||||
export class ExtensionsViewlet extends Viewlet {
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IStorageService protected storageService: IStorageService,
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextMenuService protected contextMenuService: IContextMenuService,
|
||||
@IExtensionService protected extensionService: IExtensionService,
|
||||
@IWorkspaceContextService protected contextService: IWorkspaceContextService,
|
||||
@IWorkbenchLayoutService protected layoutService: IWorkbenchLayoutService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService
|
||||
) {
|
||||
super(VIEWLET_ID, instantiationService.createInstance(ExtensionsViewPaneContainer), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService);
|
||||
}
|
||||
}
|
||||
|
||||
export class ExtensionsViewPaneContainer extends ViewPaneContainer implements IExtensionsViewPaneContainer {
|
||||
|
||||
private readonly _onSearchChange: Emitter<string> = this._register(new Emitter<string>());
|
||||
|
||||
@@ -14,12 +14,9 @@ import { areSameExtensions } from 'vs/platform/extensionManagement/common/extens
|
||||
import { IExtensionManifest, ExtensionType } from 'vs/platform/extensions/common/extensions';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IViewPaneContainer } from 'vs/workbench/common/viewPaneContainer';
|
||||
import { Extensions as ViewContainerExtensions, ViewContainer, IViewContainersRegistry, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
|
||||
export const VIEWLET_ID = 'workbench.view.extensions';
|
||||
export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: VIEWLET_ID, name: localize('extensions', "Extensions") }, ViewContainerLocation.Sidebar);
|
||||
|
||||
export const EXTENSIONS_CONFIG = '.azuredatastudio/extensions.json';
|
||||
|
||||
@@ -148,3 +145,12 @@ export class ExtensionContainers extends Disposable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface IExtensionMenuAction extends IAction {
|
||||
run(context: IExtensionMenuActionContext): Promise<void>;
|
||||
}
|
||||
|
||||
export interface IExtensionMenuActionContext {
|
||||
id: string;
|
||||
packageJSON: IExtensionManifest;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./media/explorerviewlet';
|
||||
import { localize } from 'vs/nls';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { VIEWLET_ID, ExplorerViewletVisibleContext, IFilesConfiguration, OpenEditorsVisibleContext, VIEW_CONTAINER } from 'vs/workbench/contrib/files/common/files';
|
||||
import { VIEWLET_ID, ExplorerViewletVisibleContext, IFilesConfiguration, OpenEditorsVisibleContext } from 'vs/workbench/contrib/files/common/files';
|
||||
import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet';
|
||||
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
|
||||
import { ExplorerView } from 'vs/workbench/contrib/files/browser/views/explorerView';
|
||||
@@ -20,7 +20,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IViewsRegistry, IViewDescriptor, Extensions } from 'vs/workbench/common/views';
|
||||
import { IViewsRegistry, IViewDescriptor, Extensions, ViewContainer, IViewContainersRegistry, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
@@ -33,7 +33,6 @@ import { ViewPane, ViewPaneContainer } from 'vs/workbench/browser/parts/views/vi
|
||||
import { KeyChord, KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress';
|
||||
import { Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
|
||||
export class ExplorerViewletViewsContribution extends Disposable implements IWorkbenchContribution {
|
||||
|
||||
@@ -146,22 +145,6 @@ export class ExplorerViewletViewsContribution extends Disposable implements IWor
|
||||
}
|
||||
}
|
||||
|
||||
export class ExplorerViewlet extends Viewlet {
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IStorageService protected storageService: IStorageService,
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextMenuService protected contextMenuService: IContextMenuService,
|
||||
@IExtensionService protected extensionService: IExtensionService,
|
||||
@IWorkspaceContextService protected contextService: IWorkspaceContextService,
|
||||
@IWorkbenchLayoutService protected layoutService: IWorkbenchLayoutService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService
|
||||
) {
|
||||
super(VIEWLET_ID, instantiationService.createInstance(ExplorerViewPaneContainer), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService);
|
||||
}
|
||||
}
|
||||
|
||||
export class ExplorerViewPaneContainer extends ViewPaneContainer {
|
||||
|
||||
private static readonly EXPLORER_VIEWS_STATE = 'workbench.explorer.views.state';
|
||||
@@ -257,3 +240,14 @@ export class ExplorerViewPaneContainer extends ViewPaneContainer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Explorer viewlet container.
|
||||
*/
|
||||
export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer({
|
||||
id: VIEWLET_ID,
|
||||
name: localize('explore', "Explorer"),
|
||||
ctorDescriptor: { ctor: ExplorerViewPaneContainer },
|
||||
icon: 'codicon-files',
|
||||
order: 10 // {{SQL CARBON EDIT}}
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { toResource, IEditorCommandsContext, SideBySideEditor, IEditorIdentifier, SaveReason, SideBySideEditorInput } from 'vs/workbench/common/editor';
|
||||
import { toResource, IEditorCommandsContext, SideBySideEditor, IEditorIdentifier, SaveReason, SideBySideEditorInput, EditorsOrder } from 'vs/workbench/common/editor';
|
||||
import { IWindowOpenable, IOpenWindowOptions, isWorkspaceToOpen, IOpenEmptyWindowOptions } from 'vs/platform/windows/common/windows';
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -30,7 +30,7 @@ import { Schemas } from 'vs/base/common/network';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
||||
import { IEditorService, SIDE_GROUP, ISaveEditorsOptions } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IEditorGroupsService, GroupsOrder, EditorsOrder, IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IEditorGroupsService, GroupsOrder, IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { basename, joinPath, isEqual } from 'vs/base/common/resources';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor, ShowViewletAction } from 'vs/workbench/browser/viewlet';
|
||||
import { /*ViewletRegistry, Extensions as ViewletExtensions,*/ ShowViewletAction } from 'vs/workbench/browser/viewlet';
|
||||
import * as nls from 'vs/nls';
|
||||
import { sep } from 'vs/base/common/path';
|
||||
import { SyncActionDescriptor, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
|
||||
@@ -14,7 +14,7 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor
|
||||
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { IEditorInputFactory, EditorInput, IFileEditorInput, IEditorInputFactoryRegistry, Extensions as EditorInputExtensions } from 'vs/workbench/common/editor';
|
||||
import { AutoSaveConfiguration, HotExitConfiguration } from 'vs/platform/files/common/files';
|
||||
import { VIEWLET_ID, VIEW_CONTAINER, SortOrder, FILE_EDITOR_INPUT_ID, IExplorerService } from 'vs/workbench/contrib/files/common/files';
|
||||
import { VIEWLET_ID, SortOrder, FILE_EDITOR_INPUT_ID, IExplorerService } from 'vs/workbench/contrib/files/common/files';
|
||||
import { FileEditorTracker } from 'vs/workbench/contrib/files/browser/editors/fileEditorTracker';
|
||||
import { TextFileSaveErrorHandler } from 'vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler';
|
||||
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
|
||||
@@ -25,7 +25,7 @@ import { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import { ExplorerViewletViewsContribution, ExplorerViewlet } from 'vs/workbench/contrib/files/browser/explorerViewlet';
|
||||
import { ExplorerViewletViewsContribution } from 'vs/workbench/contrib/files/browser/explorerViewlet';
|
||||
import { IEditorRegistry, EditorDescriptor, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -73,15 +73,6 @@ class FileUriLabelContribution implements IWorkbenchContribution {
|
||||
}
|
||||
}
|
||||
|
||||
// Register Viewlet
|
||||
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).registerViewlet(ViewletDescriptor.create(
|
||||
ExplorerViewlet,
|
||||
VIEWLET_ID,
|
||||
VIEW_CONTAINER.name,
|
||||
'codicon-files',
|
||||
10 // {{SQL CARBON EDIT}}
|
||||
));
|
||||
|
||||
registerSingleton(IExplorerService, ExplorerService, true);
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
|
||||
@@ -16,26 +16,19 @@ import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { IModeService, ILanguageSelection } from 'vs/editor/common/services/modeService';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { InputFocusedContextKey } from 'vs/platform/contextkey/common/contextkeys';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainer, IEditableData, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
import { IEditableData } from 'vs/workbench/common/views';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel';
|
||||
import { once } from 'vs/base/common/functional';
|
||||
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
/**
|
||||
* Explorer viewlet id.
|
||||
*/
|
||||
export const VIEWLET_ID = 'workbench.view.explorer';
|
||||
|
||||
/**
|
||||
* Explorer viewlet container.
|
||||
*/
|
||||
export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: VIEWLET_ID, name: localize('explore', "Explorer") }, ViewContainerLocation.Sidebar);
|
||||
|
||||
export interface IExplorerService {
|
||||
_serviceBrand: undefined;
|
||||
readonly roots: ExplorerItem[];
|
||||
|
||||
@@ -14,7 +14,7 @@ import { localize } from 'vs/nls';
|
||||
import { Marker, RelatedInformation } from 'vs/workbench/contrib/markers/browser/markersModel';
|
||||
import { MarkersView, getMarkersView } from 'vs/workbench/contrib/markers/browser/markersView';
|
||||
import { MenuId, MenuRegistry, SyncActionDescriptor, registerAction } from 'vs/platform/actions/common/actions';
|
||||
import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor, PaneCompositePanel, TogglePanelAction } from 'vs/workbench/browser/panel';
|
||||
import { TogglePanelAction } from 'vs/workbench/browser/panel';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ShowProblemsPanelAction } from 'vs/workbench/contrib/markers/browser/markersViewActions';
|
||||
import Constants from 'vs/workbench/contrib/markers/browser/constants';
|
||||
@@ -30,13 +30,6 @@ import { IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment, IStatus
|
||||
import { IMarkerService, MarkerStatistics } from 'vs/platform/markers/common/markers';
|
||||
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { ViewContainer, IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation, IViewsRegistry } from 'vs/workbench/common/views';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
|
||||
@@ -100,30 +93,6 @@ Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfigurat
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// markers view container
|
||||
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: Constants.MARKERS_PANEL_ID, name: Messages.MARKERS_PANEL_TITLE_PROBLEMS }, ViewContainerLocation.Panel);
|
||||
Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry).registerViews([{
|
||||
id: Constants.MARKERS_VIEW_ID,
|
||||
name: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
|
||||
canToggleVisibility: false,
|
||||
ctorDescriptor: { ctor: MarkersView },
|
||||
}], VIEW_CONTAINER);
|
||||
|
||||
// markers panel
|
||||
class MarkersPanel extends PaneCompositePanel {
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@IExtensionService extensionService: IExtensionService,
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService) {
|
||||
super(Constants.MARKERS_PANEL_ID, instantiationService.createInstance(ViewPaneContainer, Constants.MARKERS_PANEL_ID, Constants.MARKERS_PANEL_STORAGE_ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }),
|
||||
telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService);
|
||||
}
|
||||
}
|
||||
class ToggleMarkersPanelAction extends TogglePanelAction {
|
||||
|
||||
public static readonly ID = 'workbench.actions.view.problems';
|
||||
@@ -136,14 +105,25 @@ class ToggleMarkersPanelAction extends TogglePanelAction {
|
||||
super(id, label, Constants.MARKERS_PANEL_ID, panelService, layoutService);
|
||||
}
|
||||
}
|
||||
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(PanelDescriptor.create(
|
||||
MarkersPanel,
|
||||
Constants.MARKERS_PANEL_ID,
|
||||
VIEW_CONTAINER.name,
|
||||
'markersPanel',
|
||||
10,
|
||||
ToggleMarkersPanelAction.ID
|
||||
));
|
||||
|
||||
// markers view container
|
||||
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
||||
id: Constants.MARKERS_PANEL_ID,
|
||||
name: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
|
||||
ctorDescriptor: { ctor: ViewPaneContainer, arguments: [Constants.MARKERS_PANEL_ID, Constants.MARKERS_PANEL_STORAGE_ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }] },
|
||||
focusCommand: {
|
||||
id: ToggleMarkersPanelAction.ID, keybindings: {
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M
|
||||
}
|
||||
}
|
||||
}, ViewContainerLocation.Panel);
|
||||
|
||||
Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry).registerViews([{
|
||||
id: Constants.MARKERS_VIEW_ID,
|
||||
name: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
|
||||
canToggleVisibility: false,
|
||||
ctorDescriptor: { ctor: MarkersView },
|
||||
}], VIEW_CONTAINER);
|
||||
|
||||
// workbench
|
||||
const workbenchRegistry = Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench);
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
import { localize } from 'vs/nls';
|
||||
import { IViewsRegistry, IViewDescriptor, Extensions as ViewExtensions } from 'vs/workbench/common/views';
|
||||
import { OutlinePane } from './outlinePane';
|
||||
import { VIEW_CONTAINER } from 'vs/workbench/contrib/files/common/files';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { OutlineConfigKeys, OutlineViewId } from 'vs/editor/contrib/documentSymbols/outline';
|
||||
import { VIEW_CONTAINER } from 'vs/workbench/contrib/files/browser/explorerViewlet';
|
||||
|
||||
// import './outlineNavigation';
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ export class SwitchOutputActionViewItem extends SelectActionViewItem {
|
||||
selected = logChannelIndex !== -1 ? separatorIndex + 1 + logChannelIndex : 0;
|
||||
}
|
||||
}
|
||||
this.setOptions(options.map((label, index) => <ISelectOptionItem>{ text: label, isDisabled: (index === separatorIndex ? true : undefined) }), Math.max(0, selected));
|
||||
this.setOptions(options.map((label, index) => <ISelectOptionItem>{ text: label, isDisabled: (index === separatorIndex ? true : false) }), Math.max(0, selected));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import 'vs/css!./remoteViewlet';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
@@ -16,15 +17,15 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { FilterViewPaneContainer } from 'vs/workbench/browser/parts/views/viewsViewlet';
|
||||
import { VIEWLET_ID, VIEW_CONTAINER } from 'vs/workbench/contrib/remote/common/remote.contribution';
|
||||
import { VIEWLET_ID } from 'vs/workbench/contrib/remote/common/remote.contribution';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IViewDescriptor, IViewsRegistry, Extensions } from 'vs/workbench/common/views';
|
||||
import { IViewDescriptor, IViewsRegistry, Extensions, ViewContainerLocation, IViewContainersRegistry } from 'vs/workbench/common/views';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor, ShowViewletAction, Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
import { ShowViewletAction } from 'vs/workbench/browser/viewlet';
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions';
|
||||
@@ -41,17 +42,124 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { SwitchRemoteViewItem, SwitchRemoteAction } from 'vs/workbench/contrib/remote/browser/explorerViewItems';
|
||||
import { Action, IActionViewItem, IAction } from 'vs/base/common/actions';
|
||||
import { isStringArray } from 'vs/base/common/types';
|
||||
import { IRemoteExplorerService, HelpInformation } from 'vs/workbench/services/remote/common/remoteExplorerService';
|
||||
import { IRemoteExplorerService } from 'vs/workbench/services/remote/common/remoteExplorerService';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { startsWith } from 'vs/base/common/strings';
|
||||
import { TunnelPanelDescriptor, TunnelViewModel, forwardedPortsViewEnabled } from 'vs/workbench/contrib/remote/browser/tunnelView';
|
||||
import { IAddedViewDescriptorRef } from 'vs/workbench/browser/parts/views/views';
|
||||
import { ViewPane } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
|
||||
import { ITreeRenderer, ITreeNode, IAsyncDataSource } from 'vs/base/browser/ui/tree/tree';
|
||||
import { WorkbenchAsyncDataTree, TreeResourceNavigator2 } from 'vs/platform/list/browser/listService';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { ExtensionsRegistry, IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||
|
||||
export interface HelpInformation {
|
||||
extensionDescription: IExtensionDescription;
|
||||
getStarted?: string;
|
||||
documentation?: string;
|
||||
feedback?: string;
|
||||
issues?: string;
|
||||
remoteName?: string[] | string;
|
||||
}
|
||||
|
||||
const remoteHelpExtPoint = ExtensionsRegistry.registerExtensionPoint<HelpInformation>({
|
||||
extensionPoint: 'remoteHelp',
|
||||
jsonSchema: {
|
||||
description: nls.localize('RemoteHelpInformationExtPoint', 'Contributes help information for Remote'),
|
||||
type: 'object',
|
||||
properties: {
|
||||
'getStarted': {
|
||||
description: nls.localize('RemoteHelpInformationExtPoint.getStarted', "The url to your project's Getting Started page"),
|
||||
type: 'string'
|
||||
},
|
||||
'documentation': {
|
||||
description: nls.localize('RemoteHelpInformationExtPoint.documentation', "The url to your project's documentation page"),
|
||||
type: 'string'
|
||||
},
|
||||
'feedback': {
|
||||
description: nls.localize('RemoteHelpInformationExtPoint.feedback', "The url to your project's feedback reporter"),
|
||||
type: 'string'
|
||||
},
|
||||
'issues': {
|
||||
description: nls.localize('RemoteHelpInformationExtPoint.issues', "The url to your project's issues list"),
|
||||
type: 'string'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
interface IViewModel {
|
||||
helpInformation: HelpInformation[];
|
||||
}
|
||||
|
||||
class HelpTreeVirtualDelegate implements IListVirtualDelegate<IHelpItem> {
|
||||
getHeight(element: IHelpItem): number {
|
||||
return 22;
|
||||
}
|
||||
|
||||
getTemplateId(element: IHelpItem): string {
|
||||
return 'HelpItemTemplate';
|
||||
}
|
||||
}
|
||||
|
||||
interface IHelpItemTemplateData {
|
||||
parent: HTMLElement;
|
||||
icon: HTMLElement;
|
||||
}
|
||||
|
||||
class HelpTreeRenderer implements ITreeRenderer<HelpModel | IHelpItem, IHelpItem, IHelpItemTemplateData> {
|
||||
templateId: string = 'HelpItemTemplate';
|
||||
|
||||
renderTemplate(container: HTMLElement): IHelpItemTemplateData {
|
||||
dom.addClass(container, 'remote-help-tree-node-item');
|
||||
const icon = dom.append(container, dom.$('.remote-help-tree-node-item-icon'));
|
||||
const data = <IHelpItemTemplateData>Object.create(null);
|
||||
data.parent = container;
|
||||
data.icon = icon;
|
||||
return data;
|
||||
}
|
||||
|
||||
renderElement(element: ITreeNode<IHelpItem, IHelpItem>, index: number, templateData: IHelpItemTemplateData, height: number | undefined): void {
|
||||
const container = templateData.parent;
|
||||
dom.append(container, templateData.icon);
|
||||
dom.addClasses(templateData.icon, ...element.element.iconClasses);
|
||||
const labelContainer = dom.append(container, dom.$('.help-item-label'));
|
||||
labelContainer.innerText = element.element.label;
|
||||
}
|
||||
|
||||
disposeTemplate(templateData: IHelpItemTemplateData): void {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class HelpDataSource implements IAsyncDataSource<any, any> {
|
||||
hasChildren(element: any) {
|
||||
return element instanceof HelpModel;
|
||||
}
|
||||
|
||||
getChildren(element: any) {
|
||||
if (element instanceof HelpModel && element.items) {
|
||||
return element.items;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
interface IHelpItem {
|
||||
key: string;
|
||||
iconClasses: string[];
|
||||
label: string;
|
||||
handleClick(): Promise<void>;
|
||||
}
|
||||
|
||||
class HelpModel {
|
||||
items: IHelpItem[] | undefined;
|
||||
|
||||
constructor(
|
||||
viewModel: IViewModel,
|
||||
openerService: IOpenerService,
|
||||
quickInputService: IQuickInputService,
|
||||
commandService: ICommandService,
|
||||
@@ -59,12 +167,12 @@ class HelpModel {
|
||||
environmentService: IWorkbenchEnvironmentService
|
||||
) {
|
||||
let helpItems: IHelpItem[] = [];
|
||||
const getStarted = remoteExplorerService.helpInformation.filter(info => info.getStarted);
|
||||
const getStarted = viewModel.helpInformation.filter(info => info.getStarted);
|
||||
|
||||
if (getStarted.length) {
|
||||
helpItems.push(new HelpItem(
|
||||
['getStarted'],
|
||||
nls.localize('remote.help.getStarted', "$(star) Get Started"),
|
||||
'star',
|
||||
nls.localize('remote.help.getStarted', "Get Started"),
|
||||
getStarted.map((info: HelpInformation) => ({
|
||||
extensionDescription: info.extensionDescription,
|
||||
url: info.getStarted!,
|
||||
@@ -77,12 +185,12 @@ class HelpModel {
|
||||
));
|
||||
}
|
||||
|
||||
const documentation = remoteExplorerService.helpInformation.filter(info => info.documentation);
|
||||
const documentation = viewModel.helpInformation.filter(info => info.documentation);
|
||||
|
||||
if (documentation.length) {
|
||||
helpItems.push(new HelpItem(
|
||||
['documentation'],
|
||||
nls.localize('remote.help.documentation', "$(book) Read Documentation"),
|
||||
'book',
|
||||
nls.localize('remote.help.documentation', "Read Documentation"),
|
||||
documentation.map((info: HelpInformation) => ({
|
||||
extensionDescription: info.extensionDescription,
|
||||
url: info.documentation!,
|
||||
@@ -95,12 +203,12 @@ class HelpModel {
|
||||
));
|
||||
}
|
||||
|
||||
const feedback = remoteExplorerService.helpInformation.filter(info => info.feedback);
|
||||
const feedback = viewModel.helpInformation.filter(info => info.feedback);
|
||||
|
||||
if (feedback.length) {
|
||||
helpItems.push(new HelpItem(
|
||||
['feedback'],
|
||||
nls.localize('remote.help.feedback', "$(twitter) Provide Feedback"),
|
||||
'twitter',
|
||||
nls.localize('remote.help.feedback', "Provide Feedback"),
|
||||
feedback.map((info: HelpInformation) => ({
|
||||
extensionDescription: info.extensionDescription,
|
||||
url: info.feedback!,
|
||||
@@ -113,12 +221,12 @@ class HelpModel {
|
||||
));
|
||||
}
|
||||
|
||||
const issues = remoteExplorerService.helpInformation.filter(info => info.issues);
|
||||
const issues = viewModel.helpInformation.filter(info => info.issues);
|
||||
|
||||
if (issues.length) {
|
||||
helpItems.push(new HelpItem(
|
||||
['issues'],
|
||||
nls.localize('remote.help.issues', "$(issues) Review Issues"),
|
||||
'issues',
|
||||
nls.localize('remote.help.issues', "Review Issues"),
|
||||
issues.map((info: HelpInformation) => ({
|
||||
extensionDescription: info.extensionDescription,
|
||||
url: info.issues!,
|
||||
@@ -133,9 +241,9 @@ class HelpModel {
|
||||
|
||||
if (helpItems.length) {
|
||||
helpItems.push(new IssueReporterItem(
|
||||
['issueReporter'],
|
||||
nls.localize('remote.help.report', "$(comment) Report Issue"),
|
||||
remoteExplorerService.helpInformation.map(info => ({
|
||||
'comment',
|
||||
nls.localize('remote.help.report', "Report Issue"),
|
||||
viewModel.helpInformation.map(info => ({
|
||||
extensionDescription: info.extensionDescription,
|
||||
remoteAuthority: (typeof info.remoteName === 'string') ? [info.remoteName] : info.remoteName
|
||||
})),
|
||||
@@ -152,21 +260,19 @@ class HelpModel {
|
||||
}
|
||||
}
|
||||
|
||||
interface IHelpItem extends IQuickPickItem {
|
||||
label: string;
|
||||
handleClick(): Promise<void>;
|
||||
}
|
||||
|
||||
abstract class HelpItemBase implements IHelpItem {
|
||||
public iconClasses: string[] = [];
|
||||
constructor(
|
||||
public iconClasses: string[],
|
||||
public key: string,
|
||||
public label: string,
|
||||
public values: { extensionDescription: IExtensionDescription, url?: string, remoteAuthority: string[] | undefined }[],
|
||||
private quickInputService: IQuickInputService,
|
||||
private environmentService: IWorkbenchEnvironmentService,
|
||||
private remoteExplorerService: IRemoteExplorerService
|
||||
) {
|
||||
iconClasses.push('remote-help-tree-node-item-icon');
|
||||
this.iconClasses.push(`codicon-${key}`);
|
||||
this.iconClasses.push('remote-help-tree-node-item-icon');
|
||||
this.iconClasses.push('codicon');
|
||||
}
|
||||
|
||||
async handleClick() {
|
||||
@@ -208,7 +314,7 @@ abstract class HelpItemBase implements IHelpItem {
|
||||
|
||||
class HelpItem extends HelpItemBase {
|
||||
constructor(
|
||||
iconClasses: string[],
|
||||
key: string,
|
||||
label: string,
|
||||
values: { extensionDescription: IExtensionDescription; url: string, remoteAuthority: string[] | undefined }[],
|
||||
quickInputService: IQuickInputService,
|
||||
@@ -216,7 +322,7 @@ class HelpItem extends HelpItemBase {
|
||||
private openerService: IOpenerService,
|
||||
remoteExplorerService: IRemoteExplorerService
|
||||
) {
|
||||
super(iconClasses, label, values, quickInputService, environmentService, remoteExplorerService);
|
||||
super(key, label, values, quickInputService, environmentService, remoteExplorerService);
|
||||
}
|
||||
|
||||
protected async takeAction(extensionDescription: IExtensionDescription, url: string): Promise<void> {
|
||||
@@ -226,7 +332,7 @@ class HelpItem extends HelpItemBase {
|
||||
|
||||
class IssueReporterItem extends HelpItemBase {
|
||||
constructor(
|
||||
iconClasses: string[],
|
||||
key: string,
|
||||
label: string,
|
||||
values: { extensionDescription: IExtensionDescription; remoteAuthority: string[] | undefined }[],
|
||||
quickInputService: IQuickInputService,
|
||||
@@ -234,7 +340,7 @@ class IssueReporterItem extends HelpItemBase {
|
||||
private commandService: ICommandService,
|
||||
remoteExplorerService: IRemoteExplorerService
|
||||
) {
|
||||
super(iconClasses, label, values, quickInputService, environmentService, remoteExplorerService);
|
||||
super(key, label, values, quickInputService, environmentService, remoteExplorerService);
|
||||
}
|
||||
|
||||
protected async takeAction(extensionDescription: IExtensionDescription): Promise<void> {
|
||||
@@ -242,53 +348,77 @@ class IssueReporterItem extends HelpItemBase {
|
||||
}
|
||||
}
|
||||
|
||||
class HelpAction extends Action {
|
||||
static readonly ID = 'remote.explorer.help';
|
||||
static readonly LABEL = nls.localize('remote.explorer.help', "Help, Documentation, and Feedback");
|
||||
private helpModel: HelpModel;
|
||||
class HelpPanel extends ViewPane {
|
||||
static readonly ID = '~remote.helpPanel';
|
||||
static readonly TITLE = nls.localize('remote.help', "Help and feedback");
|
||||
private tree!: WorkbenchAsyncDataTree<any, any, any>;
|
||||
|
||||
constructor(id: string,
|
||||
label: string,
|
||||
@IOpenerService private readonly openerService: IOpenerService,
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService,
|
||||
@ICommandService private readonly commandService: ICommandService,
|
||||
@IRemoteExplorerService private readonly remoteExplorerService: IRemoteExplorerService,
|
||||
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService
|
||||
) {
|
||||
super(id, label, 'codicon codicon-question');
|
||||
this.helpModel = new HelpModel(openerService, quickInputService, commandService, remoteExplorerService, environmentService);
|
||||
}
|
||||
|
||||
async run(event?: any): Promise<any> {
|
||||
if (!this.helpModel.items) {
|
||||
this.helpModel = new HelpModel(this.openerService, this.quickInputService, this.commandService, this.remoteExplorerService, this.environmentService);
|
||||
}
|
||||
if (this.helpModel.items) {
|
||||
const selection = await this.quickInputService.pick(this.helpModel.items, { placeHolder: nls.localize('remote.explorer.helpPlaceholder', "Help and Feedback") });
|
||||
if (selection) {
|
||||
return selection.handleClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class RemoteViewlet extends Viewlet {
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IStorageService protected storageService: IStorageService,
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
protected viewModel: IViewModel,
|
||||
options: IViewPaneOptions,
|
||||
@IKeybindingService protected keybindingService: IKeybindingService,
|
||||
@IContextMenuService protected contextMenuService: IContextMenuService,
|
||||
@IExtensionService protected extensionService: IExtensionService,
|
||||
@IWorkspaceContextService protected contextService: IWorkspaceContextService,
|
||||
@IWorkbenchLayoutService protected layoutService: IWorkbenchLayoutService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService
|
||||
@IContextKeyService protected contextKeyService: IContextKeyService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService,
|
||||
@IInstantiationService protected readonly instantiationService: IInstantiationService,
|
||||
@IOpenerService protected openerService: IOpenerService,
|
||||
@IQuickInputService protected quickInputService: IQuickInputService,
|
||||
@ICommandService protected commandService: ICommandService,
|
||||
@IRemoteExplorerService protected readonly remoteExplorerService: IRemoteExplorerService,
|
||||
@IWorkbenchEnvironmentService protected readonly workbenchEnvironmentService: IWorkbenchEnvironmentService
|
||||
) {
|
||||
super(VIEWLET_ID, instantiationService.createInstance(RemoteViewPaneContainer), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService);
|
||||
super(options, keybindingService, contextMenuService, configurationService, contextKeyService);
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement): void {
|
||||
dom.addClass(container, 'remote-help');
|
||||
const treeContainer = document.createElement('div');
|
||||
dom.addClass(treeContainer, 'remote-help-content');
|
||||
container.appendChild(treeContainer);
|
||||
|
||||
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree,
|
||||
'RemoteHelp',
|
||||
treeContainer,
|
||||
new HelpTreeVirtualDelegate(),
|
||||
[new HelpTreeRenderer()],
|
||||
new HelpDataSource(),
|
||||
{
|
||||
keyboardSupport: true,
|
||||
}
|
||||
);
|
||||
|
||||
const model = new HelpModel(this.viewModel, this.openerService, this.quickInputService, this.commandService, this.remoteExplorerService, this.workbenchEnvironmentService);
|
||||
|
||||
this.tree.setInput(model);
|
||||
|
||||
const helpItemNavigator = this._register(new TreeResourceNavigator2(this.tree, { openOnFocus: false, openOnSelection: false }));
|
||||
|
||||
this._register(Event.debounce(helpItemNavigator.onDidOpenResource, (last, event) => event, 75, true)(e => {
|
||||
e.element.handleClick();
|
||||
}));
|
||||
}
|
||||
|
||||
protected layoutBody(height: number, width: number): void {
|
||||
this.tree.layout(height, width);
|
||||
}
|
||||
}
|
||||
|
||||
export class RemoteViewPaneContainer extends FilterViewPaneContainer {
|
||||
class HelpPanelDescriptor implements IViewDescriptor {
|
||||
readonly id = HelpPanel.ID;
|
||||
readonly name = HelpPanel.TITLE;
|
||||
readonly ctorDescriptor: { ctor: any, arguments?: any[] };
|
||||
readonly canToggleVisibility = true;
|
||||
readonly hideByDefault = false;
|
||||
readonly workspace = true;
|
||||
|
||||
constructor(viewModel: IViewModel) {
|
||||
this.ctorDescriptor = { ctor: HelpPanel, arguments: [viewModel] };
|
||||
}
|
||||
}
|
||||
|
||||
export class RemoteViewPaneContainer extends FilterViewPaneContainer implements IViewModel {
|
||||
private helpPanelDescriptor = new HelpPanelDescriptor(this);
|
||||
helpInformation: HelpInformation[] = [];
|
||||
private actions: IAction[] | undefined;
|
||||
private tunnelPanelDescriptor: TunnelPanelDescriptor | undefined;
|
||||
|
||||
@@ -307,6 +437,41 @@ export class RemoteViewPaneContainer extends FilterViewPaneContainer {
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService
|
||||
) {
|
||||
super(VIEWLET_ID, remoteExplorerService.onDidChangeTargetType, configurationService, layoutService, telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService);
|
||||
this.addConstantViewDescriptors([this.helpPanelDescriptor]);
|
||||
remoteHelpExtPoint.setHandler((extensions) => {
|
||||
let helpInformation: HelpInformation[] = [];
|
||||
for (let extension of extensions) {
|
||||
this._handleRemoteInfoExtensionPoint(extension, helpInformation);
|
||||
}
|
||||
|
||||
this.helpInformation = helpInformation;
|
||||
|
||||
const viewsRegistry = Registry.as<IViewsRegistry>(Extensions.ViewsRegistry);
|
||||
if (this.helpInformation.length) {
|
||||
viewsRegistry.registerViews([this.helpPanelDescriptor], this.viewContainer);
|
||||
} else {
|
||||
viewsRegistry.deregisterViews([this.helpPanelDescriptor], this.viewContainer);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private _handleRemoteInfoExtensionPoint(extension: IExtensionPointUser<HelpInformation>, helpInformation: HelpInformation[]) {
|
||||
if (!extension.description.enableProposedApi) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!extension.value.documentation && !extension.value.feedback && !extension.value.getStarted && !extension.value.issues) {
|
||||
return;
|
||||
}
|
||||
|
||||
helpInformation.push({
|
||||
extensionDescription: extension.description,
|
||||
getStarted: extension.value.getStarted,
|
||||
documentation: extension.value.documentation,
|
||||
feedback: extension.value.feedback,
|
||||
issues: extension.value.issues,
|
||||
remoteName: extension.value.remoteName
|
||||
});
|
||||
}
|
||||
|
||||
protected getFilterOn(viewDescriptor: IViewDescriptor): string | undefined {
|
||||
@@ -315,7 +480,7 @@ export class RemoteViewPaneContainer extends FilterViewPaneContainer {
|
||||
|
||||
public getActionViewItem(action: Action): IActionViewItem | undefined {
|
||||
if (action.id === SwitchRemoteAction.ID) {
|
||||
return this.instantiationService.createInstance(SwitchRemoteViewItem, action, SwitchRemoteViewItem.createOptionItems(Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getViews(VIEW_CONTAINER), this.contextKeyService));
|
||||
return this.instantiationService.createInstance(SwitchRemoteViewItem, action, SwitchRemoteViewItem.createOptionItems(Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getViews(this.viewContainer), this.contextKeyService));
|
||||
}
|
||||
|
||||
return super.getActionViewItem(action);
|
||||
@@ -324,8 +489,7 @@ export class RemoteViewPaneContainer extends FilterViewPaneContainer {
|
||||
public getActions(): IAction[] {
|
||||
if (!this.actions) {
|
||||
this.actions = [
|
||||
this.instantiationService.createInstance(SwitchRemoteAction, SwitchRemoteAction.ID, SwitchRemoteAction.LABEL),
|
||||
this.instantiationService.createInstance(HelpAction, HelpAction.ID, HelpAction.LABEL)
|
||||
this.instantiationService.createInstance(SwitchRemoteAction, SwitchRemoteAction.ID, SwitchRemoteAction.LABEL)
|
||||
];
|
||||
this.actions.forEach(a => {
|
||||
this._register(a);
|
||||
@@ -347,19 +511,41 @@ export class RemoteViewPaneContainer extends FilterViewPaneContainer {
|
||||
if (this.environmentService.configuration.remoteAuthority && !this.tunnelPanelDescriptor && viewEnabled) {
|
||||
this.tunnelPanelDescriptor = new TunnelPanelDescriptor(new TunnelViewModel(this.remoteExplorerService), this.environmentService);
|
||||
const viewsRegistry = Registry.as<IViewsRegistry>(Extensions.ViewsRegistry);
|
||||
viewsRegistry.registerViews([this.tunnelPanelDescriptor!], VIEW_CONTAINER);
|
||||
viewsRegistry.registerViews([this.tunnelPanelDescriptor!], this.viewContainer);
|
||||
}
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
|
||||
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).registerViewlet(ViewletDescriptor.create(
|
||||
RemoteViewlet,
|
||||
VIEWLET_ID,
|
||||
VIEW_CONTAINER.name,
|
||||
'codicon-remote-explorer',
|
||||
4
|
||||
));
|
||||
Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer(
|
||||
{
|
||||
id: VIEWLET_ID,
|
||||
name: nls.localize('remote.explorer', "Remote Explorer"),
|
||||
ctorDescriptor: { ctor: RemoteViewPaneContainer },
|
||||
hideIfEmpty: true,
|
||||
viewOrderDelegate: {
|
||||
getOrder: (group?: string) => {
|
||||
if (!group) {
|
||||
return undefined; // {{SQL CARBON EDIT}} strict-null-check
|
||||
}
|
||||
|
||||
let matches = /^targets@(\d+)$/.exec(group);
|
||||
if (matches) {
|
||||
return -1000;
|
||||
}
|
||||
|
||||
matches = /^details(@(\d+))?$/.exec(group);
|
||||
|
||||
if (matches) {
|
||||
return -500;
|
||||
}
|
||||
|
||||
return undefined; // {{SQL CARBON EDIT}} strict-null-check;
|
||||
}
|
||||
},
|
||||
icon: 'codicon-remote-explorer',
|
||||
order: 4
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
class OpenRemoteViewletAction extends ShowViewletAction {
|
||||
|
||||
|
||||
@@ -3,14 +3,32 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.remote-help-tree-node-item-icon {
|
||||
.remote-help-content .monaco-list .monaco-list-row .remote-help-tree-node-item {
|
||||
display: flex;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
flex: 1;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.remote-help-content .monaco-list .monaco-list-row .remote-help-tree-node-item>.remote-help-tree-node-item-icon {
|
||||
background-size: 16px;
|
||||
background-position: left center;
|
||||
background-repeat: no-repeat;
|
||||
padding-right: 6px;
|
||||
padding-top: 3px;
|
||||
width: 16px;
|
||||
height: 22px;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.remote-help-content .monaco-list .monaco-list-row .monaco-tl-twistie {
|
||||
width: 0px !important;
|
||||
}
|
||||
|
||||
.remote-help-tree-node-item-icon .monaco-icon-label-description-container {
|
||||
padding-left: 22px;
|
||||
}
|
||||
|
||||
@@ -16,35 +16,8 @@ import { IOutputChannelRegistry, Extensions as OutputExt, } from 'vs/workbench/s
|
||||
import { localize } from 'vs/nls';
|
||||
import { joinPath } from 'vs/base/common/resources';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { ViewContainer, IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
|
||||
export const VIEWLET_ID = 'workbench.view.remote';
|
||||
export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(
|
||||
{
|
||||
id: VIEWLET_ID,
|
||||
name: localize('remote.explorer', "Remote Explorer"),
|
||||
hideIfEmpty: true,
|
||||
viewOrderDelegate: {
|
||||
getOrder: (group?: string) => {
|
||||
if (!group) {
|
||||
return undefined; // {{SQL CARBON EDIT}} strict-null-checks
|
||||
}
|
||||
|
||||
let matches = /^targets@(\d+)$/.exec(group);
|
||||
if (matches) {
|
||||
return -1000;
|
||||
}
|
||||
|
||||
matches = /^details(@(\d+))?$/.exec(group);
|
||||
|
||||
if (matches) {
|
||||
return -500;
|
||||
}
|
||||
|
||||
return undefined; // {{SQL CARBON EDIT}} strict-null-checks
|
||||
}
|
||||
}
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
export class LabelContribution implements IWorkbenchContribution {
|
||||
constructor(
|
||||
|
||||
@@ -7,14 +7,13 @@ import { localize } from 'vs/nls';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
|
||||
import { DirtyDiffWorkbenchController } from './dirtydiffDecorator';
|
||||
import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor, ShowViewletAction } from 'vs/workbench/browser/viewlet';
|
||||
import { VIEWLET_ID, VIEW_CONTAINER, ISCMRepository, ISCMService } from 'vs/workbench/contrib/scm/common/scm';
|
||||
import { ShowViewletAction } from 'vs/workbench/browser/viewlet';
|
||||
import { VIEWLET_ID, ISCMRepository, ISCMService } from 'vs/workbench/contrib/scm/common/scm';
|
||||
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions';
|
||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { SCMStatusController } from './activity';
|
||||
import { SCMViewlet } from 'vs/workbench/contrib/scm/browser/scmViewlet';
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
@@ -24,6 +23,8 @@ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/co
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { SCMService } from 'vs/workbench/contrib/scm/common/scmService';
|
||||
import { IViewContainersRegistry, ViewContainerLocation, Extensions as ViewContainerExtensions } from 'vs/workbench/common/views';
|
||||
import { SCMViewPaneContainer } from 'vs/workbench/contrib/scm/browser/scmViewlet';
|
||||
|
||||
class OpenSCMViewletAction extends ShowViewletAction {
|
||||
|
||||
@@ -38,13 +39,13 @@ class OpenSCMViewletAction extends ShowViewletAction {
|
||||
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
|
||||
.registerWorkbenchContribution(DirtyDiffWorkbenchController, LifecyclePhase.Restored);
|
||||
|
||||
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).registerViewlet(ViewletDescriptor.create(
|
||||
SCMViewlet,
|
||||
VIEWLET_ID,
|
||||
VIEW_CONTAINER.name,
|
||||
'codicon-source-control',
|
||||
12 // {{SQL CARBON EDIT}}
|
||||
));
|
||||
Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
||||
id: VIEWLET_ID,
|
||||
name: localize('source control', "Source Control"),
|
||||
ctorDescriptor: { ctor: SCMViewPaneContainer },
|
||||
icon: 'codicon-source-control',
|
||||
order: 12 // {{SQL CARBON EDIT}}
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
|
||||
.registerWorkbenchContribution(SCMStatusController, LifecyclePhase.Restored);
|
||||
|
||||
@@ -8,7 +8,7 @@ import { localize } from 'vs/nls';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { append, $, toggleClass, addClasses } from 'vs/base/browser/dom';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { VIEWLET_ID, ISCMService, ISCMRepository, VIEW_CONTAINER } from 'vs/workbench/contrib/scm/common/scm';
|
||||
import { VIEWLET_ID, ISCMService, ISCMRepository } from 'vs/workbench/contrib/scm/common/scm';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
@@ -31,7 +31,6 @@ import { nextTick } from 'vs/base/common/process';
|
||||
import { RepositoryPane, RepositoryViewDescriptor } from 'vs/workbench/contrib/scm/browser/repositoryPane';
|
||||
import { MainPaneDescriptor, MainPane } from 'vs/workbench/contrib/scm/browser/mainPane';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
|
||||
export interface ISpliceEvent<T> {
|
||||
index: number;
|
||||
@@ -51,22 +50,6 @@ export interface IViewModel {
|
||||
readonly onDidChangeVisibility: Event<boolean>;
|
||||
}
|
||||
|
||||
export class SCMViewlet extends Viewlet {
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IStorageService protected storageService: IStorageService,
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextMenuService protected contextMenuService: IContextMenuService,
|
||||
@IExtensionService protected extensionService: IExtensionService,
|
||||
@IWorkspaceContextService protected contextService: IWorkspaceContextService,
|
||||
@IWorkbenchLayoutService protected layoutService: IWorkbenchLayoutService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService
|
||||
) {
|
||||
super(VIEWLET_ID, instantiationService.createInstance(SCMViewPaneContainer), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService);
|
||||
}
|
||||
}
|
||||
|
||||
export class SCMViewPaneContainer extends ViewPaneContainer implements IViewModel {
|
||||
|
||||
private static readonly STATE_KEY = 'workbench.scm.views.state';
|
||||
@@ -124,7 +107,7 @@ export class SCMViewPaneContainer extends ViewPaneContainer implements IViewMode
|
||||
this.message = $('.empty-message', { tabIndex: 0 }, localize('no open repo', "No source control providers registered."));
|
||||
|
||||
const viewsRegistry = Registry.as<IViewsRegistry>(Extensions.ViewsRegistry);
|
||||
viewsRegistry.registerViews([new MainPaneDescriptor(this)], VIEW_CONTAINER);
|
||||
viewsRegistry.registerViews([new MainPaneDescriptor(this)], this.viewContainer);
|
||||
|
||||
this._register(configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration('scm.alwaysShowProviders') && configurationService.getValue<boolean>('scm.alwaysShowProviders')) {
|
||||
@@ -153,7 +136,7 @@ export class SCMViewPaneContainer extends ViewPaneContainer implements IViewMode
|
||||
this._repositories.push(repository);
|
||||
|
||||
const viewDescriptor = new RepositoryViewDescriptor(repository, false);
|
||||
Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).registerViews([viewDescriptor], VIEW_CONTAINER);
|
||||
Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).registerViews([viewDescriptor], this.viewContainer);
|
||||
this.viewDescriptors.push(viewDescriptor);
|
||||
|
||||
this._onDidSplice.fire({ index, deleteCount: 0, elements: [repository] });
|
||||
@@ -169,7 +152,7 @@ export class SCMViewPaneContainer extends ViewPaneContainer implements IViewMode
|
||||
return;
|
||||
}
|
||||
|
||||
Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).deregisterViews([this.viewDescriptors[index]], VIEW_CONTAINER);
|
||||
Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).deregisterViews([this.viewDescriptors[index]], this.viewContainer);
|
||||
|
||||
this._repositories.splice(index, 1);
|
||||
this.viewDescriptors.splice(index, 1);
|
||||
|
||||
@@ -9,12 +9,8 @@ import { Event } from 'vs/base/common/event';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Command } from 'vs/editor/common/modes';
|
||||
import { ISequence } from 'vs/base/common/sequence';
|
||||
import { Extensions as ViewContainerExtensions, ViewContainer, IViewContainersRegistry, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { localize } from 'vs/nls';
|
||||
|
||||
export const VIEWLET_ID = 'workbench.view.scm';
|
||||
export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: VIEWLET_ID, name: localize('source control', "Source Control"), }, ViewContainerLocation.Sidebar);
|
||||
|
||||
export interface IBaselineResourceProvider {
|
||||
getBaselineResource(resource: URI): Promise<URI>;
|
||||
|
||||
@@ -31,10 +31,9 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as PanelExtensions, PanelDescriptor, PanelRegistry } from 'vs/workbench/browser/panel';
|
||||
import { defaultQuickOpenContextKey } from 'vs/workbench/browser/parts/quickopen/quickopen';
|
||||
import { Extensions as QuickOpenExtensions, IQuickOpenRegistry, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen';
|
||||
import { Extensions as ViewletExtensions, ViewletDescriptor, ViewletRegistry } from 'vs/workbench/browser/viewlet';
|
||||
import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
import { Extensions as ViewExtensions, IViewsRegistry } from 'vs/workbench/common/views';
|
||||
import { Extensions as ViewExtensions, IViewsRegistry, IViewContainersRegistry, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
import { getMultiSelectedResources } from 'vs/workbench/contrib/files/browser/files';
|
||||
import { ExplorerFolderContext, ExplorerRootContext, FilesExplorerFocusCondition, IExplorerService, VIEWLET_ID as VIEWLET_ID_FILES } from 'vs/workbench/contrib/files/common/files';
|
||||
import { OpenAnythingHandler } from 'vs/workbench/contrib/search/browser/openAnythingHandler';
|
||||
@@ -43,7 +42,6 @@ import { registerContributions as replaceContributions } from 'vs/workbench/cont
|
||||
import { clearHistoryCommand, ClearSearchResultsAction, CloseReplaceAction, CollapseDeepestExpandedLevelAction, copyAllCommand, copyMatchCommand, copyPathCommand, FocusNextInputAction, FocusNextSearchResultAction, FocusPreviousInputAction, FocusPreviousSearchResultAction, focusSearchListCommand, getSearchView, openSearchView, OpenSearchViewletAction, RefreshAction, RemoveAction, ReplaceAction, ReplaceAllAction, ReplaceAllInFolderAction, ReplaceInFilesAction, toggleCaseSensitiveCommand, toggleRegexCommand, toggleWholeWordCommand, FindInFilesCommand, ToggleSearchOnTypeAction, OpenResultsInEditorAction, RerunEditorSearchAction, RerunEditorSearchWithContextAction, ExpandAllAction } from 'vs/workbench/contrib/search/browser/searchActions';
|
||||
import { SearchPanel } from 'vs/workbench/contrib/search/browser/searchPanel';
|
||||
import { SearchView, SearchViewPosition } from 'vs/workbench/contrib/search/browser/searchView';
|
||||
import { SearchViewlet } from 'vs/workbench/contrib/search/browser/searchViewlet';
|
||||
import { registerContributions as searchWidgetContributions } from 'vs/workbench/contrib/search/browser/searchWidget';
|
||||
import * as Constants from 'vs/workbench/contrib/search/common/constants';
|
||||
import { getWorkspaceSymbols } from 'vs/workbench/contrib/search/common/search';
|
||||
@@ -51,12 +49,13 @@ import { ISearchHistoryService, SearchHistoryService } from 'vs/workbench/contri
|
||||
import { FileMatchOrMatch, ISearchWorkbenchService, RenderableMatch, SearchWorkbenchService, FileMatch, Match, FolderMatch } from 'vs/workbench/contrib/search/common/searchModel';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
import { ISearchConfiguration, ISearchConfigurationProperties, PANEL_ID, VIEWLET_ID, VIEW_ID, VIEW_CONTAINER, SearchSortOrder } from 'vs/workbench/services/search/common/search';
|
||||
import { ISearchConfiguration, ISearchConfigurationProperties, PANEL_ID, VIEWLET_ID, VIEW_ID, SearchSortOrder } from 'vs/workbench/services/search/common/search';
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { ExplorerViewPaneContainer } from 'vs/workbench/contrib/files/browser/explorerViewlet';
|
||||
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
||||
import { assertType } from 'vs/base/common/types';
|
||||
import { SearchViewPaneContainer } from 'vs/workbench/contrib/search/browser/searchViewlet';
|
||||
|
||||
registerSingleton(ISearchWorkbenchService, SearchWorkbenchService, true);
|
||||
registerSingleton(ISearchHistoryService, SearchHistoryService, true);
|
||||
@@ -505,13 +504,14 @@ class ShowAllSymbolsAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).registerViewlet(ViewletDescriptor.create(
|
||||
SearchViewlet,
|
||||
VIEWLET_ID,
|
||||
VIEW_CONTAINER.name,
|
||||
'codicon-search',
|
||||
1
|
||||
));
|
||||
const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
|
||||
id: VIEWLET_ID,
|
||||
name: nls.localize('name', "Search"),
|
||||
ctorDescriptor: { ctor: SearchViewPaneContainer },
|
||||
hideIfEmpty: true,
|
||||
icon: 'codicon-search',
|
||||
order: 1
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(PanelDescriptor.create(
|
||||
SearchPanel,
|
||||
@@ -532,7 +532,7 @@ class RegisterSearchViewContribution implements IWorkbenchContribution {
|
||||
const updateSearchViewLocation = (open: boolean) => {
|
||||
const config = configurationService.getValue<ISearchConfiguration>();
|
||||
if (config.search.location === 'panel') {
|
||||
viewsRegistry.deregisterViews(viewsRegistry.getViews(VIEW_CONTAINER), VIEW_CONTAINER);
|
||||
viewsRegistry.deregisterViews(viewsRegistry.getViews(viewContainer), viewContainer);
|
||||
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(PanelDescriptor.create(
|
||||
SearchPanel,
|
||||
PANEL_ID,
|
||||
@@ -545,7 +545,7 @@ class RegisterSearchViewContribution implements IWorkbenchContribution {
|
||||
}
|
||||
} else {
|
||||
Registry.as<PanelRegistry>(PanelExtensions.Panels).deregisterPanel(PANEL_ID);
|
||||
viewsRegistry.registerViews([{ id: VIEW_ID, name: nls.localize('search', "Search"), ctorDescriptor: { ctor: SearchView, arguments: [SearchViewPosition.SideBar] }, canToggleVisibility: false }], VIEW_CONTAINER);
|
||||
viewsRegistry.registerViews([{ id: VIEW_ID, name: nls.localize('search', "Search"), ctorDescriptor: { ctor: SearchView, arguments: [SearchViewPosition.SideBar] }, canToggleVisibility: false }], viewContainer);
|
||||
if (open) {
|
||||
viewletService.openViewlet(VIEWLET_ID);
|
||||
}
|
||||
|
||||
@@ -14,26 +14,9 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { VIEWLET_ID, VIEW_ID } from 'vs/workbench/services/search/common/search';
|
||||
import { SearchView } from 'vs/workbench/contrib/search/browser/searchView';
|
||||
import { Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
|
||||
|
||||
export class SearchViewlet extends Viewlet {
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IStorageService protected storageService: IStorageService,
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextMenuService protected contextMenuService: IContextMenuService,
|
||||
@IExtensionService protected extensionService: IExtensionService,
|
||||
@IWorkspaceContextService protected contextService: IWorkspaceContextService,
|
||||
@IWorkbenchLayoutService protected layoutService: IWorkbenchLayoutService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService
|
||||
) {
|
||||
super(VIEWLET_ID, instantiationService.createInstance(SearchViewPaneContainer), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService);
|
||||
}
|
||||
}
|
||||
|
||||
export class SearchViewPaneContainer extends ViewPaneContainer {
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -104,5 +104,5 @@ function containsResource(root: URI, resource: URI): boolean {
|
||||
resourceFsPath = resourceFsPath.toLowerCase();
|
||||
}
|
||||
|
||||
return startsWith(resource.fsPath, rootPath);
|
||||
return startsWith(resourceFsPath, rootPath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user