mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-30 16:50:30 -04:00
Merge from vscode 6fded8a497cd0142de3a1c607649a5423a091a25
This commit is contained in:
@@ -160,3 +160,32 @@
|
||||
.monaco-workbench .part.sidebar .title-actions .terminal-action.codicon-split-horizontal {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.monaco-workbench .part > .title > .title-actions .switch-terminal {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 11px;
|
||||
margin-right: 0.3em;
|
||||
height: 20px;
|
||||
flex-shrink: 1;
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
.monaco-workbench.mac .part > .title > .title-actions .switch-terminal {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.monaco-workbench .part > .title > .title-actions .switch-terminal > .monaco-select-box {
|
||||
border: none !important;
|
||||
display: block !important;
|
||||
background-color: unset !important;
|
||||
}
|
||||
|
||||
.monaco-pane-view .pane > .pane-header .monaco-action-bar .switch-terminal.action-item.select-container {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.monaco-workbench .part > .title > .title-actions .switch-terminal > .monaco-select-box {
|
||||
padding: 0 22px 0 6px;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,8 @@ import { EndOfLinePreference } from 'vs/editor/common/model';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { TERMINAL_VIEW_ID, ITerminalConfigHelper, TitleEventSource, TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { SelectActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { TogglePanelAction } from 'vs/workbench/browser/panel';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { attachSelectBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IQuickInputService, IPickOptions, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -32,6 +30,11 @@ import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { ITerminalInstance, ITerminalService, Direction } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { Action2 } from 'vs/platform/actions/common/actions';
|
||||
import { TerminalQuickAccessProvider } from 'vs/workbench/contrib/terminal/browser/terminalsQuickAccess';
|
||||
import { ToggleViewAction } from 'vs/workbench/browser/actions/layoutActions';
|
||||
import { IViewsService, IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { addClass } from 'vs/base/browser/dom';
|
||||
import { selectBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
|
||||
async function getCwdForSplit(configHelper: ITerminalConfigHelper, instance: ITerminalInstance, folders?: IWorkspaceFolder[], commandService?: ICommandService): Promise<string | URI | undefined> {
|
||||
switch (configHelper.config.splitCwd) {
|
||||
@@ -60,18 +63,20 @@ async function getCwdForSplit(configHelper: ITerminalConfigHelper, instance: ITe
|
||||
}
|
||||
}
|
||||
|
||||
export class ToggleTerminalAction extends TogglePanelAction {
|
||||
export class ToggleTerminalAction extends ToggleViewAction {
|
||||
|
||||
public static readonly ID = TERMINAL_COMMAND_ID.TOGGLE;
|
||||
public static readonly LABEL = nls.localize('workbench.action.terminal.toggleTerminal', "Toggle Integrated Terminal");
|
||||
|
||||
constructor(
|
||||
id: string, label: string,
|
||||
@IPanelService panelService: IPanelService,
|
||||
@IViewsService viewsService: IViewsService,
|
||||
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ITerminalService private readonly terminalService: ITerminalService
|
||||
) {
|
||||
super(id, label, TERMINAL_VIEW_ID, panelService, layoutService);
|
||||
super(id, label, TERMINAL_VIEW_ID, viewsService, viewDescriptorService, contextKeyService, layoutService);
|
||||
}
|
||||
|
||||
public run(event?: any): Promise<any> {
|
||||
@@ -717,7 +722,7 @@ export class SwitchTerminalActionViewItem extends SelectActionViewItem {
|
||||
constructor(
|
||||
action: IAction,
|
||||
@ITerminalService private readonly terminalService: ITerminalService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IThemeService private readonly themeService: IThemeService,
|
||||
@IContextViewService contextViewService: IContextViewService
|
||||
) {
|
||||
super(null, action, terminalService.getTabLabels().map(label => <ISelectOptionItem>{ text: label }), terminalService.activeTabIndex, contextViewService, { ariaLabel: nls.localize('terminals', 'Open Terminals.') });
|
||||
@@ -729,6 +734,14 @@ export class SwitchTerminalActionViewItem extends SelectActionViewItem {
|
||||
this._register(attachSelectBoxStyler(this.selectBox, themeService));
|
||||
}
|
||||
|
||||
render(container: HTMLElement): void {
|
||||
super.render(container);
|
||||
addClass(container, 'switch-terminal');
|
||||
this._register(attachStylerCallback(this.themeService, { selectBorder }, colors => {
|
||||
container.style.border = colors.selectBorder ? `1px solid ${colors.selectBorder}` : '';
|
||||
}));
|
||||
}
|
||||
|
||||
private _updateItems(): void {
|
||||
const items = this.terminalService.getTabLabels().map(label => <ISelectOptionItem>{ text: label });
|
||||
items.push({ text: SwitchTerminalActionViewItem.SEPARATOR, isDisabled: true });
|
||||
|
||||
@@ -244,7 +244,7 @@ export class TerminalLinkHandler extends DisposableStore {
|
||||
const wasHandled = await new Promise<boolean>(r => {
|
||||
const timeoutId = setTimeout(() => {
|
||||
canceled = true;
|
||||
this._logService.error('An extension intecepted a terminal link but did not return');
|
||||
this._logService.error(`An extension intecepted a terminal link but it timed out after ${TerminalLinkHandler.LINK_INTERCEPT_THRESHOLD / 1000} seconds`);
|
||||
r(false);
|
||||
}, TerminalLinkHandler.LINK_INTERCEPT_THRESHOLD);
|
||||
let canceled = false;
|
||||
|
||||
@@ -36,7 +36,6 @@ export class TerminalQuickAccessProvider extends PickerQuickAccessProvider<IPick
|
||||
if (highlights) {
|
||||
terminalPicks.push({
|
||||
label,
|
||||
ariaLabel: localize('termEntryAriaLabel', "{0}, terminal picker", label),
|
||||
highlights: { label: highlights },
|
||||
buttons: [
|
||||
{
|
||||
@@ -76,7 +75,7 @@ export class TerminalQuickAccessProvider extends PickerQuickAccessProvider<IPick
|
||||
const createTerminalLabel = localize("workbench.action.terminal.newplus", "Create New Integrated Terminal");
|
||||
terminalPicks.push({
|
||||
label: `$(plus) ${createTerminalLabel}`,
|
||||
ariaLabel: localize('termEntryAriaLabel', "{0}, terminal picker", createTerminalLabel),
|
||||
ariaLabel: createTerminalLabel,
|
||||
accept: () => this.commandService.executeCommand('workbench.action.terminal.new')
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user