Closed
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.67.2
- OS Version: Windows 11 Pro 21H2, also reproducible on macOS Monterey 12.4
Steps to Reproduce:
- Create a file that contains a list of exported, consecutive, overloaded functions, with a single
@deprecated
tag at the top of the first one.
api.d.ts
/**
* @deprecated Use the new method instead.
*/
export function getArrayLength(arr: string[]): number;
export function getArrayLength(arr: number[]): number;
export function getArrayLength(arr: boolean[]): number;
- Create a file that imports the overloaded function
test.ts
import { getArrayLength } from "./api";
getArrayLength(["1"])
getArrayLength([1])
getArrayLength([true])
- Only the first function is striked-through, the other two overloaded functions aren't, even though they are all marked as
@deprecated
when hovering over them.
Either the bottom two overloaded functions shouldn't be marked as @deprecated
when hovering over, or all three functions should be striked-through.
Activity
DanielRosenwasser commentedon Jun 3, 2022
This is working as intended. If we made all of them deprecated, there would be no way to convey that you want someone to use a different overload instead of a different function entirely, so we had to opt for a more granular approach.
fatcerberus commentedon Jun 3, 2022
@DanielRosenwasser In that case, the hover text shouldn't show
@deprecated
for all of them.@deprecated
tags of other overloads for quick info #49371[-]Consecutive deprecated overloaded functions don't show a strikethrough, only the first one does[/-][+]Overloads shouldn't gain `@deprecated` tags of other overloads in quick info[/+]DanielRosenwasser commentedon Jun 3, 2022
Agreed, I think I missed that. Sorry about the incorrect triage.
a-tarasyuk commentedon Jul 2, 2022
I think we can exclude only
@depracated
tag, however, does it make sense to show other tags/docs for overloaded signatures from the root declaration? Maybe we should inherit docs, however, tags seem to add confusion in the following cases./cc @DanielRosenwasser @RyanCavanaugh @sandersn
4 remaining items