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

Render uses of deprecated symbols #33093

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

Render uses of deprecated symbols #33093

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

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Aug 26, 2019

TypeScript Version: 3.6.0-rc

Search Terms:

  • diagnostics
  • errors
  • suggestions
  • suggestion diagnostics
  • deprecated

Feature request
VS Code recently added special for special rendering of error spans for deprecated symbols: microsoft/vscode#56694 These are rendered as strike out in the editor

We would like the TypeScript server to also generate suggestion diagnostics for uses of deprecated symbols:

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

foo() /* Call to `foo` should rendered with a strike out*/

Proposed API change
This feature is broadly similar to how TypeScript supports rendering unused diagnostics. Unused diagnostics are indicated by a reportsUnnecessary field on the diagnostic.

To support deprecated diagnostics as well, we could add a new reportsDeprecated field

[Trace  - 2:56:06 PM] <semantic> Event received: suggestionDiag (0).
Data: {
    "file": "/Users/matb/projects/san/index.ts",
    "diagnostics": [
        {
            "start": {
                "line": 6,
                "offset": 10
            },
            "end": {
                "line": 6,
                "offset": 13
            },
            "text": "'foo' is marked deprecated.",
            "code": 6133,
            "category": "suggestion",
            "reportsDeprecated": true
        }
    ]
}

VS Code would provide the support for enabling/disabling deprecated diagnostics; TS Server just needs to return this information to us

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