Skip to content

Conversation

@osortega
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 24, 2025 05:35
@osortega osortega self-assigned this Nov 24, 2025
Copilot finished reviewing on behalf of osortega November 24, 2025 05:37
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 24, 2025
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 fixes a test suite for ChatSessionsService by unskipping the test suite and making the extractFileNameFromLink method public to enable proper testing. The change allows comprehensive testing of the file name extraction logic used in chat session descriptions.

Key Changes

  • Unskipped the ChatSessionsService test suite to enable testing
  • Changed extractFileNameFromLink method visibility from private to public to support testing

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs/workbench/contrib/chat/test/browser/chatSessionsService.test.ts Removed skip from test suite to enable execution of tests
src/vs/workbench/contrib/chat/browser/chatSessions.contribution.ts Changed extractFileNameFromLink method from private to public
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/test/browser/chatSessionsService.test.ts:27

  • The helper function callExtractFileNameFromLink uses type casting to access extractFileNameFromLink, but the method is now public. The function should directly call chatSessionsService.extractFileNameFromLink(filePath) instead of using the bracket notation workaround, and the comment about accessing a "private method" is now incorrect.
		function callExtractFileNameFromLink(filePath: string): string {
			// Access the private method using bracket notation with proper typing
			type ServiceWithPrivateMethod = Record<'extractFileNameFromLink', (filePath: string) => string>;
			return (chatSessionsService as unknown as ServiceWithPrivateMethod)['extractFileNameFromLink'](filePath);
		}

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is NOT good and was the original reason this never caused a compile error:

function callExtractFileNameFromLink(filePath: string): string {
// Access the private method using bracket notation with proper typing
type ServiceWithPrivateMethod = Record<'extractFileNameFromLink', (filePath: string) => string>;
return (chatSessionsService as unknown as ServiceWithPrivateMethod)['extractFileNameFromLink'](filePath);
}

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