Skip to content

Commit

Permalink
chore: update comments、language、tests extension type (#4257)
Browse files Browse the repository at this point in the history
* fix: update vscode type

* feat: update style
  • Loading branch information
hui2334387208 authored Dec 23, 2024
1 parent b093d45 commit adc2a68
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/extension/src/common/vscode/ext-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3422,6 +3422,8 @@ export class TestRunRequest implements vscode.TestRunRequest {
public readonly include: vscode.TestItem[] | undefined,
public readonly exclude: vscode.TestItem[] | undefined,
public readonly profile: vscode.TestRunProfile | undefined,
public readonly continuous?: boolean,
public readonly preserveFocus?: boolean,
) {}
}

Expand Down
13 changes: 13 additions & 0 deletions packages/extension/src/hosted/api/vscode/ext.host.comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,19 @@ export class ExtHostCommentThread implements vscode.CommentThread {
this._onDidUpdateCommentThread.fire();
}

private _state: vscode.CommentThreadState | undefined;

get state(): vscode.CommentThreadState | undefined {
return this._state;
}

set state(newState: vscode.CommentThreadState | undefined) {
if (this._state !== newState) {
this._state = newState;
this._onDidUpdateCommentThread.fire();
}
}

private _contextValue: string | undefined;

get contextValue(): string | undefined {
Expand Down
13 changes: 13 additions & 0 deletions packages/types/vscode/typings/vscode.comments.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,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.
*
Expand All @@ -94,6 +99,14 @@ declare module 'vscode' {
dispose(): void;
}

/**
* The state of a comment thread.
*/
export enum CommentThreadState {
Unresolved = 0,
Resolved = 1
}

/**
* Author information of a [comment](#Comment)
*/
Expand Down
25 changes: 22 additions & 3 deletions packages/types/vscode/typings/vscode.language.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,18 @@ declare module 'vscode' {
*/
readonly supportThemeIcons?: boolean;

/**
* Indicates that this markdown string can contain raw html tags. Defaults to `false`.
*
* When `supportHtml` is false, the markdown renderer will strip out any raw html tags
* that appear in the markdown text. This means you can only use markdown syntax for rendering.
*
* When `supportHtml` is true, the markdown render will also allow a safe subset of html tags
* and attributes to be rendered. See https://github.com/microsoft/vscode/blob/6d2920473c6f13759c978dd89104c4270a83422d/src/vs/base/browser/markdownRenderer.ts#L296
* for a list of all supported tags and attributes.
*/
supportHtml?: boolean;

/**
* Uri that relative paths are resolved relative to.
*
Expand Down Expand Up @@ -2076,6 +2088,13 @@ declare module 'vscode' {
*/
export class RelativePattern {

/**
* A base file path to which this pattern will be matched against relatively. The
* file path must be absolute, should not have any trailing path separators and
* not include any relative segments (`.` or `..`).
*/
baseUri?: Uri;

/**
* A base file path to which this pattern will be matched against relatively.
*/
Expand Down Expand Up @@ -2292,7 +2311,7 @@ declare module 'vscode' {
* @param value A value to append 'as given'. The string will be escaped.
* @return This snippet string.
*/
appendText(value: string): SnippetString;
appendText(string: string): SnippetString;

/**
* Builder-function that appends a tabstop (`$1`, `$2` etc) to
Expand All @@ -2302,7 +2321,7 @@ declare module 'vscode' {
* value starting at 1.
* @return This snippet string.
*/
appendTabstop(num?: number): SnippetString;
appendTabstop(number?: number): SnippetString;

/**
* Builder-function that appends a placeholder (`${1:value}`) to
Expand All @@ -2314,7 +2333,7 @@ declare module 'vscode' {
* value starting at 1.
* @return This snippet string.
*/
appendPlaceholder(value: string | ((snippet: SnippetString) => any), num?: number): SnippetString;
appendPlaceholder(value: string | ((snippet: SnippetString) => any), number?: number): SnippetString;

/**
* Builder-function that appends a choice (`${1|a,b,c}`) to
Expand Down
4 changes: 3 additions & 1 deletion packages/types/vscode/typings/vscode.tests.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ declare module "vscode" {
constructor(
include?: readonly TestItem[],
exclude?: readonly TestItem[],
profile?: TestRunProfile
profile?: TestRunProfile,
continuous?: boolean,
preserveFocus?: boolean
);
}
/**
Expand Down

0 comments on commit adc2a68

Please sign in to comment.