TypeScript/tests/cases/fourslash/completionAutoInsertQuestionDot.ts

21 lines
640 B
TypeScript
Raw Normal View History

/// <reference path="fourslash.ts" />
// @strict: true
//// interface User {
//// address?: {
//// city: string;
//// "postal code": string;
//// }
//// };
//// declare const user: User;
//// user.address[|./**/|]
verify.completions({
marker: "",
exact: [
{ name: "city", text: "(property) city: string", insertText: "?.city", replacementSpan: test.ranges()[0] },
{ name: "postal code", text: "(property) \"postal code\": string", insertText: "?.[\"postal code\"]", replacementSpan: test.ranges()[0] }
],
preferences: { includeInsertTextCompletions: true },
});