microsoft / microsoft/TypeScript
Renaming file doesn't update imports in other projects which reference this project
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
Bug Report
🔎 Search Terms
rename file folder move project references
💻 Code
Reduced test case: https://github.com/OliverJAsh/ts-project-references-rename-bug-test-44411
tsconfig.json:
{
"files": [],
"references": [
{
"path": "./app/tsconfig.json"
},
{
"path": "./shared/tsconfig.json"
}
]
}
shared/tsconfig.json:
{
"compilerOptions": {
"composite": true
}
}
shared/foo.ts:
export const foo = 1;
shared/bar.ts:
import { foo } from "./foo";
foo
app/tsconfig.json:
{
"compilerOptions": {
"composite": true,
"paths": {
"shared/*": ["../shared/*"]
}
},
"references": [
{
"path": "../shared/tsconfig.json"
}
]
}
app/main.ts:
import { foo } from "shared/foo";
foo;
Steps to reproduce
- Open VS Code and navigate to
shared/foo.ts - Wait for VS Code to finish initialising TS.
- Rename the file to something else e.g.
foo2.ts
🙁 Actual behavior
- File is renamed
- Imports in the current project are updated
- Imports in other projects which reference this project are not updated
🙂 Expected behavior
- File is renamed
- Imports in the current project are updated
- Imports in other projects which reference this project are updated. For example,
app/main.tswhich importsshared/foo.ts.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con il test case ridotto e riproduci la ridenominazione di shared/foo.ts con un altro nome, osservando app/main.ts e i riferimenti al progetto nei due file tsconfig.json. Esamina il tsserver.log collegato e confronta gli aggiornamenti degli import all'interno di shared con gli aggiornamenti nel progetto app che fa riferimento; l'operazione è completata quando viene aggiornato anche app/main.ts.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript, vscode
- Ambito
- developer-experience, tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100