microsoft / microsoft/TypeScript

Autocompletion is not working for TypeScript paths alias in import statements when omitting "baseUrl"

Open
#54,295 0 comments 0 reactions 1 assignee View on GitHub

@rbuckton is already working on this.

Since May 23, 2023.

Needs Investigation Rescheduled
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: Version: 1.79.0-insider
  • OS Version: Darwin arm64 22.4.0

Steps to Reproduce:

  1. Create a tsconfig.json with paths alias without specifying a "baseUrl":
{
  "compilerOptions": {
    "paths": {
      "~/*": ["./src/*"],
    },
  },
}
  1. Try to trigger the autocompletion:
image

If baseUrl is set like "baseUrl": ".", here is the result of the autocompletion:
image

As baseUrl is optional since TypeScript 4.1, shouldn't VS Code set it to the same folder path where the tsconfig.json is located if omitted?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.