Skip to content
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

Autocomplete for symbol properties that are imported via import * as X #52056

Open
mattiamanzati opened this issue Dec 30, 2022 · 0 comments
Open
Labels
Bug A bug in TypeScript Domain: Auto-import Help Wanted You can do this
Milestone

Comments

@mattiamanzati
Copy link

Bug Report

Autocomplete behaviour seems to be working incorrectly when dealing with symbol properties and symbol needs to be imported.
The behaviour when the module is imported via import {id} from "module" is perfect, but seems to be broken when importing the entire module via import * as D from "module"

🔎 Search Terms

autocomplete symbol
autocomplete property import

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about language service autocomplete

⏯ Playground Link

Not applicable as it requires multiple file support for autocomplete unfortunately

💻 Code

DSL.ts

export const self = Symbol.for("self");
export type self = typeof self;

export declare function id<R>(): R & { [self]: () => R };

PerfectAutocomplete.ts

import {id} from "./DSL";

interface User {
  id: number;
  email: string;
}

const email = D.id<User>(). // <- self appears in autocomplete, and will trigger auto-import

see it in action: http://www.giphy.com/gifs/ZfQu0uIHrAaJsy9fbz

🙁 Actual behavior

WrongAutocomplete.ts

import * as D from "./DSL";

interface User {
  id: number;
  email: string;
}

const email = D.id<User>(). // <- instead of D.self, "D" appears in autocomplete and will result into a wrong property being accessed

see it in action: http://www.giphy.com/gifs/1YdB0ShfjLku0vfAZA

🙂 Expected behavior

D.self should appear in the autocomplete, and when chosen should type in D.self instead of just D

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Domain: Auto-import labels Jan 5, 2023
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jan 5, 2023
@RyanCavanaugh RyanCavanaugh added the Help Wanted You can do this label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Auto-import Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants