Skip to content

Add typed project IDs - #64319

Open
Andrew Branch (andrewbranch) wants to merge 2 commits into
microsoft:mainfrom
andrewbranch:api/project-ids
Open

Andrew Branch (andrewbranch) wants to merge 2 commits into
microsoft:mainfrom
andrewbranch:api/project-ids

Conversation

@andrewbranch

Copy link
Copy Markdown
Member

After #64204 added a new Project kind for API-created programs, the abuse of using tspath.Path for all project IDs (and even setting configFileName) was starting to feel more and more gross. This gives Configured, Inferred, and Synthetic projects each their own strongly typed string ID type, similar to #64159.

Copilot AI balanced review requested due to automatic review settings September 17, 2026 23:16
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 17, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 17, 2026
Comment thread tsc/internal/api/proto_test.go Outdated
Comment thread tsc/internal/ls/autoimport/registry.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Project-ID parsing, namespace classification, and display-name regressions remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Introduces strongly typed IDs for configured, inferred, and synthetic projects across project management, language services, and the API.

Changes:

  • Adds typed project IDs and narrowing helpers.
  • Migrates project lookup, auto-import, ATA, and API protocols.
  • Updates tests and protocol generation.
File summaries
File Description
tsc/internal/project/snapshot.go Uses typed IDs in snapshot requests and state.
tsc/internal/project/snapshot_test.go Tests typed ID behavior.
tsc/internal/project/session.go Migrates session project tracking to IDs.
tsc/internal/project/session_test.go Updates configured-project assertions.
tsc/internal/project/refcountcache_test.go Updates project lookups.
tsc/internal/project/projectlifetime_test.go Updates configured-project assertions.
tsc/internal/project/projectcollectionbuilder.go Keys project builders by typed IDs.
tsc/internal/project/projectcollection.go Adds ID-based project collections and lookup.
tsc/internal/project/project.go Defines project ID types and parsing.
tsc/internal/project/customconfigfilename_test.go Updates project identity assertions.
tsc/internal/project/configfileregistrybuilder.go Tracks retaining projects by ID.
tsc/internal/project/configfileregistry.go Exposes typed retaining-project IDs.
tsc/internal/project/configfilechanges_test.go Updates configured-project assertions.
tsc/internal/project/bulkcache_test.go Updates configured-project assertions.
tsc/internal/project/autoimport.go Bridges typed IDs into auto-imports.
tsc/internal/project/ata/ata.go Generalizes ATA project identifiers.
tsc/internal/lsp/server.go Uses configured filenames for project information.
tsc/internal/ls/languageservice.go Stores typed auto-import project IDs.
tsc/internal/ls/findallreferences.go Serializes the typed project ID.
tsc/internal/ls/crossproject.go Uses string project IDs for cross-project work.
tsc/internal/ls/autoimport/view.go Keys auto-import views by project ID.
tsc/internal/ls/autoimport/registry.go Migrates registry buckets to typed IDs.
tsc/internal/ls/autoimport/registry_test.go Updates registry ID assertions.
tsc/internal/ls/autoimport/aliasresolver_crash_test.go Updates the fake registry host interface.
tsc/internal/fourslash/statebaseline.go Prints typed IDs in baselines.
tsc/internal/api/session.go Migrates API session operations to typed IDs.
tsc/internal/api/session_requestfilesystem_test.go Updates API snapshot project lookups.
tsc/internal/api/session_createprogram_test.go Tests typed synthetic program IDs.
tsc/internal/api/session_apistate_test.go Updates API state ID expectations.
tsc/internal/api/proto.go Exposes project ID types in API messages.
tsc/internal/api/proto_test.go Tests typed ID decoding.
tools/gen-proto/main.go Maps Go project IDs to generated protocol types.
Review details
  • Files reviewed: 32/32 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread tsc/internal/project/project.go
Comment thread tsc/internal/project/project.go Outdated
Comment thread tsc/internal/project/project.go Outdated
"gotest.tools/v3/assert"
)

func configuredProjectID(path string) project.ID {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the intent here for conversions? This is plain string to Path which my PR will ban

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

3 participants