microsoft / microsoft/TypeScript

Suggestion: Change `Diagnostic.file` to be `SourceFileLike` instead of `SourceFile`.

Open
#18,013 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: API Help Wanted Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Diagnostic.file is of type SourceFile which forces plugins to cast a non-SourceFile to a SourceFile to report diagnostic messages and guess which parts of SourceFile are not used by tsserver.

Consider changing file to be something like SourceFileLIke or SourceMapSource that specifies the exact requirements that must be supplied by plugins for this field.

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 locating the definition and consumers of Diagnostic.file, then compare the requirements imposed by tsserver with SourceFileLike and SourceMapSource. Done means the minimal plugin-facing contract is agreed and the public type change is validated across diagnostic consumers.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.