Skip to content

Commit

Permalink
feat(extension): GitHub Pull Request and Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Nov 27, 2023
1 parent f6ac9eb commit 1ec4110
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/hooks/updateVSCtypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
18 changes: 18 additions & 0 deletions src/theme/extensions/github-pull-request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { GitHubPullRequestColors, ThemeContext } from "@/types";

export default function colors(
context: ThemeContext,
): Partial<GitHubPullRequestColors> {
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,
};
}
2 changes: 2 additions & 0 deletions src/theme/extensions/index.ts
Original file line number Diff line number Diff line change
@@ -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),
};
}
47 changes: 47 additions & 0 deletions src/types/github-pull-request.d.ts
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1ec4110

Please sign in to comment.