mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
parent
c69a9d1a5c
commit
8aad976c69
@ -3960,7 +3960,7 @@ namespace ts {
|
||||
shorthandDeclaration.equalsToken = equalsToken;
|
||||
shorthandDeclaration.objectAssignmentInitializer = allowInAnd(parseAssignmentExpressionOrHigher);
|
||||
}
|
||||
return finishNode(shorthandDeclaration);
|
||||
return addJSDocComment(finishNode(shorthandDeclaration));
|
||||
}
|
||||
else {
|
||||
const propertyAssignment = <PropertyAssignment>createNode(SyntaxKind.PropertyAssignment, fullStart);
|
||||
@ -3969,7 +3969,7 @@ namespace ts {
|
||||
propertyAssignment.questionToken = questionToken;
|
||||
parseExpected(SyntaxKind.ColonToken);
|
||||
propertyAssignment.initializer = allowInAnd(parseAssignmentExpressionOrHigher);
|
||||
return finishNode(propertyAssignment);
|
||||
return addJSDocComment(finishNode(propertyAssignment));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1220,6 +1220,11 @@ namespace ts {
|
||||
if (isSourceOfAssignmentExpressionStatement) {
|
||||
return node.parent.parent.jsDocComment;
|
||||
}
|
||||
|
||||
const isPropertyAssignmentExpression = node.parent && node.parent.kind === SyntaxKind.PropertyAssignment;
|
||||
if (isPropertyAssignmentExpression) {
|
||||
return node.parent.jsDocComment;
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
32
tests/cases/fourslash/jsDocFunctionSignatures3.ts
Normal file
32
tests/cases/fourslash/jsDocFunctionSignatures3.ts
Normal file
@ -0,0 +1,32 @@
|
||||
///<reference path="fourslash.ts" />
|
||||
|
||||
// @allowNonTsExtensions: true
|
||||
// @Filename: Foo.js
|
||||
|
||||
//// var someObject = {
|
||||
//// /**
|
||||
//// * @param {string} param1 Some string param.
|
||||
//// * @param {number} parm2 Some number param.
|
||||
//// */
|
||||
//// someMethod: function(param1, param2) {
|
||||
//// console.log(param1/*1*/);
|
||||
//// return false;
|
||||
//// },
|
||||
//// /**
|
||||
//// * @param {number} p1 Some number param.
|
||||
//// */
|
||||
//// otherMethod(p1) {
|
||||
//// p1/*2*/
|
||||
//// }
|
||||
////
|
||||
//// };
|
||||
|
||||
goTo.marker('1');
|
||||
edit.insert('.');
|
||||
verify.memberListContains('substr', undefined, undefined, 'method');
|
||||
edit.backspace();
|
||||
|
||||
goTo.marker('2');
|
||||
edit.insert('.');
|
||||
verify.memberListContains('toFixed', undefined, undefined, 'method');
|
||||
edit.backspace();
|
||||
Loading…
x
Reference in New Issue
Block a user