microsoft / microsoft/TypeScript
Autocomple import parent dir wrong when rootDirs is defined
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
TypeScript Version: 3.3.3333
If you configure in the tsconfig.json a rootDirs section like
{
"compilerOptions": {
"baseUrl": "src",
"rootDirs": [
"src",
"src_gen"
]
}
}
When you try autocomplete an import from the parent folder (..) in a subfolder the subjections are wrong, on linux (where I tested) it add all the valid completitions as well the content of the system root (/) foolder.
Example
File src/example/example.tsx
import { exampleImport } from '../[autocomplete here]'
Try to autocomplete after ../ the displayed options are wrong, it add a lot of extra invalid options.
Note: It only happens when you are listing the ../ autocomplete options, if you already selected a subfolder inside ../ (e.g. ../shared/) it works properly.
Maybe related to: https://github.com/Microsoft/TypeScript/issues/28550 and https://github.com/Microsoft/TypeScript/issues/30148
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Problem mit der bereitgestellten tsconfig.json und src/example/example.tsx und untersuche anschließend den TypeScript-Autocomplete-Pfad für Importe, die mit ../ beginnen, wenn rootDirs gesetzt ist. Das Ziel ist erreicht, wenn die Vorschläge für übergeordnete Verzeichnisse nur gültige Projekteinträge enthalten und keine Inhalte des Systemstammverzeichnisses einschließen, während die Vervollständigung nach der Auswahl eines Unterordners weiterhin funktioniert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100