mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
improve completions keyword for function like body (#25824)
This commit is contained in:
@@ -2125,7 +2125,7 @@ namespace ts.Completions {
|
||||
case KeywordCompletionFilters.ConstructorParameterKeywords:
|
||||
return isParameterPropertyModifier(kind);
|
||||
case KeywordCompletionFilters.FunctionLikeBodyKeywords:
|
||||
return !isClassMemberCompletionKeyword(kind);
|
||||
return isFunctionLikeBodyKeyword(kind);
|
||||
case KeywordCompletionFilters.TypeKeywords:
|
||||
return isTypeKeyword(kind);
|
||||
default:
|
||||
@@ -2151,6 +2151,10 @@ namespace ts.Completions {
|
||||
}
|
||||
}
|
||||
|
||||
function isFunctionLikeBodyKeyword(kind: SyntaxKind) {
|
||||
return kind === SyntaxKind.AsyncKeyword || !isClassMemberCompletionKeyword(kind);
|
||||
}
|
||||
|
||||
function keywordForNode(node: Node): SyntaxKind {
|
||||
return isIdentifier(node) ? node.originalKeywordKind || SyntaxKind.Unknown : node.kind;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user