microsoft / microsoft/TypeScript

Support a file blacklist in tsserver configuration options

Open
#36,391 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: LS: TSServer In Discussion Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

My scenario is this: suppose I'm working in my editor, and I open a file which, by chance, crashes the language service. Repeatedly. (usually because of it's size or shape). Today, after the service crashes 5 times in short order, the service is disabled by the editor (which if it crashes on load, is what will occur). What I propose is this; if the service crashes after a file open request is issued, and we would shut down the service, instead we automatically add the file to a workspace-local tsserver blacklist config (probably in .vscode/settings.json) and reload the language service with the new option. The language service will then refuse to actually load the blacklisted file contents, instead reporting them as empty files/empty modules/empty json documents and potentially issue a warning-type error message in the diagnostics that certain files are blacklisted, which may affect the compilation.

cc @mjbvz do you think this'd be a good idea for a slightly more progressive degradation of experience when the language service has trouble with a file?

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 tracing tsserver handling of file-open requests and the configuration options used by the language service. Review how workspace-local .vscode/settings.json could represent a blacklist and how reloads occur after repeated crashes. Done means a blacklisted file is safely treated as empty, diagnostics can warn about the effect, and the service remains available instead of being disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.