Skip to content

Quick info returns wrong jsdoc tag for function overload #30181

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
mjbvz opened this issue Mar 2, 2019 · 5 comments · Fixed by #30253
Closed

Quick info returns wrong jsdoc tag for function overload #30181

mjbvz opened this issue Mar 2, 2019 · 5 comments · Fixed by #30253
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Mar 2, 2019

TypeScript Version: 3.4.0-dev.20190301

Search Terms:

  • quickInfo
  • jsdoc
  • tags

Code

declare function foo(): void;

/**
 * @deprecated
 */
declare function foo(x: number): void;

foo()
  1. Hover on foo on the last line

Expected behavior:
No deprecation tag shown since we are using the non deprecated

Actual behavior:
A deprecation tag is returned in the quickinfo response:

[Trace  - 5:08:21 PM] Response received: quickinfo (311). Request took 2 ms. Success: true 
Result: {
    "kind": "function",
    "kindModifiers": "declare",
    "start": {
        "line": 8,
        "offset": 1
    },
    "end": {
        "line": 8,
        "offset": 4
    },
    "displayString": "function foo(): void (+1 overload)",
    "documentation": "",
    "tags": [
        {
            "name": "deprecated"
        }
    ]
}

Playground Link:

Related Issues:

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Bug A bug in TypeScript Help Wanted You can do this and removed Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript labels Mar 5, 2019
@RyanCavanaugh RyanCavanaugh added this to the Community milestone Mar 5, 2019
@jeanp413
Copy link
Contributor

jeanp413 commented Mar 6, 2019

Hi, I'd like to take this.

jeanp413 added a commit to jeanp413/TypeScript that referenced this issue Mar 7, 2019
jeanp413 added a commit to jeanp413/TypeScript that referenced this issue Mar 7, 2019
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
jeanp413 added a commit to jeanp413/TypeScript that referenced this issue Jul 15, 2019
sandersn pushed a commit that referenced this issue Jan 10, 2020
* Correctly resolve tags for function overloads. Fixes #30181

* Better fix for #30181. Added more unit tests

* Fix commentsOverloads tests

* Fallback to first signature when doc and tags are empty
@karfau
Copy link

karfau commented Jan 11, 2020

@RyanCavanaugh Should Milestone now be changed to 3.8.0?

@sandersn
Copy link
Member

sandersn commented Jan 16, 2020

@karfau Confusingly, 3.8.0 is the version for the beta, which is already out. 3.8.1 is the full release.

I think we do this for compatibility with versioning in Visual Studio.

@karfau
Copy link

karfau commented Jan 17, 2020

@sandersn
OK, I was not aware there is a milestone for every patch version.
But currently this issue is part of the "community" milestone.
I just wanted to know if fixed issues are moved to the milestone of the version they are fixed in or not.

@sandersn
Copy link
Member

I don't think so. I haven't been doing it and I don't think @RyanCavanaugh has a policy or bot to do so.

Kingwl pushed a commit to Kingwl/TypeScript that referenced this issue Mar 4, 2020
* Correctly resolve tags for function overloads. Fixes microsoft#30181

* Better fix for microsoft#30181. Added more unit tests

* Fix commentsOverloads tests

* Fallback to first signature when doc and tags are empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants