Title: JSDoc : add support for @method (and @property) · Issue #28730 · microsoft/TypeScript · GitHub
Open Graph Title: JSDoc : add support for @method (and @property) · Issue #28730 · microsoft/TypeScript
X Title: JSDoc : add support for @method (and @property) · Issue #28730 · microsoft/TypeScript
Description: Search Terms JSDoc @method @property support Suggestion It would be great to add support for @method and @property (and maybe @memberof) now that annotations are on their way. I found bug #15715 that only talks about @property support bu...
Open Graph Description: Search Terms JSDoc @method @property support Suggestion It would be great to add support for @method and @property (and maybe @memberof) now that annotations are on their way. I found bug #15715 th...
X Description: Search Terms JSDoc @method @property support Suggestion It would be great to add support for @method and @property (and maybe @memberof) now that annotations are on their way. I found bug #15715 th...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/28730
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JSDoc : add support for @method (and @property)","articleBody":"## Search Terms\r\n\r\n* JSDoc\r\n* `@method`\r\n* `@property`\r\n* support \r\n\r\n## Suggestion\r\n\r\nIt would be great to add support for `@method` and `@property` (and maybe `@memberof`) now that annotations are on their way.\r\n\r\nI found bug #15715 that only talks about `@property` support but I think this makes more sense to see those in a same light because they should have a very common implementation and moreover they meet the same goals as a whole. At least I think and I explain my reasoning about this below!\r\n\r\n## Use Cases\r\n\r\nI have functions that do add methods and/or getters on a class right now, waiting for annotations to get their way in JS/TS. But let's say this: when annotations are here, those 2 flags support will be needed anyway (or at least I think so: I don't see how to make IntelliSense work without those)!\r\n\r\n```js\r\n/**\r\n* Some class\r\n * @class\r\n */\r\nclass Test {\r\n /* whatever */\r\n}\r\n\r\n// this adds a #foo() method on the class prototype as well as a #bar getter(/setter)\r\nsomeMethodAddingABehavior(Test, ...params);\r\n```\r\n\r\nAnd tomorrow with annotations:\r\n```js\r\n/**\r\n* Some class\r\n * @class\r\n */\r\n@someAnnotationAddingABehavior(...params)\r\nclass Test {\r\n /* whatever */\r\n}\r\n```\r\n\r\n## Examples\r\n\r\nI'd like to be able to document those doing something like:\r\n```js\r\n/**\r\n * What foo is doing is great!\r\n * @method foo\r\n * @param {string} testParam some testing parameter\r\n * @returns {string} some random string\r\n * @memberof Test.prototype\r\n */\r\n/**\r\n * Bar is awesome too!\r\n * @property {number} bar\r\n * @memberof Test.prototype\r\n */\r\nsomeMethodAddingABehavior(Test, ...params);\r\n```\r\n\r\nOr at least to be able to document them in the class itself:\r\n\r\n```js\r\n/**\r\n* Some class\r\n * @class\r\n */\r\nclass Test {\r\n /* whatever */\r\n\r\n /**\r\n * What foo is doing is great!\r\n * @method foo\r\n * @param {string} testParam some testing parameter\r\n * @returns {string} some random string\r\n */\r\n /**\r\n * Bar is awesome too!\r\n * @property {number} bar\r\n */\r\n}\r\n```\r\n\r\nWith support of these, I would expect `vscode` to suggest to me the `foo` method and the `bar` property when completing properties of a value of type `Test`.\r\n\r\n## Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n\r\n* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code\r\n* [x] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [x] This could be implemented without emitting different JS based on the types of the expressions\r\n* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)\r\n* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n\r\n","author":{"url":"https://github.com/qraynaud","@type":"Person","name":"qraynaud"},"datePublished":"2018-11-29T09:57:31Z","url":"https://github.com/microsoft/TypeScript/issues/28730"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:df60409b-c23f-1658-9a4a-5c065ba262bb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8ACA:172B92:ADD499:E9EA9E:6B00F1A2 |
| html-safe-nonce | e09b3e531c79aea1c2add7acb0f15e095998c1a3abf44b8c60c72ed6a2953515 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUNBOjE3MkI5MjpBREQ0OTk6RTlFQTlFOjZCMDBGMUEyIiwidmlzaXRvcl9pZCI6IjE0MzE2MzIyMTIwOTYyNTAyNzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 88adda006293b039d13fd9c340f3008e4482549a790ed33893df295dca356e6e |
| hovercard-subject-tag | issue:385654311 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/28730/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fd54d869a5462af809a8b8da6a695d0b5fc299e383b1a8b41cf384565c24ab1b/microsoft/TypeScript/issues/28730 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fd54d869a5462af809a8b8da6a695d0b5fc299e383b1a8b41cf384565c24ab1b/microsoft/TypeScript/issues/28730 |
| og:image:alt | Search Terms JSDoc @method @property support Suggestion It would be great to add support for @method and @property (and maybe @memberof) now that annotations are on their way. I found bug #15715 th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | qraynaud |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width