-
Notifications
You must be signed in to change notification settings - Fork 36.4k
Turn on isolatedModule in tsconfig #279208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enables the isolatedModules TypeScript compiler flag in tsconfig.json and addresses the compatibility issues that arise from this change. The isolatedModules flag ensures each file can be transpiled independently, which is required for faster compilation tools and certain build scenarios.
- Enabled
isolatedModules: truein src/tsconfig.json - Fixed
const enumdeclarations to be compatible with isolated modules compilation - Updated imports to use type-only syntax where appropriate
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tsconfig.json | Enabled isolatedModules compiler flag |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.ts | Moved TerminalState const enum from function scope to module scope to avoid issues with isolatedModules |
| src/vs/workbench/contrib/chat/common/tools/promptTsxTypes.ts | Removed declare keyword from exported const enums, which is incompatible with isolatedModules |
| src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts | Added type keyword to type-only import of IAgentSource |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.ts | Replaced reference to localChatSessionType const with inline string literal 'local' since cross-file const references require special handling with isolatedModules |
| } | ||
|
|
||
| export function getAgentSessionProviderName(provider: AgentSessionProviders): string { | ||
|
|
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Extra blank line added. This should be removed to maintain consistent formatting.
| import { Schemas } from '../../../../../../base/common/network.js'; | ||
| import { IExtensionService } from '../../../../../services/extensions/common/extensions.js'; | ||
|
|
||
|
|
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Extra blank line added. This should be removed to maintain consistent formatting.
| import { localChatSessionType } from '../../common/chatSessionsService.js'; | ||
|
|
||
| export const AGENT_SESSIONS_VIEW_CONTAINER_ID = 'workbench.viewContainer.agentSessions'; | ||
|
|
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Extra blank line added. This should be removed to maintain consistent formatting.
jrieken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My testing (compile our sources with this change) shows that const enums are not inlined anymore. This can also be seen in the TS Playground This seems to be in contrast with how esbuild does it and something we need to consider very carefully because of the performance implications.
Turn on isolatedModule flag in tsconfig, and fix some
declare const enumAddress #252605