From 2e8f16b96b0d62d8be7c5a515ffffc9f1c380751 Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Wed, 8 Feb 2017 17:19:31 -0800 Subject: [PATCH] Fix comments --- src/services/goToDefinition.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts index b03557bdbda..0ac6c9f7812 100644 --- a/src/services/goToDefinition.ts +++ b/src/services/goToDefinition.ts @@ -1,4 +1,4 @@ -/* @internal */ +/* @internal */ namespace ts.GoToDefinition { export function getDefinitionAtPosition(program: Program, sourceFile: SourceFile, position: number): DefinitionInfo[] { /// Triple slash reference comments @@ -88,7 +88,7 @@ namespace ts.GoToDefinition { if (isJsxOpeningLikeElement(node.parent)) { // If there are errors when trying to figure out stateless component function, just return the first declaration // For example: - // declare function /*firstSource*/iMainButton(buttonProps: ButtonProps): JSX.Element; + // declare function /*firstSource*/MainButton(buttonProps: ButtonProps): JSX.Element; // declare function /*secondSource*/MainButton(linkProps: LinkProps): JSX.Element; // declare function /*thirdSource*/MainButton(props: ButtonProps | LinkProps): JSX.Element; // let opt =
; // Error - We get undefined for resolved signature indicating an error, then just return the first declaration @@ -296,8 +296,6 @@ namespace ts.GoToDefinition { const signature = callLike && typeChecker.getResolvedSignature(callLike); if (signature) { const decl = signature.declaration; - // We have to check that resolvedSignature is not undefined because in the case of JSX opening-like element, - // it may not be a stateless function component which then will cause getResolvedSignature to return undefined. if (decl && isSignatureDeclaration(decl)) { return decl; }