Add auto-import retry to getCompletionsAtPosition in API - #64133
Open
auvred wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The retry path must propagate cancellation after auto-import snapshot preparation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds API completion retry support when auto-import data is required.
Changes:
- Retries completions using an auto-import-prepared snapshot.
- Generalizes language-service setup for alternate snapshots.
- Adds an auto-import completion regression test.
File summaries
| File | Description |
|---|---|
tsc/internal/api/session.go |
Implements snapshot preparation and completion retry. |
tsc/internal/api/session_completion_test.go |
Verifies auto-import completions are returned. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+4032
to
+4033
| preparedSnapshot := s.projectSession.GetSnapshotWithAutoImports(ctx, sd.snapshot, params.File.ToURI(s.projectSession.GetCurrentDirectory())) | ||
| defer preparedSnapshot.Deref(s.projectSession) |
Jake Bailey (jakebailey)
requested a review
from Andrew Branch (andrewbranch)
September 2, 2026 17:25
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.
Fixes #64132
This PR adds a retry with
(*Session).GetSnapshotWithAutoImportssimilar toTypeScript/tsc/internal/lsp/server.go
Lines 1379 to 1391 in 6ed67b6