Skip to content

class method destructuring assignment autocomplete not work #45045

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

Closed
mantou132 opened this issue Jul 15, 2021 · 1 comment Β· Fixed by #45388
Closed

class method destructuring assignment autocomplete not work #45045

mantou132 opened this issue Jul 15, 2021 · 1 comment Β· Fixed by #45388
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@mantou132
Copy link

mantou132 commented Jul 15, 2021

Bug Report

πŸ”Ž Search Terms

autocomplete intellisense

πŸ•— Version & Regression Information

4.3.5

⏯ Playground Link

https://www.typescriptlang.org/play?ts=4.3.5#code/JYWwDg9gTgLgBAbzgYQDbAKYDt4F84BmUEIcA5AAIDmUYAxgPQ30C0AVgM5kDcAULzACeYDHAAKxEMA7ACggDwAVAHxwAvHEVwAZLwS84cANoBpOMCxwAogA8YUAIZ0Y8gNYZBEApoA0cDvYWVKoOHHAABgAkCCa4EiTSGOEAugBcmqbJcBh22AAmYQAUBoZwUBgAjukWBBhQcABKlT4lhiAgGDAOeQ5d1Vi19QCynd29Di2lcBBgMMAQWP2DcADys-NYk6V0DqioAEZOrumFAPp1UOkOWIJ+5RxLdY0YHACU6qoAbhDAeVvvai+PzyrTgAH44Ep1M8OMpCuUqs8Kn52qMel0wekRl10RNpusFpjVgSsADVPEpBwMEplKD0lgMJ86nxcHxeHRUKEwgBlOqfYB0UT6NqdAAWEDyhXewtKqE6-j5AtEGgAjHBQuJJNJZAo0JgcMo+FM6AsAoh8BoqVB+YKjXBcLxcEA

πŸ’» Code

import { Client } from '@grpc/grpc-js';

type Promisify<T> = T &
{
  [K in Extract<keyof T, string> as `${K}Promise`]: T[K] extends (
    req: infer Req,
    mmetadata: infer Metadata,
    option: infer Option,
    callback: (_err: any, res: infer Res) => void,
  ) => void
    ? <T = Res>(req: Req, mmetadata?: Metadata, option?: Option) => Promise<T>
    : never;
};

class Service {
  method() {
    let service = 1 as Promisify<Client>;
    const { /** press ctrl+space */ } = service;
  }
}

πŸ™ Actual behavior

When I press CTRL+SPACE, not displayed correctly suggest.

Screen Shot 2021-07-15 at 8 03 01 PM

πŸ™‚ Expected behavior

When I press CTRL+SPACE, should display the method suggest. e.g:

Screen Shot 2021-07-15 at 8 03 12 PM

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jul 15, 2021
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.5.0 milestone Jul 15, 2021
@RyanCavanaugh
Copy link
Member

@gabritto this is actually a crash in the LS. Looks possibly similar to the txstate issue we were looking at yesterday?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
4 participants