List @deprecated strikethroughs in Problems tab
The new deprecated strikethroughs in TS code are great. But to make it easier to find and address a series of them, it would be nice to have them also appear in the Problems tab (as an optional view, controlled by a settings flag).
Moving upstream for more feedback
I believe we can already generate these diagnostics on the VS Code side if we want, but perhaps TS should have a compiler flag the enables treating usage of deprecated symbols as an error/warning
~~Do we already have wraning? If not I'm happy to support that both ts & code side~~ I got it.
After thinking about this again, I'm pretty sure that the solution I'd like to see is
- VS Code showing suggestions in the problems tab, as suggestions.
- A compiler CLI flag to emit all suggestions as errors. (Or similar to errors, with different formatting.)
For those looking for a solution, I found this comment in one of the referenced MR.
https://github.com/microsoft/TypeScript/pull/40607#issuecomment-1369051173
--
However I wish that the deprecated warnings/infos are displayed in the problems tab out of the box
For those looking for a solution, I found this comment in one of the referenced MR.
--
However I wish that the deprecated warnings/infos are displayed in the problems tab out of the box
It's only partial, it just catches the use of a deprecated field (deconstruction) const a = x.deprecated; but does not catch things such as assignations const a: X = { deprecated: 123 }; or destructuring assignment const f: X = ({ deprecated }) => 123; or const { deprecated } = a;, or some more complex cases such as const param = { deprecated: 123 }; callModule(param);. Listing deprecations is quite complex and must target a lot of specific cases. But it's so important that I think it should be handled by TS as warnings during type check and in editor's problems.
+1
👍
I found this when looking for the setting I assumed to already exist to enable deprecation warnings. It's surprising to me that this isn't base functionality, and I hope we get it included.
I agree - Would love to see this as it would make development much easier