diff --git a/CHANGELOG.md b/CHANGELOG.md index 192e6e383..1c74cb8b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This changelog records changes to stable releases since 1.50.2. "TBA" changes he ## Nightly (only) +Nothing, yet + +## v1.82 (August 2023) + - feat: allow basic webassembly debugging ([vscode#102181](https://github.com/microsoft/vscode/issues/102181)) - feat: add `Symbol.for("debug.description")` as a way to generate object descriptions ([vscode#102181](https://github.com/microsoft/vscode/issues/102181)) - feat: adopt supportTerminateDebuggee for browsers and node ([#1733](https://github.com/microsoft/vscode-js-debug/issues/1733)) diff --git a/package-lock.json b/package-lock.json index fe22a6c93..d733c9f3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "js-debug", - "version": "1.81.0", + "version": "1.82.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "js-debug", - "version": "1.81.0", + "version": "1.82.0", "license": "MIT", "dependencies": { "@c4312/chromehash": "^0.3.0", diff --git a/package.json b/package.json index 34fae468b..5632c6fee 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "js-debug", "displayName": "JavaScript Debugger", - "version": "1.81.0", + "version": "1.82.0", "publisher": "ms-vscode", "author": { "name": "Microsoft Corporation" diff --git a/src/typings/vscode.d.ts b/src/typings/vscode.d.ts index 8c72191f5..4f5c61daa 100644 --- a/src/typings/vscode.d.ts +++ b/src/typings/vscode.d.ts @@ -1733,6 +1733,11 @@ declare module 'vscode' { */ kind?: QuickPickItemKind; + /** + * The icon path or {@link ThemeIcon} for the QuickPickItem. + */ + iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon; + /** * A human-readable string which is rendered less prominent in the same line. Supports rendering of * {@link ThemeIcon theme icons} via the `$()`-syntax. @@ -4145,6 +4150,26 @@ declare module 'vscode' { * signaled by returning `undefined`, `null`, or an empty array. */ provideDocumentRangeFormattingEdits(document: TextDocument, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult; + + + /** + * Provide formatting edits for multiple ranges in a document. + * + * This function is optional but allows a formatter to perform faster when formatting only modified ranges or when + * formatting a large number of selections. + * + * The given ranges are hints and providers can decide to format a smaller + * or larger range. Often this is done by adjusting the start and end + * of the range to full syntax nodes. + * + * @param document The document in which the command was invoked. + * @param ranges The ranges which should be formatted. + * @param options Options controlling formatting. + * @param token A cancellation token. + * @return A set of text edits or a thenable that resolves to such. The lack of a result can be + * signaled by returning `undefined`, `null`, or an empty array. + */ + provideDocumentRangesFormattingEdits?(document: TextDocument, ranges: Range[], options: FormattingOptions, token: CancellationToken): ProviderResult; } /** @@ -7160,10 +7185,10 @@ declare module 'vscode' { readonly extensionPath: string; /** - * Gets the extension's environment variable collection for this workspace, enabling changes - * to be applied to terminal environment variables. + * Gets the extension's global environment variable collection for this workspace, enabling changes to be + * applied to terminal environment variables. */ - readonly environmentVariableCollection: EnvironmentVariableCollection; + readonly environmentVariableCollection: GlobalEnvironmentVariableCollection; /** * Get the absolute path of a resource contained in the extension. @@ -10392,6 +10417,44 @@ declare module 'vscode' { * An optional interface to implement drag and drop in the tree view. */ dragAndDropController?: TreeDragAndDropController; + + /** + * By default, when the children of a tree item have already been fetched, child checkboxes are automatically managed based on the checked state of the parent tree item. + * If the tree item is collapsed by default (meaning that the children haven't yet been fetched) then child checkboxes will not be updated. + * To override this behavior and manage child and parent checkbox state in the extension, set this to `true`. + * + * Examples where {@link TreeViewOptions.manageCheckboxStateManually} is false, the default behavior: + * + * 1. A tree item is checked, then its children are fetched. The children will be checked. + * + * 2. A tree item's parent is checked. The tree item and all of it's siblings will be checked. + * - [ ] Parent + * - [ ] Child 1 + * - [ ] Child 2 + * When the user checks Parent, the tree will look like this: + * - [x] Parent + * - [x] Child 1 + * - [x] Child 2 + * + * 3. A tree item and all of it's siblings are checked. The parent will be checked. + * - [ ] Parent + * - [ ] Child 1 + * - [ ] Child 2 + * When the user checks Child 1 and Child 2, the tree will look like this: + * - [x] Parent + * - [x] Child 1 + * - [x] Child 2 + * + * 4. A tree item is unchecked. The parent will be unchecked. + * - [x] Parent + * - [x] Child 1 + * - [x] Child 2 + * When the user unchecks Child 1, the tree will look like this: + * - [ ] Parent + * - [ ] Child 1 + * - [x] Child 2 + */ + manageCheckboxStateManually?: boolean; } /** @@ -10608,6 +10671,16 @@ declare module 'vscode' { readonly value: number; } + /** + * An event describing the change in a tree item's checkbox state. + */ + export interface TreeCheckboxChangeEvent { + /** + * The items that were checked or unchecked. + */ + readonly items: ReadonlyArray<[T, TreeItemCheckboxState]>; + } + /** * Represents a Tree view */ @@ -10643,6 +10716,11 @@ declare module 'vscode' { */ readonly onDidChangeVisibility: Event; + /** + * An event to signal that an element or root has either been checked or unchecked. + */ + readonly onDidChangeCheckboxState: Event>; + /** * An optional human-readable message that will be rendered in the view. * Setting the message to null, undefined, or empty string will remove the message from the view. @@ -10824,6 +10902,12 @@ declare module 'vscode' { */ accessibilityInformation?: AccessibilityInformation; + /** + * {@link TreeItemCheckboxState TreeItemCheckboxState} of the tree item. + * {@link TreeDataProvider.onDidChangeTreeData onDidChangeTreeData} should be fired when {@link TreeItem.checkboxState checkboxState} changes. + */ + checkboxState?: TreeItemCheckboxState | { readonly state: TreeItemCheckboxState; readonly tooltip?: string; readonly accessibilityInformation?: AccessibilityInformation }; + /** * @param label A human-readable string describing this item * @param collapsibleState {@link TreeItemCollapsibleState} of the tree item. Default is {@link TreeItemCollapsibleState.None} @@ -10872,6 +10956,20 @@ declare module 'vscode' { highlights?: [number, number][]; } + /** + * Checkbox state of the tree item + */ + export enum TreeItemCheckboxState { + /** + * Determines an item is unchecked + */ + Unchecked = 0, + /** + * Determines an item is checked + */ + Checked = 1 + } + /** * Value-object describing what options a terminal should use. */ @@ -11236,6 +11334,23 @@ declare module 'vscode' { Prepend = 3 } + /** + * Options applied to the mutator. + */ + export interface EnvironmentVariableMutatorOptions { + /** + * Apply to the environment just before the process is created. Defaults to false. + */ + applyAtProcessCreation?: boolean; + + /** + * Apply to the environment in the shell integration script. Note that this _will not_ apply + * the mutator if shell integration is disabled or not working for some reason. Defaults to + * false. + */ + applyAtShellIntegration?: boolean; + } + /** * A type of mutation and its value to be applied to an environment variable. */ @@ -11249,6 +11364,11 @@ declare module 'vscode' { * The value to use for the variable. */ readonly value: string; + + /** + * Options applied to the mutator. + */ + readonly options: EnvironmentVariableMutatorOptions; } /** @@ -11278,8 +11398,10 @@ declare module 'vscode' { * * @param variable The variable to replace. * @param value The value to replace the variable with. + * @param options Options applied to the mutator, when no options are provided this will + * default to `{ applyAtProcessCreation: true }`. */ - replace(variable: string, value: string): void; + replace(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void; /** * Append a value to an environment variable. @@ -11289,8 +11411,10 @@ declare module 'vscode' { * * @param variable The variable to append to. * @param value The value to append to the variable. + * @param options Options applied to the mutator, when no options are provided this will + * default to `{ applyAtProcessCreation: true }`. */ - append(variable: string, value: string): void; + append(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void; /** * Prepend a value to an environment variable. @@ -11300,8 +11424,10 @@ declare module 'vscode' { * * @param variable The variable to prepend. * @param value The value to prepend to the variable. + * @param options Options applied to the mutator, when no options are provided this will + * default to `{ applyAtProcessCreation: true }`. */ - prepend(variable: string, value: string): void; + prepend(variable: string, value: string, options?: EnvironmentVariableMutatorOptions): void; /** * Gets the mutator that this collection applies to a variable, if any. @@ -11331,6 +11457,39 @@ declare module 'vscode' { clear(): void; } + /** + * A collection of mutations that an extension can apply to a process environment. Applies to all scopes. + */ + export interface GlobalEnvironmentVariableCollection extends EnvironmentVariableCollection { + /** + * Gets scope-specific environment variable collection for the extension. This enables alterations to + * terminal environment variables solely within the designated scope, and is applied in addition to (and + * after) the global collection. + * + * Each object obtained through this method is isolated and does not impact objects for other scopes, + * including the global collection. + * + * @param scope The scope to which the environment variable collection applies to. + * + * If a scope parameter is omitted, collection applicable to all relevant scopes for that parameter is + * returned. For instance, if the 'workspaceFolder' parameter is not specified, the collection that applies + * across all workspace folders will be returned. + * + * @return Environment variable collection for the passed in scope. + */ + getScoped(scope: EnvironmentVariableScope): EnvironmentVariableCollection; + } + + /** + * The scope object to which the environment variable collection applies. + */ + export interface EnvironmentVariableScope { + /** + * Any specific workspace folder to get collection for. + */ + workspaceFolder?: WorkspaceFolder; + } + /** * A location in the editor at which progress information can be shown. It depends on the * location how progress is visually represented. @@ -15902,7 +16061,7 @@ declare module 'vscode' { * @param id The unique identifier of the provider. * @param label The human-readable name of the provider. * @param provider The authentication provider provider. - * @params options Additional options for the provider. + * @param options Additional options for the provider. * @return A {@link Disposable} that unregisters this provider when being disposed. */ export function registerAuthenticationProvider(id: string, label: string, provider: AuthenticationProvider, options?: AuthenticationProviderOptions): Disposable; @@ -16226,6 +16385,24 @@ declare module 'vscode' { */ createTestItem(id: string, label: string, uri?: Uri): TestItem; + /** + * Marks an item's results as being outdated. This is commonly called when + * code or configuration changes and previous results should no longer + * be considered relevant. The same logic used to mark results as outdated + * may be used to drive {@link TestRunRequest.continuous continuous test runs}. + * + * If an item is passed to this method, test results for the item and all of + * its children will be marked as outdated. If no item is passed, then all + * test owned by the TestController will be marked as outdated. + * + * Any test runs started before the moment this method is called, including + * runs which may still be ongoing, will be marked as outdated and deprioritized + * in the editor's UI. + * + * @param item Item to mark as outdated. If undefined, all the controller's items are marked outdated. + */ + invalidateTestResults(items?: TestItem | readonly TestItem[]): void; + /** * Unregisters the test controller, disposing of its associated tests * and unpersisted results. diff --git a/src/typings/vscode.proposed.portsAttributes.d.ts b/src/typings/vscode.proposed.portsAttributes.d.ts index 6bbd27653..e3cb4b617 100644 --- a/src/typings/vscode.proposed.portsAttributes.d.ts +++ b/src/typings/vscode.proposed.portsAttributes.d.ts @@ -16,7 +16,7 @@ declare module 'vscode' { */ Notify = 1, /** - * Once the port is forwarded, open the browser to the forwarded port. + * Once the port is forwarded, open the user's web browser to the forwarded port. */ OpenBrowser = 2, /** @@ -30,11 +30,7 @@ declare module 'vscode' { /** * Do not forward the port. */ - Ignore = 5, - /** - * Once the port is forwarded, open the browser to the forwarded port. Only open the browser the first time the port is forwarded in a session. - */ - OpenBrowserOnce = 6 + Ignore = 5 } /** @@ -62,8 +58,12 @@ declare module 'vscode' { * Provides attributes for the given port. For ports that your extension doesn't know about, simply * return undefined. For example, if `providePortAttributes` is called with ports 3000 but your * extension doesn't know anything about 3000 you should return undefined. + * @param port The port number of the port that attributes are being requested for. + * @param pid The pid of the process that is listening on the port. If the pid is unknown, undefined will be passed. + * @param commandLine The command line of the process that is listening on the port. If the command line is unknown, undefined will be passed. + * @param token A cancellation token that indicates the result is no longer needed. */ - providePortAttributes(port: number, pid: number | undefined, commandLine: string | undefined, token: CancellationToken): ProviderResult; + providePortAttributes(attributes: { port: number; pid?: number; commandLine?: string }, token: CancellationToken): ProviderResult; } /** diff --git a/src/ui/portAttributesProvider.ts b/src/ui/portAttributesProvider.ts index 5351a2fbd..68959b2d1 100644 --- a/src/ui/portAttributesProvider.ts +++ b/src/ui/portAttributesProvider.ts @@ -36,7 +36,7 @@ export class JsDebugPortAttributesProvider /** * @inheritdoc */ - public async providePortAttributes(port: number, pid: number | undefined) { + public async providePortAttributes({ port, pid }: { port: number; pid?: number }) { if (pid && this.cachedResolutions.includes(`${port}:${pid}`)) { return { port, autoForwardAction: PortAutoForwardAction.Ignore }; }