Skip to content

Commit bab485c

Browse files
committed
Merge remote-tracking branch 'origin/main' into tyriar/185254
2 parents 163ceca + 9328d38 commit bab485c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+258
-209
lines changed

src/vs/platform/actions/browser/buttonbar.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
1818
export type IButtonConfigProvider = (action: IAction) => {
1919
showIcon?: boolean;
2020
showLabel?: boolean;
21+
isSecondary?: boolean;
2122
} | undefined;
2223

2324
export interface IMenuWorkbenchButtonBarOptions {
@@ -68,6 +69,7 @@ export class MenuWorkbenchButtonBar extends ButtonBar {
6869
.flatMap(entry => entry[1]);
6970

7071
for (let i = 0; i < actions.length; i++) {
72+
7173
const secondary = i > 0;
7274
const actionOrSubmenu = actions[i];
7375
let action: MenuItemAction | SubmenuItemAction;
@@ -77,14 +79,16 @@ export class MenuWorkbenchButtonBar extends ButtonBar {
7779
const [first, ...rest] = actionOrSubmenu.actions;
7880
action = <MenuItemAction>first;
7981
btn = this.addButtonWithDropdown({
80-
secondary,
82+
secondary: conifgProvider(action)?.isSecondary ?? secondary,
8183
actionRunner,
8284
actions: rest,
8385
contextMenuProvider: contextMenuService,
8486
});
8587
} else {
8688
action = actionOrSubmenu;
87-
btn = this.addButton({ secondary });
89+
btn = this.addButton({
90+
secondary: conifgProvider(action)?.isSecondary ?? secondary,
91+
});
8892
}
8993

9094
btn.enabled = action.enabled;

src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
112112

113113
constructor(
114114
private readonly _terminal: Terminal,
115-
@ILogService private readonly _logService: ILogService
115+
private readonly _logService: ILogService
116116
) {
117117
this._dimensions = {
118118
cols: this._terminal.cols,

src/vs/platform/terminal/common/terminal.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
1515
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
1616
import { Registry } from 'vs/platform/registry/common/platform';
1717
import type * as performance from 'vs/base/common/performance';
18+
import { ILogService } from 'vs/platform/log/common/log';
1819

1920
export const terminalTabFocusContextKey = new RawContextKey<boolean>('terminalTabFocusMode', false, true);
2021

@@ -1057,3 +1058,13 @@ export const ILocalPtyService = createDecorator<ILocalPtyService>('localPtyServi
10571058
* **This service should only be used within the terminal component.**
10581059
*/
10591060
export interface ILocalPtyService extends IPtyService { }
1061+
1062+
export const ITerminalLogService = createDecorator<ITerminalLogService>('terminalLogService');
1063+
export interface ITerminalLogService extends ILogService {
1064+
/**
1065+
* Similar to _serviceBrand but used to differentiate this service at compile time from
1066+
* ILogService; ITerminalLogService is an ILogService, but ILogService is not an
1067+
* ITerminalLogService.
1068+
*/
1069+
readonly _logBrand: undefined;
1070+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import { Disposable } from 'vs/base/common/lifecycle';
7+
import { Event } from 'vs/base/common/event';
8+
import { localize } from 'vs/nls';
9+
import { ILogger, ILoggerService, LogLevel } from 'vs/platform/log/common/log';
10+
import { ITerminalLogService } from 'vs/platform/terminal/common/terminal';
11+
12+
export class TerminalLogService extends Disposable implements ITerminalLogService {
13+
declare _serviceBrand: undefined;
14+
declare _logBrand: undefined;
15+
16+
private readonly _logger: ILogger;
17+
18+
get onDidChangeLogLevel(): Event<LogLevel> { return this._logger.onDidChangeLogLevel; }
19+
20+
constructor(@ILoggerService private readonly _loggerService: ILoggerService) {
21+
super();
22+
this._logger = this._loggerService.createLogger('terminal', { name: localize('terminalLoggerName', 'Terminal') });
23+
}
24+
25+
getLevel(): LogLevel { return this._logger.getLevel(); }
26+
setLevel(level: LogLevel): void { this._logger.setLevel(level); }
27+
trace(message: string, ...args: any[]): void { this._logger.trace(message, args); }
28+
debug(message: string, ...args: any[]): void { this._logger.debug(message, args); }
29+
info(message: string, ...args: any[]): void { this._logger.info(message, args); }
30+
warn(message: string, ...args: any[]): void { this._logger.warn(message, args); }
31+
error(message: string | Error, ...args: any[]): void { this._logger.error(message, args); }
32+
flush(): void { this._logger.flush(); }
33+
}

src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
209209
private _nonce: string,
210210
private readonly _disableTelemetry: boolean | undefined,
211211
private readonly _telemetryService: ITelemetryService | undefined,
212-
@ILogService private readonly _logService: ILogService
212+
private readonly _logService: ILogService
213213
) {
214214
super();
215215
this._register(toDisposable(() => {

src/vs/platform/terminal/node/ptyHostMain.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ async function startPtyHost() {
4343
delete process.env.VSCODE_STARTUP_DELAY;
4444
delete process.env.VSCODE_LAST_PTY_ID;
4545

46+
// Delay startup if needed, this must occur before RPC is setup to avoid the channel from timing
47+
// out.
48+
if (startupDelay) {
49+
await timeout(startupDelay);
50+
}
51+
4652
// Setup RPC
4753
const _isUtilityProcess = isUtilityProcess(process);
4854
let server: ChildProcessServer<string> | UtilityProcessServer;
@@ -60,10 +66,9 @@ async function startPtyHost() {
6066
const logger = loggerService.createLogger('ptyhost', { name: localize('ptyHost', "Pty Host") });
6167
const logService = new LogService(logger, [new ConsoleLogger()]);
6268

63-
// Log and apply developer config
69+
// Log developer config
6470
if (startupDelay) {
6571
logService.warn(`Pty Host startup is delayed ${startupDelay}ms`);
66-
await timeout(startupDelay);
6772
}
6873
if (simulatedLatency) {
6974
logService.warn(`Pty host is simulating ${simulatedLatency}ms latency`);

src/vs/server/node/remoteTerminalChannel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { URI } from 'vs/base/common/uri';
1313
import { IURITransformer } from 'vs/base/common/uriIpc';
1414
import { IServerChannel } from 'vs/base/parts/ipc/common/ipc';
1515
import { createRandomIPCHandle } from 'vs/base/parts/ipc/node/ipc.net';
16-
import { ILogService } from 'vs/platform/log/common/log';
1716
import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment';
1817
import { IPtyService, IShellLaunchConfig, ITerminalProfile } from 'vs/platform/terminal/common/terminal';
1918
import { IGetTerminalLayoutInfoArgs, ISetTerminalLayoutInfoArgs } from 'vs/platform/terminal/common/terminalProcess';
@@ -32,6 +31,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
3231
import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement';
3332
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
3433
import { withNullAsUndefined } from 'vs/base/common/types';
34+
import { ILogService } from 'vs/platform/log/common/log';
3535

3636
class CustomVariableResolver extends AbstractVariableResolverService {
3737
constructor(

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
14621462
ThemeColor: extHostTypes.ThemeColor,
14631463
ThemeIcon: extHostTypes.ThemeIcon,
14641464
TreeItem: extHostTypes.TreeItem,
1465-
TreeItem2: extHostTypes.TreeItem,
14661465
TreeItemCheckboxState: extHostTypes.TreeItemCheckboxState,
14671466
TreeItemCollapsibleState: extHostTypes.TreeItemCollapsibleState,
14681467
TypeHierarchyItem: extHostTypes.TypeHierarchyItem,

src/vs/workbench/api/common/extHostTreeViews.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'
2222
import { MarkdownString, ViewBadge, DataTransfer } from 'vs/workbench/api/common/extHostTypeConverters';
2323
import { IMarkdownString } from 'vs/base/common/htmlContent';
2424
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
25-
import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
2625
import { ITreeViewsDnDService, TreeViewsDnDService } from 'vs/editor/common/services/treeViewsDnd';
2726
import { IAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility';
2827

@@ -103,7 +102,6 @@ export class ExtHostTreeViews implements ExtHostTreeViewsShape {
103102
get visible() { return treeView.visible; },
104103
get onDidChangeVisibility() { return treeView.onDidChangeVisibility; },
105104
get onDidChangeCheckboxState() {
106-
checkProposedApiEnabled(extension, 'treeItemCheckbox');
107105
return treeView.onDidChangeCheckboxState;
108106
},
109107
get message() { return treeView.message; },
@@ -500,7 +498,7 @@ class ExtHostTreeView<T> extends Disposable {
500498
}
501499

502500
async setCheckboxState(checkboxUpdates: CheckboxUpdate[]) {
503-
type CheckboxUpdateWithItem = { extensionItem: NonNullable<T>; treeItem: vscode.TreeItem2; newState: TreeItemCheckboxState };
501+
type CheckboxUpdateWithItem = { extensionItem: NonNullable<T>; treeItem: vscode.TreeItem; newState: TreeItemCheckboxState };
504502
const items = (await Promise.all(checkboxUpdates.map(async checkboxUpdate => {
505503
const extensionItem = this.getExtensionElement(checkboxUpdate.treeItemHandle);
506504
if (extensionItem) {
@@ -763,7 +761,7 @@ class ExtHostTreeView<T> extends Disposable {
763761
return command ? { ...this.commands.toInternal(command, disposable), originalId: command.command } : undefined;
764762
}
765763

766-
private getCheckbox(extensionTreeItem: vscode.TreeItem2): ITreeItemCheckboxState | undefined {
764+
private getCheckbox(extensionTreeItem: vscode.TreeItem): ITreeItemCheckboxState | undefined {
767765
if (extensionTreeItem.checkboxState === undefined) {
768766
return undefined;
769767
}

src/vs/workbench/api/common/extHostTypes.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { FileSystemProviderErrorCode, markAsFileSystemProviderError } from 'vs/p
1818
import { RemoteAuthorityResolverErrorCode } from 'vs/platform/remote/common/remoteAuthorityResolver';
1919
import { IRelativePatternDto } from 'vs/workbench/api/common/extHost.protocol';
2020
import { CellEditType, ICellMetadataEdit, IDocumentMetadataEdit, isTextStreamMime } from 'vs/workbench/contrib/notebook/common/notebookCommon';
21-
import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
2221
import type * as vscode from 'vscode';
2322

2423
/**
@@ -2542,10 +2541,9 @@ export class TreeItem {
25422541
checkboxState?: vscode.TreeItemCheckboxState;
25432542

25442543
static isTreeItem(thing: any, extension: IExtensionDescription): thing is TreeItem {
2545-
const treeItemThing = thing as vscode.TreeItem2;
2544+
const treeItemThing = thing as vscode.TreeItem;
25462545

25472546
if (treeItemThing.checkboxState !== undefined) {
2548-
checkProposedApiEnabled(extension, 'treeItemCheckbox');
25492547
const checkbox = isNumber(treeItemThing.checkboxState) ? treeItemThing.checkboxState :
25502548
isObject(treeItemThing.checkboxState) && isNumber(treeItemThing.checkboxState.state) ? treeItemThing.checkboxState.state : undefined;
25512549
const tooltip = !isNumber(treeItemThing.checkboxState) && isObject(treeItemThing.checkboxState) ? treeItemThing.checkboxState.tooltip : undefined;

0 commit comments

Comments
 (0)