microsoft / microsoft/TypeScript

Add way force TS Server to use a specific set of tsconfig/jsconfigs

Offen
#33,094 11 Kommentare 71 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Rescheduled Suggestion VS Code Tracked
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

From https://github.com/microsoft/vscode/issues/12463

Search Terms

  • tsconfig / jsconfig
  • tsserver

Problem

Some common project templates (such as angular) generate config file with names such as tsconfig.dev.json. The TS Server used by VS Code will not load this project because the file is not named tsconfig.json. We only load project files exactly named tsconfig.json

Feature Request

Allow users to configure a specific set one or more project config files that the TS Server should load, such as /Users/matb/project/test/tsconfig.dev.json. This could either be configured using a server command line flag or using the configure request in TS

How do we handle additional projects?

If specific project files have been configured, one proposal is that we only load those projects (and never fall back to loading additional projects). Using this approach, when a user opens a new file:

  • If that file is part of one of the configured projects, then open it inside the project
  • Otherwise load the file in the inferred/global project

As an alternative to this to better support multi-root workspaces in VS Code, we could instead only fall back to loading an additional project if that project is not under the roots of any of the configured projects. For example, if I configured /Users/matb/project/test/tsconfig.dev.json as the project to load, we should never load additional projects under: /Users/matb/project/test/** but could load ones from under /Users/matb/project/other/**

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Projektladeverhalten von TS Server und die im Issue erwähnte configure-Anfrage zu überprüfen. Lege fest, wie explizit konfigurierte tsconfig/jsconfig-Dateien ausgewählt werden, wie Dateien außerhalb dieser Dateien inferred oder globalen Projekten zugeordnet werden und wie sich der vorgeschlagene Multi-Root-Fallback verhalten soll; die Arbeit ist abgeschlossen, wenn diese Regeln implementiert und verifiziert sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
compilers, developer-experience
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.