Skip to content

Commit 21d1ef7

Browse files
committed
add label details support to fourslash
1 parent df7e8ca commit 21d1ef7

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/harness/fourslashImpl.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,8 @@ namespace FourSlash {
983983
assert.equal<boolean | undefined>(actual.isPackageJsonImport, expected.isPackageJsonImport, `At entry ${actual.name}: Expected 'isPackageJsonImport' properties to match`);
984984
}
985985

986+
assert.equal(actual.labelDetails?.description, expected.labelDetails?.description, `At entry ${actual.name}: Expected 'labelDetails.description' properties to match`);
987+
assert.equal(actual.labelDetails?.detail, expected.labelDetails?.detail, `At entry ${actual.name}: Expected 'labelDetails.detail' properties to match`);
986988
assert.equal(actual.hasAction, expected.hasAction, `At entry ${actual.name}: Expected 'hasAction' properties to match`);
987989
assert.equal(actual.isRecommended, expected.isRecommended, `At entry ${actual.name}: Expected 'isRecommended' properties to match'`);
988990
assert.equal(actual.isSnippet, expected.isSnippet, `At entry ${actual.name}: Expected 'isSnippet' properties to match`);

src/harness/fourslashInterfaceImpl.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,10 +1719,16 @@ namespace FourSlashInterface {
17191719
readonly text?: string;
17201720
readonly documentation?: string;
17211721
readonly sourceDisplay?: string;
1722+
readonly labelDetails?: ExpectedCompletionEntryLabelDetails;
17221723
readonly tags?: readonly ts.JSDocTagInfo[];
17231724
readonly sortText?: ts.Completions.SortText;
17241725
}
17251726

1727+
export interface ExpectedCompletionEntryLabelDetails {
1728+
detail?: string;
1729+
description?: string;
1730+
}
1731+
17261732
export type ExpectedExactCompletionsPlus = readonly ExpectedCompletionEntry[] & {
17271733
plusFunctionName: string,
17281734
plusArgument: readonly ExpectedCompletionEntry[]

tests/cases/fourslash/fourslash.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,12 @@ declare namespace FourSlashInterface {
700700
readonly documentation?: string;
701701
readonly tags?: ReadonlyArray<JSDocTagInfo>;
702702
readonly sourceDisplay?: string;
703+
readonly labelDetails?: ExpectedCompletionEntryLabelDetails;
704+
}
705+
706+
export interface ExpectedCompletionEntryLabelDetails {
707+
detail?: string;
708+
description?: string;
703709
}
704710

705711
interface VerifySignatureHelpOptions {

0 commit comments

Comments
 (0)