Skip to content
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

IntelliSense / JSDoc - function declaration not same as function expression #7586

Closed
LittleBrainz opened this issue Mar 18, 2016 · 2 comments · Fixed by #9010
Closed

IntelliSense / JSDoc - function declaration not same as function expression #7586

LittleBrainz opened this issue Mar 18, 2016 · 2 comments · Fixed by #9010
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@LittleBrainz
Copy link

In the recent February release of VS Code 0.10.11 (with TypeScript 1.8.2), IntelliSense with JSDoc works as expected when referencing a function defined by a declaration, but displays limited information when referencing a function defined by an expression.

This was raised in microsoft/vscode#3842. After consideration, @egamma declared this to be a TypeScript issue.

TypeScript Version:

1.8.2 or 1.8.9

Code

/**
 * Transform a string to upper-case.
 * @param {string} value The string to be transformed.
 * @returns {string} The upper-cased string.
 */
function upper1(value) {
    return value.toUpperCase();
}


/**
 * Transform a string to upper-case.
 * @param {string} value The string to be transformed.
 * @returns {string} The upper-cased string.
 */
const upper2 = function(value) {
    return value.toUpperCase();
};


const v1 = upper1('hey');

const v2 = upper2('ho');

Expected behavior:

IntelliSense with JSDoc works as expected when referencing a function defined by a declaration:
fd completion
And hover:
fd hover

Actual behavior:

IntelliSense displays limited information when referencing a function defined by an expression:
fe completion
And hover:
fe hover

@DanielRosenwasser DanielRosenwasser added the Bug A bug in TypeScript label Mar 18, 2016
@DanielRosenwasser
Copy link
Member

Not necessarily Salsa-specific. Ideally this should be fixed for TS as well.

@sandersn
Copy link
Member

sandersn commented Jun 6, 2016

Yes, this repros the same in TypeScript and JavaScript. Not Salsa-specific.

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Jun 9, 2016
@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

Successfully merging a pull request may close this issue.

5 participants