mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 19:59:23 -05:00
Merge pull request #16059 from Microsoft/mappedTypeDeclarations
Set '.declarations' on a property of a homomorphic mapped type
This commit is contained in:
@@ -5692,6 +5692,7 @@ namespace ts {
|
||||
prop.type = propType;
|
||||
if (propertySymbol) {
|
||||
prop.syntheticOrigin = propertySymbol;
|
||||
prop.declarations = propertySymbol.declarations;
|
||||
}
|
||||
members.set(propName, prop);
|
||||
}
|
||||
|
||||
@@ -650,10 +650,12 @@ namespace ts.FindAllReferences.Core {
|
||||
|
||||
// If this is private property or method, the scope is the containing class
|
||||
if (flags & (SymbolFlags.Property | SymbolFlags.Method)) {
|
||||
const privateDeclaration = find(declarations, d => !!(getModifierFlags(d) & ModifierFlags.Private));
|
||||
const privateDeclaration = find(declarations, d => hasModifier(d, ModifierFlags.Private));
|
||||
if (privateDeclaration) {
|
||||
return getAncestor(privateDeclaration, SyntaxKind.ClassDeclaration);
|
||||
}
|
||||
// Else this is a public property and could be accessed from anywhere.
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// If symbol is of object binding pattern element without property name we would want to
|
||||
@@ -669,11 +671,6 @@ namespace ts.FindAllReferences.Core {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// If this is a synthetic property, it's a property and must be searched for globally.
|
||||
if ((flags & SymbolFlags.Transient && (<TransientSymbol>symbol).checkFlags & CheckFlags.Synthetic)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let scope: Node | undefined;
|
||||
for (const declaration of declarations) {
|
||||
const container = getContainerNode(declaration);
|
||||
|
||||
Reference in New Issue
Block a user