Skip to content

Conversation

@GiladShoham
Copy link
Member

Proposed Changes

@GiladShoham GiladShoham requested a review from Copilot September 29, 2025 07:32
Copy link

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 adds functionality to allow removing "specific" aspect configurations by introducing a new special sign -- that can be used to ignore extensions from specific configuration sources (BitmapFile, ModelSpecific, ComponentJsonFile).

  • Introduces a new IGNORE_FROM_SPECIFIC_SPECIAL_SIGN constant (--) alongside the existing remove sign (-)
  • Updates the aspects merger to filter out extensions marked with the ignore sign from specific configuration sources
  • Adds type safety improvements for config object handling

Reviewed Changes

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

File Description
scopes/workspace/workspace/aspects-merger.ts Implements the core logic to filter ignored extensions from specific sources and adds type safety for config objects
components/legacy/extension-data/index.ts Exports the new ignore constant
components/legacy/extension-data/extension-data.ts Defines the new ignore special sign and related types/methods
components/legacy/extension-data/extension-data-list.ts Adds filtering method for ignored extensions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

ignoredFromSpecificsExtensionIds.push(
...extensions.filter((extData) => extData.isIgnoredFromSpecific).map((extData) => extData.stringId)
);
extsWithoutIgnored = extensions.filter((ext) => !ignoredFromSpecificsExtensionIds.includes(ext.stringId));
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

Using includes() with an array for filtering can be inefficient for large datasets. Consider using a Set for ignoredFromSpecificsExtensionIds to improve lookup performance from O(n) to O(1).

Copilot uses AI. Check for mistakes.
Comment on lines +39 to 41
get config(): { [key: string]: any } | string {
if (this.rawConfig === REMOVE_EXTENSION_SPECIAL_SIGN) return {};
return this.rawConfig;
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

The return type change from { [key: string]: any } to { [key: string]: any } | string is a breaking change that could affect consumers expecting only object types. Consider maintaining backward compatibility or documenting this breaking change.

Suggested change
get config(): { [key: string]: any } | string {
if (this.rawConfig === REMOVE_EXTENSION_SPECIAL_SIGN) return {};
return this.rawConfig;
get config(): { [key: string]: any } {
if (
this.rawConfig === REMOVE_EXTENSION_SPECIAL_SIGN ||
this.rawConfig === IGNORE_FROM_SPECIFIC_SPECIAL_SIGN
) {
return {};
}
return this.rawConfig as { [key: string]: any };

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.

2 participants