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

Language service doesn't suggest global variables #38800

Open
falsandtru opened this issue May 27, 2020 · 0 comments
Open

Language service doesn't suggest global variables #38800

falsandtru opened this issue May 27, 2020 · 0 comments
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor
Milestone

Comments

@falsandtru
Copy link
Contributor

falsandtru commented May 27, 2020

Re-exporting global variables overwrites suggestions of global variables.

TypeScript Version: 3.7.x-dev.20200526

Search Terms:

Code

// global.ts
const global: typeof globalThis = void 0
  || typeof globalThis !== 'undefined' && globalThis
  || typeof self !== 'undefined' && self
  || Function('return this')();
export = global;
// module.ts
Obj

Expected behavior:
Language service suggests the Object variable defined as a global variable and the Object variable exported from global.ts.
Actual behavior:
Language service suggests the duplicate two Object variables exported from global.ts.
Playground Link:

Related Issues: #36468 #35478

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jun 1, 2020
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 1, 2020
@RyanCavanaugh RyanCavanaugh added the Domain: Completion Lists The issue relates to showing completion lists in an editor label Jun 1, 2020
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: Completion Lists The issue relates to showing completion lists in an editor
Projects
None yet
Development

No branches or pull requests

2 participants