Skip to content

Commit

Permalink
Autofill bug reports (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
Katsute authored Oct 14, 2023
1 parent dc94ec4 commit e1d5435
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ body:
If your VSCode is blank or stops working please check [here](https://github.com/KatsuteDev/Background#%EF%B8%8F-vscode-stopped-working) first.
- type: input
id: os
attributes:
label: Operating System
validations:
required: true

- type: input
id: vs
attributes:
label: VSCode Version
description: |
Expand All @@ -33,6 +35,7 @@ body:
required: true

- type: input
id: version
attributes:
label: Extension Version
description: |
Expand All @@ -49,6 +52,7 @@ body:
required: true

- type: textarea
id: settings
attributes:
label: Settings
description: |
Expand Down
8 changes: 5 additions & 3 deletions src/command/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

import * as vscode from "vscode";

import * as os from "os";

import { get, UI } from "../vs/vsconfig";
import { pkg } from "../vs/package";
import { quickPickItem, separator, showQuickPick } from "../vs/quickpick";
import * as cfg from "../vs/vsconfig";

import * as file from "./config/file";
import * as align from "./config/align";
Expand All @@ -35,7 +38,6 @@ import * as glob from "../lib/glob";

// interface

const issues: vscode.Uri = vscode.Uri.parse(pkg.bugs.url);
const sponsor: vscode.Uri = vscode.Uri.parse(pkg.sponsor.url);

export const command: vscode.Disposable = vscode.commands.registerCommand("background.config", () => config());
Expand Down Expand Up @@ -118,8 +120,8 @@ export const config: () => void = () => {
handle: () => vscode.commands.executeCommand("background.changelog")
}),
quickPickItem({
label: `$(bug) Report an issue`,
handle: () => vscode.env.openExternal(issues)
label: `$(github) Report an issue on GitHub`,
handle: () => vscode.env.openExternal(vscode.Uri.parse(`https://github.com/KatsuteDev/Background/issues/new?template=bug.yml&os=${encodeURI(`${os.platform()} ${os.release()}`)}&vs=${encodeURI(vscode.version)}&version=${encodeURI(pkg.version)}&settings=${encodeURI("```json\n" + JSON.stringify(cfg.config(), null, 4) + "\n```")}`))
}),
quickPickItem({
label: "$(heart) Sponsor this extension",
Expand Down
2 changes: 1 addition & 1 deletion src/vs/vsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { round } from "../lib/round";

// vs

const config: () => vscode.WorkspaceConfiguration = () => vscode.workspace.getConfiguration("background");
export const config: () => vscode.WorkspaceConfiguration = () => vscode.workspace.getConfiguration("background");

// UI

Expand Down

0 comments on commit e1d5435

Please sign in to comment.