microsoft / microsoft/TypeScript

Quick info shouldn't default to showing jsdoc from first overload

Open
#45,337 7 comments 0 reactions 1 assignee View on GitHub

@sandersn is already working on this.

Since Aug 12, 2021.

Needs Proposal Suggestion
Dominant language
Go
Stars
111k
Forks
14.4k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

https://github.com/microsoft/TypeScript/issues/43053

This is still happening at least with the tap function from rxjs. VSCode 1.58.2. TS version in project: 4.3.5

Deprecation warning shows up regardless of which overloaded signature you use. Should not show up for the last two signatures.

import { interval } from 'rxjs';
import { tap } from 'rxjs/operators';

interval(5000)
  .pipe(
     tap(console.log), // "deprecated - Use an observer instead of a complete callback"
     tap({ next: console.log, error: console.log, complete: console.log }) // "deprecated
  )

rxjs/tap.d.ts:

import { MonoTypeOperatorFunction, PartialObserver } from '../types';
/** @deprecated Use an observer instead of a complete callback */
export declare function tap<T>(next: null | undefined, error: null | undefined, complete: () => void): MonoTypeOperatorFunction<T>;
/** @deprecated Use an observer instead of an error callback */
export declare function tap<T>(next: null | undefined, error: (error: any) => void, complete?: () => void): MonoTypeOperatorFunction<T>;
/** @deprecated Use an observer instead of a complete callback */
export declare function tap<T>(next: (value: T) => void, error: null | undefined, complete: () => void): MonoTypeOperatorFunction<T>;
export declare function tap<T>(next?: (x: T) => void, error?: (e: any) => void, complete?: () => void): MonoTypeOperatorFunction<T>;
export declare function tap<T>(observer: PartialObserver<T>): MonoTypeOperatorFunction<T>;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.