Skip to content
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

Add output channel into internal commands #798

Merged
merged 2 commits into from
Sep 9, 2021

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Sep 9, 2021

This PR gets a lot of the grunt work out of the way to address #795 and specifically this comment.

I took the opportunity to pull out some heavy lifting builder util. LMK what you think.


this.registerCommand(AvailableCommands.SHOW_OUTPUT_CHANNEL, () =>
outputChannel.show()
)
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] This is a placeholder. The plan is to actually move registerInstrumentedCommand into this class and then have it show a toast error which gives the option to reveal the output channel instead of the throwing another error.

@mattseddon mattseddon marked this pull request as ready for review September 9, 2021 01:05
@@ -0,0 +1,98 @@
import { spy, stub } from 'sinon'
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] These are super gross that is why I held off implementing them, if you get a problem crop up in these complicated utils then you can get into all sorts of trouble trying to debug.

Copy link
Contributor

Choose a reason for hiding this comment

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

While the utils' source is gross, I think it'll be better to have these reusable functions that have all the gross mock logic in one place over spreading everything out and re-creating the mocks slightly differently each time. Thanks for taking this on!

@@ -22,20 +23,29 @@ suite('Repository Test Suite', () => {
disposable.dispose()
})

const buildRepository = () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] This is only required in this file, hence I didn't pull it into a util.

@@ -23,6 +23,10 @@ export class OutputChannel {
})
}

public show() {
return this.outputChannel.show(true)
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] This is why we are making this change.

@codeclimate
Copy link

codeclimate bot commented Sep 9, 2021

Code Climate has analyzed commit 85ef140 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 95.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.0% (0.0% change).

View more on Code Climate.

@mattseddon mattseddon merged commit 9a80a21 into master Sep 9, 2021
@mattseddon mattseddon deleted the add-output-channel-to-commands branch September 9, 2021 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants