microsoft / microsoft/TypeScript

`js/ts.preferences.autoImportFileExcludePatterns` is not reflected promptly in IntelliSense suggestions

Aperta
#63,498 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Needs Investigation
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

🔎 Search Terms

autoImportFileExcludePatterns

🕗 Version & Regression Information
  • I test this in 4.8.4, 6.0.3 and tsgo 0.20260520.1
⏯ Playground Link

No response

💻 Code

in .vscode/settings.json

"js/ts.preferences.autoImportFileExcludePatterns": [
	//"**/node_modules/@types/node",
	// "node",
	"fs.d.ts",
	// "node_modules/@types/node/fs.d.ts",
	// "node:fs"
]

a.ts

readFileSync('','');
readF
🙁 Actual behavior

In VSCode,
when repeatedly toggling "fs.d.ts" in the config above:
Normal part: you will find that for the first line readFileSync('',''), the Quick Fix menu item like import from "fs" will appear or disappear as expected when "fs.d.ts" is added or removed from the config.
But for the case when you type readF and trigger IntelliSense, whether readFileSync... appears in the completion suggestions is unpredictable. Sometimes using "Reload Window" can fix it, but in most cases, it doesn't work as expected—toggling "fs.d.ts" doesn't immediately change the current IntelliSense state.

🙂 Expected behavior

For the above example, after modifying "js/ts.preferences.autoImportFileExcludePatterns" in the VSCode config, I expect the IntelliSense suggestions to reflect the changes immediately.

Additional information about the issue

There is a similar issue: https://github.com/microsoft/TypeScript/issues/60082
However, that one is a bit old and the phenomenon I described is somewhat different.

Additionally, I have a question: For the setting js/ts.preferences.autoImportFileExcludePatterns, does it only match a single file, or does it match the xxx part in import ... from 'xxx'? After all, a single file can define multiple modules, and multiple "exports" can also be defined in package.json.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la riproduzione in .vscode/settings.json e a.ts, alternando fs.d.ts mentre confronti il comportamento di Quick Fix con i suggerimenti di completamento di IntelliSense. Traccia la gestione della configurazione per js/ts.preferences.autoImportFileExcludePatterns e lo stato di completamento che essa influenza. Il lavoro è completo quando la modifica dell'impostazione aggiorna immediatamente gli attuali suggerimenti di IntelliSense e la riproduzione segnalata è coperta da un test di regressione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
developer-experience, tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.