Skip to content

Conversation

sjf
Copy link
Contributor

@sjf sjf commented Jul 26, 2025

Replace the vscode OutputChannel.appendLine with HostProvider.logToChannel.

Remove places where the cline OutputChannel was being passed around. Now it is stored in the HostProvider, so we don't need to do this. We don't need to initialize the Logger to setup the output channel anymore, the channel is set up when the HostProvider is initialized.

Remove the OutputChannel from the vscode-impls.


Important

Refactor logging by moving OutputChannel management to HostProvider, simplifying code and centralizing logging functionality.

  • Behavior:
    • Replaces vscode.OutputChannel.appendLine with HostProvider.logToChannel for logging.
    • Removes OutputChannel parameter from Controller and WebviewProvider constructors.
    • Initializes OutputChannel in HostProvider during setup in extension.ts and cline-core.ts.
  • Refactoring:
    • Updates Logger class to use HostProvider.logToChannel for logging.
    • Modifies cleanupLegacyCheckpoints() in CheckpointMigration.ts to use HostProvider.logToChannel.
    • Updates tests in cline-api.test.ts to mock logToChannel instead of OutputChannel.
  • Misc:
    • Removes OutputChannel creation from vscode-impls.js and vscode-context-stubs.ts.
    • Adjusts createClineAPI() in index.ts to no longer require OutputChannel.

This description was created by Ellipsis for 2e6face. You can customize this summary. It will automatically update as commits are pushed.

@celestial-vault
Copy link
Contributor

@sjf Do we even want this anymore? No one uses it.

@sjf
Copy link
Contributor Author

sjf commented Jul 26, 2025

The extension is still using it, even though it doesn't seem super important. Really I am trying to remove it because it's pulling VS code dependencies into the HostProver and it's preventing me from making unit tests.

Copy link

changeset-bot bot commented Jul 28, 2025

⚠️ No Changeset found

Latest commit: 2e6face

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Jul 28, 2025

Coverage Report

Extension Coverage

Base branch: 46%

PR branch: 47%

✅ Coverage increased or remained the same

Webview Coverage

Base branch: 17%

PR branch: 17%

✅ Coverage increased or remained the same

Overall Assessment

Test coverage has been maintained or improved

Last updated: 2025-07-28T19:03:47.150520

sjf added 3 commits July 28, 2025 14:53
Replace `OutputChannel.appendLine` with `HostProvider.logToChannel`.

Remove places where the cline OutputChannel was being passed around. Now it is stored in the HostProvider, so we don't need to do this.

# Conflicts:
#	src/hosts/vscode/VscodeWebviewProvider.ts
Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

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

Can still see the output channel working in VS Code after the refactor:

image

@sjf sjf merged commit 22788f0 into main Jul 29, 2025
13 checks 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.

3 participants