-
Notifications
You must be signed in to change notification settings - Fork 12.8k
TypeScript '@deprecated' warning shown for wrong overload #40007
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
Comments
Looks like duplicate of microsoft/vscode#80292 and #30181 Interestingly that while it shows comment with deprecation, /assign @mjbvz |
Please share the text of the code along with screenshots |
@mjbvz minimal repro I tested with Playground Link |
@mjbvz Do you still need more info after this reply was made with a link to reproducible code? |
I think we have a heuristic where if a signature has no JSDoc comments, we'll pick out the first one. This is often useful to avoid duplication. You can try it out here, where quick info on the call picks up /**
* @badda
*/
declare function foo(): string;
/**
* @bing
*/
declare function foo(a: string): string;
declare function foo(a: number): number;
foo(123) It's unclear what we should do in some of these situations. Maybe the right behavior is that if only the first signature has a comment, then we pick that up; otherwise, if more than one signature has a comment, we only try to pick the comment for the current signature's declaration. |
The feature is working correctly in terms of warnings though - that overload should not be highlighted as a deprecated use, so we don't need a prioritized fix for 4.0. Marking as |
Maybe make sense not to bring comments that has |
Agree with @IllusionMH
|
In my memory, It's caused the quick info, completions, etc who used getNodeModifiers only take the jsdoc by first declaration for the signature |
This is a complex problem. It is a duplicate of #407, in particular my last comment on the issue. |
TS Template added by @mjbvz
TypeScript Version: 4.1.0-dev.20200811
Search Terms
Repo code
from @IllusionMH
Issue Type: Bug
In a Typescript source file, import 'of' from 'rxjs';
type a statement that includes 'of(someArray);
Hover near 'of', it shows a deprecation notice, however the actual deprecation is for a different overload of 'of'.
The same happens on any @deprecated annotations with multiple overloads
VS Code version: Code 1.47.3 (91899dcef7b8110878ea59626991a18c8a6a1b3e, 2020-07-23T13:08:29.692Z)
OS version: Darwin x64 19.6.0
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: