Skip to content

Commit 7e71686

Browse files
author
Yui T
committed
Fix broken tests
1 parent 99722e4 commit 7e71686

6 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/compiler/binder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ namespace ts {
14441444

14451445
// If this is a property-parameter, then also declare the property symbol into the
14461446
// containing class.
1447-
if (isPropertyParameterDeclaration(node)) {
1447+
if (isParameterPropertyDeclaration(node)) {
14481448
const classDeclaration = <ClassLikeDeclaration>node.parent.parent;
14491449
declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, SymbolFlags.Property, SymbolFlags.PropertyExcludes);
14501450
}

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace ts {
6767
// The language service will always care about the narrowed type of a symbol, because that is
6868
// the type the language says the symbol should have.
6969
getTypeOfSymbolAtLocation: getNarrowedTypeOfSymbol,
70-
getSymbolOfParameterPropertyDeclaration,
70+
getSymbolsOfParameterPropertyDeclaration,
7171
getDeclaredTypeOfSymbol,
7272
getPropertiesOfType,
7373
getPropertyOfType,
@@ -435,7 +435,7 @@ namespace ts {
435435
* @param parameterName a name of the parameter to get the symbols for.
436436
* @return a tuple of two symbols
437437
*/
438-
function getSymbolOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): [Symbol, Symbol] {
438+
function getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): [Symbol, Symbol] {
439439
const constructoDeclaration = parameter.parent;
440440
const classDeclaration = parameter.parent.parent;
441441

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,7 @@ namespace ts {
17231723

17241724
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
17251725
getSymbolAtLocation(node: Node): Symbol;
1726-
getSymbolOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[];
1726+
getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[];
17271727
getShorthandAssignmentValueSymbol(location: Node): Symbol;
17281728
getTypeAtLocation(node: Node): Type;
17291729
typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string;

src/compiler/utilities.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,9 +2742,7 @@ namespace ts {
27422742
}
27432743
}
27442744

2745-
export function isPropertyParameterDeclaration(node: ParameterDeclaration): boolean {
2746-
// If this is a property-parameter, then also declare the property symbol into the
2747-
// containing class.
2745+
export function isParameterPropertyDeclaration(node: ParameterDeclaration): boolean {
27482746
return node.flags & NodeFlags.AccessibilityModifier && node.parent.kind === SyntaxKind.Constructor && isClassLike(node.parent.parent);
27492747
}
27502748
}

src/services/services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5972,8 +5972,8 @@ namespace ts {
59725972
// Parameter Declaration symbol is only visible within function scope, so the symbol is stored in contructor.locals.
59735973
// Property Declaration symbol is a member of the class, so the symbol is stored in its class Declaration.symbol.members
59745974
if (symbol.valueDeclaration && symbol.valueDeclaration.kind === SyntaxKind.Parameter &&
5975-
isPropertyParameterDeclaration(<ParameterDeclaration>symbol.valueDeclaration)) {
5976-
result = result.concat(typeChecker.getSymbolOfParameterPropertyDeclaration(<ParameterDeclaration>symbol.valueDeclaration, symbol.name));
5975+
isParameterPropertyDeclaration(<ParameterDeclaration>symbol.valueDeclaration)) {
5976+
result = result.concat(typeChecker.getSymbolsOfParameterPropertyDeclaration(<ParameterDeclaration>symbol.valueDeclaration, symbol.name));
59775977
}
59785978

59795979
// If this is a union property, add all the symbols from all its source symbols in all unioned types.

tests/cases/fourslash/documentHighlightAtParameterPropertyDeclaration2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
let markers = test.markers()
2121
for (let marker of markers) {
2222
goTo.position(marker.position);
23-
verify.documentHighlightsAtPositionCount(3, ["file1.ts"]);
23+
verify.documentHighlightsAtPositionCount(2, ["file1.ts"]);
2424
}

0 commit comments

Comments
 (0)