Skip to content

Conversation

@sandy081
Copy link
Member

@sandy081 sandy081 commented Jan 5, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 5, 2026 15:33
@sandy081 sandy081 enabled auto-merge (squash) January 5, 2026 15:33
@sandy081 sandy081 self-assigned this Jan 5, 2026
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Jan 5, 2026
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 refactors the drop handler for user data profile files by replacing the string-based extension check with a URI-based approach using IUriIdentityService. The changes aim to modernize the code by using more appropriate URI utilities.

  • Replaces endsWithIgnoreCase with uriIdentityService.extUri.extname for extension checking
  • Updates imports to use IUriIdentityService instead of endsWithIgnoreCase
  • Moves the return true statement outside the inner conditional block

async handleDrop(resource: URI, accessor: ServicesAccessor): Promise<boolean> {
if (endsWithIgnoreCase(resource.path, `.${PROFILE_EXTENSION}`)) {
const uriIdentityService = accessor.get(IUriIdentityService);
if (uriIdentityService.extUri.extname(resource) === `.${PROFILE_EXTENSION}`) {
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The new extension check is case-sensitive while the old endsWithIgnoreCase was case-insensitive. This means files with extensions like .Code-Profile or .CODE-PROFILE would have been handled before but will not be handled now. Consider using uriIdentityService.extUri.extname(resource).toLowerCase() to maintain backward compatibility with case-insensitive extension matching.

Suggested change
if (uriIdentityService.extUri.extname(resource) === `.${PROFILE_EXTENSION}`) {
if (uriIdentityService.extUri.extname(resource).toLowerCase() === `.${PROFILE_EXTENSION}`) {

Copilot uses AI. Check for mistakes.
Comment on lines 137 to +138
}
return true;
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Moving the return true statement outside the inner if (editor) block changes the behavior. Previously, the function would implicitly return undefined (falsy) if the editor failed to open, but now it always returns true even when editor is falsy. This could hide issues where the profile editor fails to open. The original behavior should be preserved by keeping return true inside the if (editor) block, or explicitly handling the failure case.

Suggested change
}
return true;
return true;
}
return false;

Copilot uses AI. Check for mistakes.
@sandy081 sandy081 merged commit ad8920b into main Jan 5, 2026
27 of 28 checks passed
@sandy081 sandy081 deleted the sandy081/exceptional-macaw branch January 5, 2026 15:51
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.

3 participants