denoland / vscode_deno

Visual Studio Code plugin for Deno
https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno
MIT License
1.49k stars 145 forks source link

No intelisense for implementation of a interface created dynamically from an object's keys. #646

Closed Khilseith closed 2 years ago

Khilseith commented 2 years ago

Describe the bug If I create an interface from all the keys of an object that's been defined I do not get intelisense for the needed properties when implementing that interface in a class.

To Reproduce

const object = {
    foo: "bar",
    fizz: "buzz",
};
type interfaceVar = {
    [key in (keyof typeof object)]: boolean;
};
class classVar implements interfaceVar {
    // Should get intelisense here for foo and fizz but I do not
}

intelisenseNotWorking Expected behavior However if I clearly define these properties of an interface such as

type interfaceVar2 = {
    foo: boolean
    fizz: boolean
}

I get intelisense for its implementation intelisenseWorking

The extension seems keenly aware of what properties I am missing all the while. Error

Versions

vscode: 1.66.0 deno: 1.20.4 extension: 3.12.0

kitsonk commented 2 years ago

That appears to be exactly the behaviour you would get in a standard TypeScript language service.

You will get exactly the same behaviour in this TypeScript playground.

If you think it is an issue, you will need to raise it with TypeScript project directly, and if fixed, Deno regularly updates to the latest GA release of TypeScript.