Skip to content

Conversation

@bryanchen-d
Copy link
Contributor

@bryanchen-d bryanchen-d commented Nov 24, 2025

Turn on isolatedModule flag in tsconfig, and fix some declare const enum

Address #252605

Copilot AI review requested due to automatic review settings November 24, 2025 18:05
@bryanchen-d bryanchen-d self-assigned this Nov 24, 2025
@bryanchen-d bryanchen-d requested a review from jrieken November 24, 2025 18:05
@vs-code-engineering
Copy link

vs-code-engineering bot commented Nov 24, 2025

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.ts

@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 24, 2025
Copilot finished reviewing on behalf of bryanchen-d November 24, 2025 18:07
Copy link
Contributor

Copilot AI left a 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: true in src/tsconfig.json
  • Fixed const enum declarations 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 {

Copy link

Copilot AI Nov 24, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
import { Schemas } from '../../../../../../base/common/network.js';
import { IExtensionService } from '../../../../../services/extensions/common/extensions.js';


Copy link

Copilot AI Nov 24, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
import { localChatSessionType } from '../../common/chatSessionsService.js';

export const AGENT_SESSIONS_VIEW_CONTAINER_ID = 'workbench.viewContainer.agentSessions';

Copy link

Copilot AI Nov 24, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
Copy link
Member

@jrieken jrieken left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants