diff --git a/README.md b/README.md index e0128c03..3ec67652 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,7 @@ You can find all the available keys [here](https://code.visualstudio.com/api/ref Catppuccin for VSCode also themes the following extensions: - [ErrorLens](https://github.com/usernamehw/vscode-error-lens) +- [GitHub Pull Requests and Issues](https://github.com/microsoft/vscode-pull-request-github) - [GitLens](https://github.com/gitkraken/vscode-gitlens) ## Support diff --git a/src/hooks/updateVSCtypes.ts b/src/hooks/updateVSCtypes.ts index 1506c63a..87655479 100644 --- a/src/hooks/updateVSCtypes.ts +++ b/src/hooks/updateVSCtypes.ts @@ -46,6 +46,13 @@ const mappings = [ fname: "gitlens.d.ts", kind: "extension-packagejson", }, + { + schema: + "https://github.com/microsoft/vscode-pull-request-github/raw/v0.77.2023112709/package.json", + name: "GitHubPullRequestColors", + fname: "github-pull-request.d.ts", + kind: "extension-packagejson", + }, ]; for (const { schema, name, fname, kind } of mappings) { diff --git a/src/theme/extensions/github-pull-request.ts b/src/theme/extensions/github-pull-request.ts new file mode 100644 index 00000000..b1c6c4c8 --- /dev/null +++ b/src/theme/extensions/github-pull-request.ts @@ -0,0 +1,18 @@ +import type { GitHubPullRequestColors, ThemeContext } from "@/types"; + +export default function colors( + context: ThemeContext, +): Partial { + const { palette } = context; + + return { + "issues.closed": palette.mauve, + "issues.newIssueDecoration": palette.rosewater, + "issues.open": palette.green, + "pullRequests.closed": palette.red, + "pullRequests.draft": palette.overlay2, + "pullRequests.merged": palette.mauve, + "pullRequests.notification": palette.text, + "pullRequests.open": palette.green, + }; +} diff --git a/src/theme/extensions/index.ts b/src/theme/extensions/index.ts index 9a2e49e3..f871a6ab 100644 --- a/src/theme/extensions/index.ts +++ b/src/theme/extensions/index.ts @@ -1,10 +1,12 @@ import type { ThemeContext } from "@/types"; import errorLens from "./error-lens"; +import gitHubPullRequest from "./github-pull-request"; import gitLens from "./gitlens"; export default function (context: ThemeContext) { return { ...errorLens(context), + ...gitHubPullRequest(context), ...gitLens(context), }; } diff --git a/src/types/github-pull-request.d.ts b/src/types/github-pull-request.d.ts new file mode 100644 index 00000000..14cdb97a --- /dev/null +++ b/src/types/github-pull-request.d.ts @@ -0,0 +1,47 @@ +/* eslint-disable */ +/** + * This file was automatically generated. + * DO NOT MODIFY IT BY HAND. + * Instead, run `yarn run updateVSCtypes` to regenerate this file. + */ +export interface GitHubPullRequestColors { + /** + * The color used for the assignees and labels fields in a new issue editor. + */ + "issues.newIssueDecoration": string; + + /** + * The color used for indicating that an issue is open. + */ + "issues.open": string; + + /** + * The color used for indicating that an issue is closed. + */ + "issues.closed": string; + + /** + * The color used for indicating that a pull request is merged. + */ + "pullRequests.merged": string; + + /** + * The color used for indicating that a pull request is a draft. + */ + "pullRequests.draft": string; + + /** + * The color used for indicating that a pull request is open. + */ + "pullRequests.open": string; + + /** + * The color used for indicating that a pull request is closed. + */ + "pullRequests.closed": string; + + /** + * The color used for indicating a notification on a pull request + */ + "pullRequests.notification": string; +} diff --git a/src/types/index.d.ts b/src/types/index.d.ts index a38af656..2527030d 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -9,6 +9,7 @@ export type * from "./token-styling"; // extensions export type * from "./errorlens"; +export type * from "./github-pull-request"; export type * from "./gitlens"; export type CatppuccinFlavor = keyof typeof variants;