Skip to content

Type literals handled poorly by IntelliSense #17310

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
mjbvz opened this issue Jul 19, 2017 · 2 comments
Closed

Type literals handled poorly by IntelliSense #17310

mjbvz opened this issue Jul 19, 2017 · 2 comments
Labels
Duplicate An existing issue was already created VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Jul 19, 2017

From @zackschuster on July 18, 2017 18:24

  • VSCode Version: 1.15.0-insiders
  • OS Version: Windows 10

Steps to Reproduce:

  1. Open a new file in TypeScript mode. File does not need to be part of a project.
  2. Copy the code from this gist: https://gist.github.com/zackschuster/3172f3d85e04ea2619d86129d9b4ec60
  3. Expected behavior is in comments

I left a comment in microsoft/vscode#25034 with some of this info, then after finding more problems I decided to post a new issue. I bring this up because issues here may indirectly affect that bug.

Basically, it seems that IntelliSense is given a lot of over-simplified information w/r/t type literals, none of which follows a reliable or even necessarily coherent theory; depending on the context, the same literal may be revealed as its primitive, as its type alias, or as a completely unrelated type alias (!!!) that just happens to share properties.

While none of this appears to have an impact on compile-time correctness, it does make navigating code with IntelliSense more cumbersome than it needs to be while losing an opportunity to use keyof and crew with vscode in really powerful ways.

Reproduces without extensions: Yes

Copied from original issue: microsoft/vscode#30951

@mjbvz mjbvz self-assigned this Jul 19, 2017
@mjbvz mjbvz removed their assignment Jul 19, 2017
@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Jul 19, 2017
@ghost
Copy link

ghost commented Jul 20, 2017

A simple example:

interface I { foo: "foo" };
const x: I = { foo: "foo" };

Quick info on the second foo: should show "foo", but it currently shows string.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 23, 2017

this is not about the quick info/intellisense, this is about how the type system handle immutable properties. please see #15271 for more details.

@mhegazy mhegazy added the Duplicate An existing issue was already created label Aug 23, 2017
@mhegazy mhegazy closed this as completed Aug 23, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

2 participants