From e76c18da3c3d54d203752f3d2380ded58a5e7cc3 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Mon, 18 Oct 2021 10:01:48 -0700 Subject: [PATCH] fix more tests --- .../reference/api/tsserverlibrary.d.ts | 23 +++++++++++++++++++ tests/baselines/reference/api/typescript.d.ts | 23 +++++++++++++++++++ .../jsxAttributeCompletionStyleAuto.ts | 3 ++- .../jsxAttributeCompletionStyleBraces.ts | 3 ++- 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 349e025e58e..53ea9d1e628 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3229,6 +3229,21 @@ declare namespace ts { text: string; skipTrivia?: (pos: number) => number; } + export type SnippetElement = TabStop | Placeholder; + export interface TabStop { + kind: SnippetKind.TabStop; + order: number; + } + export interface Placeholder { + kind: SnippetKind.Placeholder; + order: number; + } + export enum SnippetKind { + TabStop = 0, + Placeholder = 1, + Choice = 2, + Variable = 3 + } export enum EmitFlags { None = 0, SingleLine = 1, @@ -4521,6 +4536,14 @@ declare namespace ts { * Moves matching emit helpers from a source node to a target node. */ function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void; + /** + * Gets the SnippetElement of a node. + */ + function getSnippetElement(node: Node): SnippetElement | undefined; + /** + * Sets the SnippetElement of a node. + */ + function setSnippetElement(node: T, snippet: SnippetElement): T; } declare namespace ts { function isNumericLiteral(node: Node): node is NumericLiteral; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 2a2c398553c..a90a3086f6d 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3229,6 +3229,21 @@ declare namespace ts { text: string; skipTrivia?: (pos: number) => number; } + export type SnippetElement = TabStop | Placeholder; + export interface TabStop { + kind: SnippetKind.TabStop; + order: number; + } + export interface Placeholder { + kind: SnippetKind.Placeholder; + order: number; + } + export enum SnippetKind { + TabStop = 0, + Placeholder = 1, + Choice = 2, + Variable = 3 + } export enum EmitFlags { None = 0, SingleLine = 1, @@ -4521,6 +4536,14 @@ declare namespace ts { * Moves matching emit helpers from a source node to a target node. */ function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void; + /** + * Gets the SnippetElement of a node. + */ + function getSnippetElement(node: Node): SnippetElement | undefined; + /** + * Sets the SnippetElement of a node. + */ + function setSnippetElement(node: T, snippet: SnippetElement): T; } declare namespace ts { function isNumericLiteral(node: Node): node is NumericLiteral; diff --git a/tests/cases/fourslash/jsxAttributeCompletionStyleAuto.ts b/tests/cases/fourslash/jsxAttributeCompletionStyleAuto.ts index dc7463df4b4..b8a5b18da83 100644 --- a/tests/cases/fourslash/jsxAttributeCompletionStyleAuto.ts +++ b/tests/cases/fourslash/jsxAttributeCompletionStyleAuto.ts @@ -84,6 +84,7 @@ verify.completions({ ], preferences: { jsxAttributeCompletionStyle: "auto", - includeCompletionsWithSnippetText: true + includeCompletionsWithSnippetText: true, + includeCompletionsWithInsertText: true, } }); \ No newline at end of file diff --git a/tests/cases/fourslash/jsxAttributeCompletionStyleBraces.ts b/tests/cases/fourslash/jsxAttributeCompletionStyleBraces.ts index 051e1bf410d..608c71787d1 100644 --- a/tests/cases/fourslash/jsxAttributeCompletionStyleBraces.ts +++ b/tests/cases/fourslash/jsxAttributeCompletionStyleBraces.ts @@ -90,6 +90,7 @@ verify.completions({ ], preferences: { jsxAttributeCompletionStyle: "braces", - includeCompletionsWithSnippetText: true + includeCompletionsWithSnippetText: true, + includeCompletionsWithInsertText: true, } }); \ No newline at end of file