mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
fix & test (#51792)
This commit is contained in:
parent
4ac75fa2b6
commit
a1536358f7
@ -866,6 +866,7 @@ function completionInfoFromData(
|
||||
isTypeOnlyLocation,
|
||||
isJsxIdentifierExpected,
|
||||
isRightOfOpenTag,
|
||||
isRightOfDotOrQuestionDot,
|
||||
importStatementCompletion,
|
||||
insideJsDocTagTypeExpression,
|
||||
symbolToSortTextMap: symbolToSortTextMap,
|
||||
@ -941,6 +942,8 @@ function completionInfoFromData(
|
||||
let caseBlock: CaseBlock | undefined;
|
||||
if (preferences.includeCompletionsWithInsertText
|
||||
&& contextToken
|
||||
&& !isRightOfOpenTag
|
||||
&& !isRightOfDotOrQuestionDot
|
||||
&& (caseBlock = findAncestor(contextToken, isCaseBlock))) {
|
||||
const cases = getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, compilerOptions, host, program, formatContext);
|
||||
if (cases) {
|
||||
@ -2524,6 +2527,7 @@ interface CompletionData {
|
||||
/** In JSX tag name and attribute names, identifiers like "my-tag" or "aria-name" is valid identifier. */
|
||||
readonly isJsxIdentifierExpected: boolean;
|
||||
readonly isRightOfOpenTag: boolean;
|
||||
readonly isRightOfDotOrQuestionDot: boolean;
|
||||
readonly importStatementCompletion?: ImportStatementCompletionInfo;
|
||||
readonly hasUnresolvedAutoImports?: boolean;
|
||||
readonly flags: CompletionInfoFlags;
|
||||
@ -2940,6 +2944,7 @@ function getCompletionData(
|
||||
isTypeOnlyLocation,
|
||||
isJsxIdentifierExpected,
|
||||
isRightOfOpenTag,
|
||||
isRightOfDotOrQuestionDot: isRightOfDot || isRightOfQuestionDot,
|
||||
importStatementCompletion,
|
||||
hasUnresolvedAutoImports,
|
||||
flags,
|
||||
|
||||
@ -30,6 +30,9 @@
|
||||
//// switch (u) {
|
||||
//// /*7*/
|
||||
////
|
||||
//// switch (u) {
|
||||
//// case E./*8*/
|
||||
//// }
|
||||
|
||||
const exhaustiveCaseCompletion = {
|
||||
name: "case E.A: ...",
|
||||
@ -109,4 +112,15 @@ verify.completions(
|
||||
includeCompletionsWithInsertText: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
marker: "8",
|
||||
exact: [
|
||||
"A",
|
||||
"B",
|
||||
"C"
|
||||
],
|
||||
preferences: {
|
||||
includeCompletionsWithInsertText: true,
|
||||
}
|
||||
},
|
||||
);
|
||||
Loading…
x
Reference in New Issue
Block a user