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

feat: add an option to disable the debugging status #309

Merged
merged 2 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@
"default": true,
"description": "Should state be shown?"
},
"vscord.status.state.debugging.enabled": {
"type": "boolean",
"default": true,
"description": "Should state be shown when debugging? If disabled, it will be shown when editing/viewing a file."
},
"vscord.status.state.idle.enabled": {
"type": "boolean",
"default": true,
Expand Down
4 changes: 2 additions & 2 deletions src/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const activity = async (

const isNotInFile = !isWorkspaceExcluded && !dataClass.editor;

const isDebugging = !!debug.activeDebugSession;
const isDebugging = config.get(CONFIG_KEYS.Status.State.Debugging.Enabled) && !!debug.activeDebugSession;
isViewing = !isDebugging && isViewing;

let status: CURRENT_STATUS;
Expand Down Expand Up @@ -453,7 +453,7 @@ export const replaceFileInfo = async (

if (dataClass.editor && dataClass.workspaceName && !excluded) {
const name = dataClass.workspaceName;
relativeFilepath = workspace.asRelativePath(dataClass.editor.document.fileName)
relativeFilepath = workspace.asRelativePath(dataClass.editor.document.fileName);
const relativePath = workspace.asRelativePath(dataClass.editor.document.fileName).split(sep);

relativePath.splice(-1, 1);
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { workspace, type ConfigurationTarget, type WorkspaceConfiguration } from "vscode";
import { type PROBLEM_LEVEL } from "./activity";


export type FileSizeStandard = "iec" | "jedec";

export interface ExtensionConfigurationType {
Expand All @@ -21,6 +20,7 @@ export interface ExtensionConfigurationType {
"status.details.text.notInFile": string;
"status.details.text.noWorkSpaceText": string;
"status.state.enabled": boolean;
"status.state.debugging.enabled": boolean;
"status.state.idle.enabled": boolean;
"status.state.text.idle": string;
"status.state.text.viewing": string;
Expand Down
3 changes: 3 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export const CONFIG_KEYS = {
} as const,
State: {
Enabled: "status.state.enabled" as const,
Debugging: {
Enabled: "status.state.debugging.enabled" as const
} as const,
Idle: {
Enabled: "status.state.idle.enabled" as const
} as const,
Expand Down