fcd9334f57
* Add support for Optional Chaining * Add grammar error for invalid tagged template, more tests * Prototype * PR feedback * Add errors for invalid assignments and a trailing '?.' * Add additional signature help test, fix lint warnings * Fix to insert text for completions * Add initial control-flow analysis for optional chains * PR Feedback and more tests * Update to control flow * Remove mangled smart quotes in comments * Fix lint, PR feedback * Updates to control flow * Switch to FlowCondition for CFA of optional chains * Fix ?. insertion for completions on type variables * Accept API baseline change * Clean up types * improve control-flow debug output * Revert Debug.formatControlFlowGraph helper
21 lines
584 B
TypeScript
21 lines
584 B
TypeScript
/// <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" },
|
|
{ name: "postal code", text: "(property) \"postal code\": string", insertText: "?.[\"postal code\"]", replacementSpan: test.ranges()[0] }
|
|
],
|
|
preferences: { includeInsertTextCompletions: true },
|
|
});
|