Add typed project IDs - #64319
Open
Andrew Branch (andrewbranch) wants to merge 2 commits into
Open
Add typed project IDs#64319Andrew Branch (andrewbranch) wants to merge 2 commits into
Andrew Branch (andrewbranch) wants to merge 2 commits into
Conversation
Copilot started reviewing on behalf of
Andrew Branch (andrewbranch)
September 17, 2026 23:17
View session
Contributor
There was a problem hiding this comment.
🟡 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.
| "gotest.tools/v3/assert" | ||
| ) | ||
|
|
||
| func configuredProjectID(path string) project.ID { |
There was a problem hiding this comment.
What's the intent here for conversions? This is plain string to Path which my PR will ban
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After #64204 added a new Project kind for API-created programs, the abuse of using
tspath.Pathfor all project IDs (and even settingconfigFileName) 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.