Support disabling ATA via VS Code settings for inferred projects#3584
Conversation
Add DisableAutomaticTypeAcquisition and AutomaticTypeAcquisitionEnabled fields to UserPreferences to parse the VS Code settings: - typescript.disableAutomaticTypeAcquisition (deprecated) - js/ts.tsserver.automaticTypeAcquisition.enabled (unified) Check user preferences in triggerATAForUpdatedProjects to skip ATA when disabled. Add unit tests for preference parsing and integration tests for ATA disabling. Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/94b198f1-5aa1-4398-b088-d801a80e8aaa Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
…ller nil check Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/cbb41f3d-e3a1-49a5-908c-792a96e615f5 Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
|
@copilot what happens if the user changes this setting? See other pref update code. |
…dates Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/aaaf7229-4997-481c-a267-1617dcbd75cc Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Added |
Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/44053c58-e7df-4caa-87ca-1565dcdfa288 Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds support for disabling Automatic Type Acquisition (ATA) via VS Code user settings for inferred projects, including dynamic preference changes and test coverage.
Changes:
- Added ATA-related preferences to
lsutil.UserPreferenceswith anIsATADisabled()helper and precedence rules. - Gated ATA triggering in session snapshot updates based on the resolved ATA preference.
- Added unit/integration tests covering preference parsing, precedence, disabling ATA, and refresh behavior on re-enable.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| internal/project/session.go | Gates ATA triggering and refreshes diagnostics when ATA preference changes. |
| internal/project/ata/ata_test.go | Adds integration tests ensuring ATA can be disabled via both unified and deprecated settings, plus refresh on re-enable. |
| internal/ls/lsutil/userpreferences_test.go | Adds unit tests for ATA preference parsing and precedence. |
| internal/ls/lsutil/userpreferences.go | Introduces ATA-related preferences and IsATADisabled() resolution logic. |
|
@copilot address review comments. make sure you review your own code next time |
…config comments, refactor tests to table-driven Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/617b0bfb-e582-4a88-b7d8-eab32b3d5525 Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Addressed all review comments in 63d152e:
|
|
@copilot Investigate this data race from CI: |
|
This PR is actually fine, it's #3057 which has data races not caught in its own CI run. |
DisableAutomaticTypeAcquisitionandAutomaticTypeAcquisitionEnabledtoUserPreferenceswithIsATADisabled()helpers.Config().IsATADisabled()check at call siterefreshATAIfNeededinConfigure()js/ts.tsserver.web.typeAcquisition.enabledweb variant