Skip to content

Commit

Permalink
#159892 Finalize (#165925)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Nov 9, 2022
1 parent 71f6e26 commit 2cd8ea2
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 118 deletions.
3 changes: 1 addition & 2 deletions extensions/git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"scmValidation",
"tabInputTextMerge",
"timeline",
"contribMergeEditorMenus",
"extensionLog"
"contribMergeEditorMenus"
],
"categories": [
"Other"
Expand Down
1 change: 0 additions & 1 deletion extensions/git/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"src/**/*",
"../../src/vscode-dts/vscode.d.ts",
"../../src/vscode-dts/vscode.proposed.diffCommand.d.ts",
"../../src/vscode-dts/vscode.proposed.extensionLog.d.ts",
"../../src/vscode-dts/vscode.proposed.scmActionButton.d.ts",
"../../src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts",
"../../src/vscode-dts/vscode.proposed.scmValidation.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions extensions/github-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
}
},
"enabledApiProposals": [
"telemetryLogger",
"extensionLog"
"telemetryLogger"
],
"aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",
"main": "./out/extension.js",
Expand Down
3 changes: 1 addition & 2 deletions extensions/github-authentication/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
},
"include": [
"src/**/*",
"../../src/vscode-dts/vscode.d.ts",
"../../src/vscode-dts/vscode.proposed.extensionLog.d.ts"
"../../src/vscode-dts/vscode.d.ts"
]
}
3 changes: 1 addition & 2 deletions extensions/microsoft-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
],
"enabledApiProposals": [
"telemetryLogger",
"idToken",
"extensionLog"
"idToken"
],
"capabilities": {
"virtualWorkspaces": true,
Expand Down
3 changes: 1 addition & 2 deletions extensions/microsoft-authentication/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"include": [
"src/**/*",
"../../src/vscode-dts/vscode.d.ts",
"../../src/vscode-dts/vscode.proposed.idToken.d.ts",
"../../src/vscode-dts/vscode.proposed.extensionLog.d.ts"
"../../src/vscode-dts/vscode.proposed.idToken.d.ts"
]
}
3 changes: 1 addition & 2 deletions extensions/vscode-api-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
"treeItemCheckbox",
"treeViewReveal",
"workspaceTrust",
"telemetry",
"extensionLog"
"telemetry"
],
"private": true,
"activationEvents": [],
Expand Down
2 changes: 0 additions & 2 deletions src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
return initData.uiKind;
},
get logLevel() {
checkProposedApiEnabled(extension, 'extensionLog');
return extHostLogService.getLevel();
},
get onDidChangeLogLevel() {
checkProposedApiEnabled(extension, 'extensionLog');
return extHostLogService.onDidChangeLogLevel;
}
};
Expand Down
4 changes: 0 additions & 4 deletions src/vs/workbench/api/common/extHostOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { isString } from 'vs/base/common/types';
import { FileSystemProviderErrorCode, toFileSystemProviderErrorCode } from 'vs/platform/files/common/files';
import { Emitter } from 'vs/base/common/event';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';

class ExtHostOutputChannel extends AbstractMessageLogger implements vscode.LogOutputChannel {

Expand Down Expand Up @@ -144,9 +143,6 @@ export class ExtHostOutputService implements ExtHostOutputServiceShape {
throw new Error('illegal argument `name`. must not be falsy');
}
const log = typeof options === 'object' && options.log;
if (log) {
checkProposedApiEnabled(extension, 'extensionLog');
}
const languageId = isString(options) ? options : undefined;
if (isString(languageId) && !languageId.trim()) {
throw new Error('illegal argument `languageId`. must not be empty');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const allApiProposals = Object.freeze({
editSessionIdentityProvider: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts',
editorInsets: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts',
envShellEvent: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envShellEvent.d.ts',
extensionLog: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionLog.d.ts',
extensionRuntime: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts',
extensionsAny: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts',
externalUriOpener: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts',
Expand Down
118 changes: 118 additions & 0 deletions src/vscode-dts/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6463,6 +6463,70 @@ declare module 'vscode' {
dispose(): void;
}

/**
* A channel for containing log output.
*
* To get an instance of an `LogOutputChannel` use
* {@link window.createOutputChannel createOutputChannel}.
*/
export interface LogOutputChannel extends OutputChannel {

/**
* The current log level of the channel. Defaults to {@link env.logLevel editor log level}.
*/
readonly logLevel: LogLevel;

/**
* An {@link Event} which fires when the log level of the channel changes.
*/
readonly onDidChangeLogLevel: Event<LogLevel>;

/**
* Outputs the given trace message to the channel. Use this method to log verbose information.
*
* The message is only loggeed if the channel is configured to display {@link LogLevel.Trace trace} log level.
*
* @param message trace message to log
*/
trace(message: string, ...args: any[]): void;

/**
* Outputs the given debug message to the channel.
*
* The message is only loggeed if the channel is configured to display {@link LogLevel.Debug debug} log level or lower.
*
* @param message debug message to log
*/
debug(message: string, ...args: any[]): void;

/**
* Outputs the given information message to the channel.
*
* The message is only loggeed if the channel is configured to display {@link LogLevel.Info info} log level or lower.
*
* @param message info message to log
*/
info(message: string, ...args: any[]): void;

/**
* Outputs the given warning message to the channel.
*
* The message is only loggeed if the channel is configured to display {@link LogLevel.Warning warning} log level or lower.
*
* @param message warning message to log
*/
warn(message: string, ...args: any[]): void;

/**
* Outputs the given error or error message to the channel.
*
* The message is only loggeed if the channel is configured to display {@link LogLevel.Error error} log level or lower.
*
* @param error Error or error message to log
*/
error(error: string | Error, ...args: any[]): void;
}

/**
* Accessibility information which controls screen reader behavior.
*/
Expand Down Expand Up @@ -9191,6 +9255,42 @@ declare module 'vscode' {
Web = 2
}

/**
* Log levels
*/
export enum LogLevel {

/**
* No messages are logged with this level.
*/
Off = 0,

/**
* All messages are logged with this level.
*/
Trace = 1,

/**
* Messages with debug and higher log level are logged with this level.
*/
Debug = 2,

/**
* Messages with info and higher log level are logged with this level.
*/
Info = 3,

/**
* Messages with warning and higher log level are logged with this level.
*/
Warning = 4,

/**
* Only error messages are logged with this level.
*/
Error = 5
}

/**
* Namespace describing the environment the editor runs in.
*/
Expand Down Expand Up @@ -9355,6 +9455,16 @@ declare module 'vscode' {
* @return A uri that can be used on the client machine.
*/
export function asExternalUri(target: Uri): Thenable<Uri>;

/**
* The current log level of the editor.
*/
export const logLevel: LogLevel;

/**
* An {@link Event} which fires when the log level of the editor changes.
*/
export const onDidChangeLogLevel: Event<LogLevel>;
}

/**
Expand Down Expand Up @@ -9920,6 +10030,14 @@ declare module 'vscode' {
*/
export function createOutputChannel(name: string, languageId?: string): OutputChannel;

/**
* Creates a new {@link LogOutputChannel log output channel} with the given name.
*
* @param name Human-readable string which will be used to represent the channel in the UI.
* @param options Options for the log output channel.
*/
export function createOutputChannel(name: string, options: { log: true }): LogOutputChannel;

/**
* Create and show a new webview panel.
*
Expand Down
98 changes: 0 additions & 98 deletions src/vscode-dts/vscode.proposed.extensionLog.d.ts

This file was deleted.

0 comments on commit 2cd8ea2

Please sign in to comment.