fix55816: exclude files with re-exports if excluded by preferences.autoImportFileExcludePatterns
Fixes #55816
This failure happened when a file foo.ts that re-exports some variable T is ignored by "typescript.preferences.autoImportFileExcludePatterns". foo.ts was properly ignored by exportMap, but the autoImports still attempted to generate the import with foo.ts instead of the file that originally exported T, which lead to a failure.
This PR allows the moduleSymbol found by autoImports to not match the moduleSymbol found by exportInfoMap if the moduleSymbol found by autoimports is excluded.
Fixes https://github.com/microsoft/TypeScript/issues/55816
Is that the right issue? It seems unrelated.
It is the correct issue, see the call stack here. The quick fix is not offered because getting autoimports fails when the file is excluded in preferences
@typescript-bot pack this
Starting jobs; this comment will be updated as builds start and complete.
| Command | Status | Results |
|---|---|---|
pack this |
✅ Started |
I added a debug statement to only exit quietly if preferences.autoImportFileExcludePatterns is provided, like @andrewbranch mentioned. It seems that otherwise, if the import was unresolved, autoimports goes through other functions to try to generate imports.