microsoft / microsoft/TypeScript

autoImportSpecifierExcludeRegexes needs a window refresh for changes to take effect

Open
#60,082 9 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Investigation
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

🔎 Search Terms

autoImportSpecifierExcludeRegexes

🕗 Version & Regression Information
  • This changed between versions ______ and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______
⏯ Playground Link

No response

💻 Code

.vscode/settings.json

{
  "<language>.preferences.autoImportSpecifierExcludeRegexes": ["<regex>"]
}
🙁 Actual behavior

Changes only take effect after a window reload.

🙂 Expected behavior

Changes to take effect immediately, same way that autoImportFileExcludePatterns does.

Additional information about the issue

I mentioned this earlier on another issue (https://github.com/microsoft/TypeScript/issues/35395#issuecomment-2371010892) and I initially thought that the update I got fixed the problem, turns out it was just because that forced the window to refresh, as I later encountered the same problem once I tried adding new regexes to it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the handling of the .preferences.autoImportSpecifierExcludeRegexes setting and compare it with autoImportFileExcludePatterns, using .vscode/settings.json for the configuration shape. Confirm that changing the regex list takes effect without a window reload, matching the existing file-exclusion behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.