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

Mark deprecated suggestion #33092

Closed
mjbvz opened this issue Aug 26, 2019 · 0 comments · Fixed by #38523
Closed

Mark deprecated suggestion #33092

mjbvz opened this issue Aug 26, 2019 · 0 comments · Fixed by #38523
Labels
Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Aug 26, 2019

TypeScript Version: 3.6.0-rc

Search Terms:

  • suggest suggestion
  • completion completions
  • TS Server
  • completionInfo

Feature request
VS Code recently added support for rendering suggestions for deprecated symbols with a strikeout: microsoft/vscode#50972

We would like the TS Server to return metadata about completion items that indicates if they are deprecated or not

/**
 * @deprecated
 */
function foo() {}

foo| /* suggestions here should render `foo` with a strike out*/

Proposed API change
In the completionInfo response from the TS Server, for deprecated completions add deprecated to the kindModifiers field:

[Trace  - 2:39:42 PM] <semantic> Response received: completionInfo (373). Request took 151 ms. Success: true 
Result: {
    "isGlobalCompletion": true,
    "isMemberCompletion": false,
    "isNewIdentifierLocation": false,
    "entries": [
        {
            "name": "foo",
            "kind": "var",
            "kindModifiers": "declare deprecated",
            "sortText": "2"
        },
    ...

Related Issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants