Remove common/index.ts and vscode from common/logging#2531
Merged
Conversation
The `logging` part of `common` was exported in `common/index.ts` and could be imported by importing `common`. I don't think this makes a lot of sense, so I removed it. The `common/logging/index.ts` also contained exports of the `common/logging/vscode` directory, which means that importing `common/logging` automatically brings in the `vscode` module. This removes that export, so now there are two separate imports needed for importing the common part and the `vscode` specific part. This should make it easier to keep them separate and be more explicit about what you're importing.
robertbrignull
approved these changes
Jun 21, 2023
Contributor
robertbrignull
left a comment
There was a problem hiding this comment.
Oh wow, you used to be able to do import { extLogger, Logger, ProgressReporter } from "../common"; and get a VS Code logger by importing from /common 😮
Changes LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
loggingpart ofcommonwas exported incommon/index.tsand could be imported by importingcommon. I don't think this makes a lot of sense, so I removed it.The
common/logging/index.tsalso contained exports of thecommon/logging/vscodedirectory, which means that importingcommon/loggingautomatically brings in thevscodemodule. This removes that export, so now there are two separate imports needed for importing the common part and thevscodespecific part. This should make it easier to keep them separate and be more explicit about what you're importing.Checklist
ready-for-doc-reviewlabel there.