microsoft / microsoft/TypeScript

No semantic token assigned to import names, but available for export

Open
#57,082 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Experience Enhancement Help Wanted Suggestion
Dominant language
Go
Stars
111k
Forks
14.4k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

🔍 Search Terms
  • import (in the FAQ)
  • is:issue is:open No semantic token import
  • is:issue is:open No highlight import
✅ Viability Checklist
⭐ Suggestion

This is an issue originally from: https://github.com/typescript-language-server/typescript-language-server/issues/842 and https://github.com/microsoft/vscode/issues/202224.
The issue is confirmed not to be an issue from TypeScript Language Server by its' developer/maintainer, and it is suggested to be posted here by VSCode'sdeveloper/maintainer.

This feature request is asking for the implementation of the semantic highlighting for member imported in the import statement.

📃 Motivating Example

When export a name, there is semantic token assigned. Such as the Compiler is assigned with class.

image

For import, there seems to be no semantic token available.

image

And it is also predictable that import using this way, will also get no correct semantic token assigned.

image

💻 Use Cases
  1. What do you want to use this for?

Bring better coding experience.

  1. What shortcomings exist with current approaches?

Currently no precise token is assigned to the imported members, no semantic token is assigned.

  1. What workarounds are you using in the meantime?

As a theme designer, I do not have any other ideas on that, and I believe this could be solved by language's implementation of this feature.

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.

Research direction

Start by reproducing the import and export examples in an editor with TypeScript semantic highlighting enabled, then trace how semantic tokens are produced for imported members. The issue names no source files or tests, so identify the relevant language-service token-generation entry point and add coverage showing the expected token assignment.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.