Finalize comment resolved/unresolved API (#171068)

Fixes #127473
This commit is contained in:
Alex Ross 2023-01-11 15:50:13 +01:00 committed by GitHub
parent 277e80be94
commit b8e69611bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 28 deletions

View file

@ -16,7 +16,6 @@ import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensio
import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments';
import * as extHostTypeConverter from 'vs/workbench/api/common/extHostTypeConverters';
import * as types from 'vs/workbench/api/common/extHostTypes';
import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
import type * as vscode from 'vscode';
import { ExtHostCommentsShape, IMainContext, MainContext, CommentThreadChanges, CommentChanges } from './extHost.protocol';
import { ExtHostCommands } from './extHostCommands';
@ -338,12 +337,10 @@ export function createExtHostComments(mainContext: IMainContext, commands: ExtHo
private _state?: vscode.CommentThreadState;
get state(): vscode.CommentThreadState {
checkProposedApiEnabled(this.extensionDescription, 'commentsResolvedState');
return this._state!;
}
set state(newState: vscode.CommentThreadState) {
checkProposedApiEnabled(this.extensionDescription, 'commentsResolvedState');
this._state = newState;
this.modifications.state = newState;
this._onDidUpdateCommentThread.fire();

View file

@ -8,7 +8,6 @@
export const allApiProposals = Object.freeze({
authSession: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts',
codiconDecoration: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts',
commentsResolvedState: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsResolvedState.d.ts',
contribCommentEditorActionsMenu: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts',
contribCommentPeekContext: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts',
contribCommentThreadAdditionalMenu: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts',

View file

@ -15222,6 +15222,14 @@ declare module 'vscode' {
Preview = 1
}
/**
* The state of a comment thread.
*/
export enum CommentThreadState {
Unresolved = 0,
Resolved = 1
}
/**
* A collection of {@link Comment comments} representing a conversation at a particular range in a document.
*/
@ -15279,6 +15287,11 @@ declare module 'vscode' {
*/
label?: string;
/**
* The optional state of a comment thread, which may affect how the comment is displayed.
*/
state?: CommentThreadState;
/**
* Dispose this comment thread.
*

View file

@ -1,24 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/127473
/**
* The state of a comment thread.
*/
export enum CommentThreadState {
Unresolved = 0,
Resolved = 1
}
export interface CommentThread {
/**
* The optional state of a comment thread, which may affect how the comment is displayed.
*/
state?: CommentThreadState;
}
}