-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Recognize object literal method JSDoc comments #6870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: instead of checking the member list which is dependent on the apparent type (and which can potentially be affected by various usages of identifiers), I think it's generally a better idea to stick with the quick info since that will tell you precisely the type you're using. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a method for just saying "I expect this to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
edit.backspace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice this function returns early if
tryParseAccessorDeclaration
is successful (or viaparseMethodDeclaration
@3943). Do we handle those cases, such as getters/setters? (Good tests to add also).