Repository navigation
Closed
Labels
BugA bug in TypeScriptA bug in TypeScript
Milestone
Description
Type: Possible Bug
In the following example vscode does not seem to pick up the Daniel Edeling (@deprecated) tag and I do not understand why? The use case is to mark the lodash template function as deprecated.
import _template from 'lodash/template';
/** @deprecated Deprecated. Use JavaScript template string instead. */
export {_template as template};
VS Code version: Code 1.77.2 (e344f1f539a80912a0e9357cec841f36ce97a4e2, 2023-04-06T10:12:31.126Z)
OS version: Darwin x64 22.4.0
Modes:
Sandboxed: Yes
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz (8 x 2700) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: disabled_off |
| Load (avg) | 4, 10, 7 |
| Memory (System) | 16.00GB (0.03GB free) |
| Process Argv | --crash-reporter-id 632d5250-6707-4e87-8d1c-3e7bcfc44bfe |
| Screen Reader | no |
| VM | 0% |
Extensions (20)
| Extension | Author (truncated) | Version |
|---|---|---|
| vscode-eslint | dba | 2.4.0 |
| prettier-vscode | esb | 9.10.4 |
| svn-scm | joh | 2.15.7 |
| vscode-docker | ms- | 1.24.0 |
| vscode-dotnet-runtime | ms- | 1.6.0 |
| playwright | ms- | 1.0.10 |
| isort | ms- | 2022.8.0 |
| python | ms- | 2023.6.0 |
| vscode-pylance | ms- | 2023.4.10 |
| remote-containers | ms- | 0.288.0 |
| hexeditor | ms- | 1.9.11 |
| oracledevtools | Ora | 21.5.0 |
| refactor | p42 | 3.0.1 |
| vscode-print | pdc | 0.11.1 |
| quicktype | qui | 12.0.46 |
| LiveServer | rit | 5.7.9 |
| vscode-styled-components | sty | 1.7.8 |
| vscode-stylelint | sty | 1.2.4 |
| vscode-icons | vsc | 12.3.0 |
| vscode-todo-highlight | way | 1.0.5 |
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
nodejswelcome1:30587005
282f8724:30602487
pyind779:30671433
f6dab269:30613381
vscrp:30673768
pythonsymbol12:30671437
a9j8j154:30646983
vsctsb:30705553
defaultazurewalk:30687958
pythonms35:30701012
pythonfmttextcf:30710682
pythonclientmv:30708685
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript
Activity
vscodenpa commentedon Apr 12, 2023
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.77.3. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
doberkofler commentedon Apr 12, 2023
Same in 1.77.3
MartinJohns commentedon Apr 12, 2023
Deprecating the named export works:
doberkofler commentedon Apr 13, 2023
RyanCavanaugh commentedon Apr 13, 2023
What is the usage site you're testing?
doberkofler commentedon Apr 14, 2023
I'm not sure I understand the question but if you are asking for the use case: an external module (in this example lodash) is abstracted in a local module to control the api space and some functions should now be marked as deprecated.
RyanCavanaugh commentedon Apr 14, 2023
What I mean is, you wrote this somewhere:
Where?
Elsewhere, you wrote what, and where? The screenshot is 1,000 lines deep in a file. I can't see the relationship between these two files at all.
doberkofler commentedon Apr 14, 2023
I understand now.
t1.ts:
t2.ts:
while writing

template:after writing


template:[-]How to make vscode properly use @deprecated for a named export[/-][+]Re-exported symbol marked with `deprecated` doesn't get correct deprecation highlighting[/+]RyanCavanaugh commentedon Apr 14, 2023
Perfect, thanks!
MartinJohns commentedon Apr 14, 2023
Ryan Cavanaugh (@RyanCavanaugh) Just curious / for clarification,
Should this also work?
Or does it have to be
RyanCavanaugh commentedon Apr 14, 2023
I think only the latter makes sense. If you deprecate the entire
exportline I think that's a separate feature that would make the module specifier get crossed outstarball5 commentedon Apr 14, 2023
Related on Stack Overflow: How can I make VS Code recognize an overridden JSDoc for a re-export?