GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — IntelliSense / JSDoc - function declaration not same as function expression · Issue #7586 · microsoft/TypeScript

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

New issue
Copy link
New issue
Copy link
Closed
#9010
Closed
IntelliSense / JSDoc - function declaration not same as function expression#7586
#9010
Copy link
Assignees
sandersn
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
TypeScript 2.0

Description

@LittleBrainz
Stephen Turner (LittleBrainz)
opened on Mar 18, 2016
Issue body actions

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, Erich Gamma (@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

Activity

  1. Daniel Rosenwasser (DanielRosenwasser)
    added
    BugA bug in TypeScriptA bug in TypeScript
    on Mar 18, 2016
  2. DanielRosenwasser commented on Mar 18, 2016

    @DanielRosenwasser
    Daniel Rosenwasser (DanielRosenwasser)
    on Mar 18, 2016
    Member
    More actions

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

  3. Mohamed Hegazy (mhegazy)
    added this to the TypeScript 2.0 milestone on Apr 26, 2016
  4. Mohamed Hegazy (mhegazy)
    added
    Salsa
    on Apr 26, 2016
  5. Mohamed Hegazy (mhegazy)
    assigned
    Ryan Cavanaugh (RyanCavanaugh)
    on Apr 26, 2016
  6. Nathan Shively-Sanders (sandersn)
    assigned
    Nathan Shively-Sanders (sandersn)
    and unassigned
    Ryan Cavanaugh (RyanCavanaugh)
    on Jun 6, 2016
  7. Nathan Shively-Sanders (sandersn)
    removed
    Salsa
    on Jun 6, 2016
  8. sandersn commented on Jun 6, 2016

    @sandersn
    Nathan Shively-Sanders (sandersn)
    on Jun 6, 2016
    Member
    More actions

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

  9. Nathan Shively-Sanders (sandersn)
    closed this as completedin #9010on Jun 8, 2016
  10. Mohamed Hegazy (mhegazy)
    added
    FixedA PR has been merged for this issueA PR has been merged for this issue
    on Jun 9, 2016
  11. microsoft
    locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @sandersn
    Nathan Shively-Sanders (sandersn)

Labels

BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue

Type

No type

Projects

No projects

    Milestone

    • TypeScript 2.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.