feat: Typescript ignore type imports setting#119
Merged
magic5644 merged 5 commits intoJul 3, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in setting to ignore TypeScript type-only imports/exports when building the dependency graph, aligning cycle detection more closely with what common bundlers include at runtime.
Changes:
- Introduces
graph-it-live.ignoreTypeImportsconfiguration and plumbs it through extension config → SpiderBuilder → worker/analyzer services. - Updates TypeScript analyzer caching to differentiate parsers based on the ignore-types setting.
- Adds/updates tests covering config snapshot + builder chaining + analyzer caching + basic type-only import/export parsing.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/extension/ProviderStateManager.test.ts | Verifies ignoreTypeImports is captured in the provider config snapshot. |
| tests/analyzer/SpiderBuilder.test.ts | Extends fluent API chaining test to include withIgnoreTypeImports. |
| tests/analyzer/parser-type-imports.test.ts | Adds parser tests for ignoring type-only imports/exports (needs expansion for TS 5+ syntax). |
| tests/analyzer/LanguageService.test.ts | Ensures analyzer cache separates instances when ignoreTypeImports differs. |
| src/extension/services/ProviderStateManager.ts | Adds ignoreTypeImports to the extension’s configuration snapshot. |
| src/extension/services/graphProviderServiceContainer.ts | Wires snapshot value into SpiderBuilder.withIgnoreTypeImports(...). |
| src/analyzer/types.ts | Adds ignoreTypeImports to SpiderConfig. |
| src/analyzer/SpiderBuilder.ts | Stores/configures ignoreTypeImports and passes it to LanguageService. |
| src/analyzer/spider/SpiderWorkerManager.ts | Passes ignoreTypeImports through worker build options. |
| src/analyzer/spider/SpiderIndexingService.ts | Includes ignoreTypeImports in worker startup config. |
| src/analyzer/Parser.ts | Implements initial skipping of type-only imports/exports (currently incomplete for TS 5+ specifier syntax). |
| src/analyzer/LanguageService.ts | Adds ignore-types flag to TS parser cache key and passes it into Parser. |
| src/analyzer/IndexerWorkerHost.ts | Extends worker config shape to include ignoreTypeImports. |
| src/analyzer/IndexerWorker.ts | Constructs LanguageService with ignoreTypeImports in the worker. |
| package.json | Adds graph-it-live.ignoreTypeImports setting declaration. |
| package-lock.json | Lockfile update (removes some libc metadata entries). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Old version was only ignoring "import type" and "export type" clauses. Now import/export { type foo, type bar} from ... is also recognized as a type import/export
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ef03b68 to
1c289aa
Compare
magic5644
approved these changes
Jul 3, 2026
magic5644
left a comment
Owner
There was a problem hiding this comment.
OK, I made some adjustments on tests, this PR is LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
React and Typescript developer here. I use this extension on my projects to check and fix circular dependencies in my codebase. Sometimes i just want to import a type, thing that many bundlers like vite ignore. I don't want a "cycle" error to show up in that cases. This feature adds a new boolean configuration item (
graph-it-live.ignoreTypeImports) that defaults to false. When toggled on, type imports and exports are completely ignored on the graph, giving a cleaner view which closer to what bundlers see when packaging.Type of change
Validation evidence
Every test passed.
The only error I'm getting:
Quality
npm run lintnpm run check:typesnpm test(Only 1 error: related with windows, it existed with a clean clone)VSIX / Packaging (required when build config or deps changed)
npm run package:verify→✅ No .map files in packagenpx vsce ls graph-it-live-*.vsix | grep "\.wasm$"shows required WASM files (windows doesnt have grep command, I couldn't test it)ls -lh graph-it-live-*.vsixsize checked (target ≤ 16 MB, warn above)E2E
npm run test:vscode:vsix(required for user-facing changes)Checklist
vscodeimport added undersrc/analyzer/**orsrc/mcp/**Note
Sometimes, i need to restart the extension for the changes to apply. It also happens to me with the exclude node modules setting.