microsoft / microsoft/TypeScript
Autocomple import ignore rootDirs
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
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 the subjections ignore what is available in the rootDirs, only show the options available in the same folder of the editing file.
Example
File src/example/example.tsx
import { exampleImport } from './[autocomplete here]'
import { exampleImport2 } from '../[autocomplete here]'
Try to autocomplete after ./, ../, or any subfolder, the displayed options are only the options available in the src folder, but not the options available in the src_gen folder.
Note: No matter the folder's order in the rootDirs sections, the result is the same. The value of the baseUrl option is not important for reproduce this behaviour.
Maybe related to: https://github.com/Microsoft/TypeScript/issues/28550 and https://github.com/Microsoft/TypeScript/issues/30147
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the tsconfig.json example using rootDirs and reproduce autocomplete from src/example/example.tsx after ./, ../, and subfolder prefixes. Compare the suggestions from src and src_gen, then use the related issues #28550 and #30147 for context. Done means autocomplete includes the relevant options available through rootDirs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100