Skip to content

Un-register extension between steps to prevent cascading test failures #5227

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tsmarvin
Copy link

PR Summary

  • Add getRegisteredExtensions method to extension client to allow listing all registered extensions.
  • Update ensureEditorServicesIsConnected test method to un-register the extension if its already registered to prevent cascading test failures.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

…ting all registered extensions.

- Update ensureEditorServicesIsConnected test method to un-register the extension if its already registered to prevent cascading test failures.
@Copilot Copilot AI review requested due to automatic review settings June 29, 2025 12:14
Copy link

@Copilot 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 prevents cascading test failures by ensuring that any previously registered extension is unregistered before a new registration occurs.

  • Adds a new getRegisteredExtensions method to the extension client.
  • Updates the test to loop over registered extensions and unregister any that match the target extension ID.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/utils.ts Updated test logic to unregister a pre-registered extension.
src/features/ExternalApi.ts Added getRegisteredExtensions to expose registered extensions.
src/extension.ts Extended the client wrapper to include the new getRegisteredExtensions method.
Comments suppressed due to low confidence (1)

test/utils.ts:85

  • The variable name '_name' is ambiguous. Consider renaming it to 'uuid' or 'extensionKey' to better convey its purpose.
    for (const [

if (externalExtension.id === extensionId) {
extension.unregisterExternalExtension(_name);
}
};
Copy link
Preview

Copilot AI Jun 29, 2025

Choose a reason for hiding this comment

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

[nitpick] There is an unnecessary semicolon after the for loop block; removing it would improve code readability.

Suggested change
};
}

Copilot uses AI. Check for mistakes.

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.

1 participant