microsoft / microsoft/TypeScript

TSServer should expose tsconfig

Open
#31,234 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Search Terms

TSServer TSconfig ProjectInfo

Suggestion

export interface ProjectInfo {
  configFileName: string;
  fileNames?: string[];
  languageServiceDisabled?: boolean;
 }

TSServer should also include the project config (the final form of tsconfig.json with all the extends resolved) in the ProjectInfo response

Use Cases

Currently, the editor is expected to send compileOnSaveEmitFile command on each save if compileOnSave flag is set. To figure that out, the editor has to parse the tsconfig.json file and check if the flag is set. The initial version of extend was relatively easy to implement. But now with the support for package name, it's complex to implement correctly.

Why can't you use tsc --showConfig?

Currently we bundle the tsserver.js file along the plugin. So the only dependency is nodejs. This also makes it easier to use it in js projects which don't have typescript dependency. If we depend on tsc, we would also have to bundle tsc file etc.

see https://github.com/ananthakumaran/tide/issues/310

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

No files, tests, or entry points are named. Start by tracing the TSServer ProjectInfo response and the project configuration loading path, then verify that the response exposes the final tsconfig with all extends resolved and supports the compileOnSave use case.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.