mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Annotate fewer extracted constants with types
Expose `isContextSensitive` from the checker and omit type annotations for expressions for which it returns false.
This commit is contained in:
1 parent
e9ac87c2d6
commit
9efab94dfd
4 files changed
+7
-4
No files matched your search
@@ -171,6 +171,7 @@ namespace ts {
|
||||
node = getParseTreeNode(node, isExpression);
|
||||
return node ? getContextualType(node) : undefined;
|
||||
},
|
||||
isContextSensitive,
|
||||
getFullyQualifiedName,
|
||||
getResolvedSignature: (node, candidatesOutArray, theArgumentCount) => {
|
||||
node = getParseTreeNode(node, isCallLikeExpression);
|
||||
|
||||
@@ -2739,6 +2739,8 @@ namespace ts {
|
||||
getAugmentedPropertiesOfType(type: Type): Symbol[];
|
||||
getRootSymbols(symbol: Symbol): Symbol[];
|
||||
getContextualType(node: Expression): Type | undefined;
|
||||
/* @internal */ isContextSensitive(node: Expression | MethodDeclaration | ObjectLiteralElementLike | JsxAttributeLike): boolean;
|
||||
|
||||
/**
|
||||
* returns unknownSignature in the case of an error.
|
||||
* @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`.
|
||||
|
||||
Reference in new issue
Block a user