Skip to content

Commit 2e8f16b

Browse files
author
Kanchalai Tanglertsampan
committed
Fix comments
1 parent bb7dea1 commit 2e8f16b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/services/goToDefinition.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* @internal */
1+
/* @internal */
22
namespace ts.GoToDefinition {
33
export function getDefinitionAtPosition(program: Program, sourceFile: SourceFile, position: number): DefinitionInfo[] {
44
/// Triple slash reference comments
@@ -88,7 +88,7 @@ namespace ts.GoToDefinition {
8888
if (isJsxOpeningLikeElement(node.parent)) {
8989
// If there are errors when trying to figure out stateless component function, just return the first declaration
9090
// For example:
91-
// declare function /*firstSource*/iMainButton(buttonProps: ButtonProps): JSX.Element;
91+
// declare function /*firstSource*/MainButton(buttonProps: ButtonProps): JSX.Element;
9292
// declare function /*secondSource*/MainButton(linkProps: LinkProps): JSX.Element;
9393
// declare function /*thirdSource*/MainButton(props: ButtonProps | LinkProps): JSX.Element;
9494
// let opt = <Main/*firstTarget*/Button />; // Error - We get undefined for resolved signature indicating an error, then just return the first declaration
@@ -296,8 +296,6 @@ namespace ts.GoToDefinition {
296296
const signature = callLike && typeChecker.getResolvedSignature(callLike);
297297
if (signature) {
298298
const decl = signature.declaration;
299-
// We have to check that resolvedSignature is not undefined because in the case of JSX opening-like element,
300-
// it may not be a stateless function component which then will cause getResolvedSignature to return undefined.
301299
if (decl && isSignatureDeclaration(decl)) {
302300
return decl;
303301
}

0 commit comments

Comments
 (0)