Skip to content

Commit adc2a68

Browse files
author
一辉
authored
chore: update comments、language、tests extension type (#4257)
* fix: update vscode type * feat: update style
1 parent b093d45 commit adc2a68

5 files changed

Lines changed: 53 additions & 4 deletions

File tree

packages/extension/src/common/vscode/ext-types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3422,6 +3422,8 @@ export class TestRunRequest implements vscode.TestRunRequest {
34223422
public readonly include: vscode.TestItem[] | undefined,
34233423
public readonly exclude: vscode.TestItem[] | undefined,
34243424
public readonly profile: vscode.TestRunProfile | undefined,
3425+
public readonly continuous?: boolean,
3426+
public readonly preserveFocus?: boolean,
34253427
) {}
34263428
}
34273429

packages/extension/src/hosted/api/vscode/ext.host.comments.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,19 @@ export class ExtHostCommentThread implements vscode.CommentThread {
454454
this._onDidUpdateCommentThread.fire();
455455
}
456456

457+
private _state: vscode.CommentThreadState | undefined;
458+
459+
get state(): vscode.CommentThreadState | undefined {
460+
return this._state;
461+
}
462+
463+
set state(newState: vscode.CommentThreadState | undefined) {
464+
if (this._state !== newState) {
465+
this._state = newState;
466+
this._onDidUpdateCommentThread.fire();
467+
}
468+
}
469+
457470
private _contextValue: string | undefined;
458471

459472
get contextValue(): string | undefined {

packages/types/vscode/typings/vscode.comments.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ declare module 'vscode' {
8686
*/
8787
label?: string;
8888

89+
/**
90+
* The optional state of a comment thread, which may affect how the comment is displayed.
91+
*/
92+
state?: CommentThreadState;
93+
8994
/**
9095
* Dispose this comment thread.
9196
*
@@ -94,6 +99,14 @@ declare module 'vscode' {
9499
dispose(): void;
95100
}
96101

102+
/**
103+
* The state of a comment thread.
104+
*/
105+
export enum CommentThreadState {
106+
Unresolved = 0,
107+
Resolved = 1
108+
}
109+
97110
/**
98111
* Author information of a [comment](#Comment)
99112
*/

packages/types/vscode/typings/vscode.language.d.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,6 +1788,18 @@ declare module 'vscode' {
17881788
*/
17891789
readonly supportThemeIcons?: boolean;
17901790

1791+
/**
1792+
* Indicates that this markdown string can contain raw html tags. Defaults to `false`.
1793+
*
1794+
* When `supportHtml` is false, the markdown renderer will strip out any raw html tags
1795+
* that appear in the markdown text. This means you can only use markdown syntax for rendering.
1796+
*
1797+
* When `supportHtml` is true, the markdown render will also allow a safe subset of html tags
1798+
* and attributes to be rendered. See https://github.com/microsoft/vscode/blob/6d2920473c6f13759c978dd89104c4270a83422d/src/vs/base/browser/markdownRenderer.ts#L296
1799+
* for a list of all supported tags and attributes.
1800+
*/
1801+
supportHtml?: boolean;
1802+
17911803
/**
17921804
* Uri that relative paths are resolved relative to.
17931805
*
@@ -2076,6 +2088,13 @@ declare module 'vscode' {
20762088
*/
20772089
export class RelativePattern {
20782090

2091+
/**
2092+
* A base file path to which this pattern will be matched against relatively. The
2093+
* file path must be absolute, should not have any trailing path separators and
2094+
* not include any relative segments (`.` or `..`).
2095+
*/
2096+
baseUri?: Uri;
2097+
20792098
/**
20802099
* A base file path to which this pattern will be matched against relatively.
20812100
*/
@@ -2292,7 +2311,7 @@ declare module 'vscode' {
22922311
* @param value A value to append 'as given'. The string will be escaped.
22932312
* @return This snippet string.
22942313
*/
2295-
appendText(value: string): SnippetString;
2314+
appendText(string: string): SnippetString;
22962315

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

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

23192338
/**
23202339
* Builder-function that appends a choice (`${1|a,b,c}`) to

packages/types/vscode/typings/vscode.tests.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,9 @@ declare module "vscode" {
360360
constructor(
361361
include?: readonly TestItem[],
362362
exclude?: readonly TestItem[],
363-
profile?: TestRunProfile
363+
profile?: TestRunProfile,
364+
continuous?: boolean,
365+
preserveFocus?: boolean
364366
);
365367
}
366368
/**

0 commit comments

Comments
 (0)