Skip to content

Replace mock ExtensionCore with real implementation#39

Merged
bomanaps merged 1 commit intoPatrick-Ehimen:mainfrom
bomanaps:core/extension
Nov 20, 2025
Merged

Replace mock ExtensionCore with real implementation#39
bomanaps merged 1 commit intoPatrick-Ehimen:mainfrom
bomanaps:core/extension

Conversation

@bomanaps
Copy link
Copy Markdown
Collaborator

@bomanaps bomanaps commented Nov 20, 2025

Pull Request

Description

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (describe):

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Related Issues

Screenshots (if applicable)

Summary by Sourcery

Replace the mock extension core with the real implementation by using createExtensionCore, enable AI command handling, update the extension activation order to initialize the SDK, configure the API key, initialize the core, and then set up VSCode UI components, and add the core package as a dependency.

Enhancements:

  • Replace mock ExtensionCore with real createExtensionCore implementation
  • Update activation sequence to initialize the SDK, set LIGHTHOUSE_API_KEY, initialize the extension core, then UI components
  • Remove mock-extension-core.ts and related pnpm-lock updates

Build:

  • Add @lighthouse-tooling/extension-core to package.json

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Nov 20, 2025

Reviewer's Guide

This PR swaps out the mock ExtensionCore stub for the actual implementation by using createExtensionCore(), reorders and enhances the activation sequence to properly initialize the SDK, environment variables, and core services before UI components, and adds the real extension-core dependency to package management.

Sequence diagram for updated extension activation flow

sequenceDiagram
    participant VSCodeExtension as "LighthouseVSCodeExtension"
    participant SDK as "LighthouseAISDK"
    participant ExtensionCore as "ExtensionCoreImpl"
    participant StatusBar as "VSCodeStatusBar"
    participant TreeProvider as "VSCodeTreeProvider"
    VSCodeExtension->>SDK: initialize()
    VSCodeExtension->>ExtensionCore: initialize()
    VSCodeExtension->>StatusBar: initialize()
    VSCodeExtension->>TreeProvider: initialize()
Loading

Class diagram for ExtensionCore integration changes

classDiagram
    class LighthouseVSCodeExtension {
        - VSCodeCommandRegistry commandRegistry
        - VSCodeProgressStreamer progressStreamer
        - VSCodeWorkspaceProvider workspaceProvider
        - LighthouseAISDK sdk
        - VSCodeStatusBar statusBar
        - VSCodeTreeProvider treeProvider
        - ExtensionCore extensionCore
        + constructor()
        + activate()
    }
    class ExtensionCoreImpl {
        - CommandRegistry
        - ProgressStreamer
        - WorkspaceContextProvider
        - AICommandHandler
        + initialize()
    }
    class VSCodeStatusBar {
        + initialize()
    }
    class VSCodeTreeProvider {
        + initialize()
    }
    class LighthouseAISDK {
        + initialize()
    }
    LighthouseVSCodeExtension --> ExtensionCoreImpl : uses
    LighthouseVSCodeExtension --> VSCodeStatusBar : uses
    LighthouseVSCodeExtension --> VSCodeTreeProvider : uses
    LighthouseVSCodeExtension --> LighthouseAISDK : uses
    ExtensionCoreImpl --> AICommandHandler : creates
    AICommandHandler --> LighthouseAISDK : creates own instance
Loading

File-Level Changes

Change Details Files
Swap mock ExtensionCore instantiation for real implementation
  • Replace manual ExtensionCore constructor call with createExtensionCore()
  • Remove passing of commandRegistry, progressStreamer, workspaceContextProvider into core
  • Update comments to reflect real core's internal component creation
packages/vscode-extension/src/extension.ts
Revise extension activation order and env var setup
  • Move sdk.initialize() call before extensionCore.initialize()
  • Set process.env.LIGHTHOUSE_API_KEY when API key is available
  • Initialize extensionCore before statusBar and treeProvider
packages/vscode-extension/src/extension.ts
Add real extension-core dependency
  • Include @lighthouse-tooling/extension-core in package.json dependencies
  • Regenerate pnpm-lock.yaml to capture new package
packages/vscode-extension/package.json
pnpm-lock.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@bomanaps bomanaps merged commit e1abca8 into Patrick-Ehimen:main Nov 20, 2025
1 check passed
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