Skip to content

Can't get intellisense to link params for anonymous functions #9755

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

Closed
egamma opened this issue Jul 15, 2016 · 4 comments
Closed

Can't get intellisense to link params for anonymous functions #9755

egamma opened this issue Jul 15, 2016 · 4 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@egamma
Copy link
Member

egamma commented Jul 15, 2016

From @Sequoia on July 14, 2016 14:7

  • VSCode Version: Version 1.3.1 (1.3.1)
  • OS Version: osx 10.11.5 (15F34)

Goal

return sftp.readdirAsync(dir)
  .then(function(/*Array<String>*/dirList) {
    dirList // <-- I want intellisense hinting on this array

Expected

screenshot 2016-07-14 10 02 04

## Actual

screenshot 2016-07-14 10 02 49

## Things I've tried 1. `.then(function(/*Array*/dirList ) {` 2. `.then(function(/**Array*/dirList ) {` 3. `.then(function(/**@type Array*/dirList ) {` 4. `.then(function(/**@type {Array}*/dirList ) {` 5. `.then(function(/**@type {String[]}*/dirList ) {` 6. `.then(/**@param {String[]} dirList */ function(dirList ) {` 7. `.then(function(dirList/**=String[]*/) {` 8. `.then(function(dirList/*=String[]*/) {` 9. `.then(function(dirList/*:String[]*/) {` 10. `.then(function(/**{String[]}:*/dirList ) {` 11. `.then(function(/*String[]:*/dirList ) {`

😢 Help

Copied from original issue: microsoft/vscode#9288

@egamma
Copy link
Member Author

egamma commented Jul 15, 2016

From @Sequoia on July 14, 2016 14:11

readdirAsync is result of promisifyAll so not easily doc-linkable. (i.e. I can't easily mark the @return {Promise<String[]>} on that method).

@egamma
Copy link
Member Author

egamma commented Jul 15, 2016

@Sequoia in general the supported jsdoc annotation are defined in this doc.

This form works for me:

 sftp.readdirAsync(dir)
  .then(
      /** @param {string} dirList*/function (dirList) {

This form does not work for me (open paren in front of jsdoc comment):

 sftp.readdirAsync(dir)
  .then
      (/** @param {string} dirList*/function (dirList) {

Moving to TypeScript for comment.

@RyanCavanaugh RyanCavanaugh added Working as Intended The behavior described is the intended behavior; this is not a bug Bug A bug in TypeScript and removed Working as Intended The behavior described is the intended behavior; this is not a bug labels Aug 18, 2016
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 2.1 milestone Aug 18, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Sep 29, 2016

The second form that @egamma mentioned not working is due to #7533. this has since been fixed.

so:

return sftp.readdirAsync(dir)
.then(/**@param {String[]} dirList */ function(dirList ) {
    dirList.

should work.

@mhegazy mhegazy closed this as completed Sep 29, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Sep 29, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Sep 29, 2016

I should note that the fix for this is part of TypeSript 2.1. VSCode ships with an older version of TypeScript. Please see Using Newer TypeScript Versions documentation for more details on updating your VSCode to use a different version of TypeScript.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants