Allow people to set the state or details section to be empty (#47)
This commit is contained in:
parent
24f1d51f06
commit
8fc1461fff
2 changed files with 17 additions and 14 deletions
|
@ -63,12 +63,12 @@
|
||||||
"discord.detailsEditing": {
|
"discord.detailsEditing": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "Editing {filename}",
|
"default": "Editing {filename}",
|
||||||
"description": "Custom string for the details section of the rich presence"
|
"description": "Custom string for the details section of the rich presence\nIf this is set to '{null}', it will be replaced with an empty space"
|
||||||
},
|
},
|
||||||
"discord.detailsDebugging": {
|
"discord.detailsDebugging": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "Editing {filename}",
|
"default": "Editing {filename}",
|
||||||
"description": "Custom string for the details section of the rich presence when debugging"
|
"description": "Custom string for the details section of the rich presence when debugging\nIf this is set to '{null}', it will be replaced with an empty space"
|
||||||
},
|
},
|
||||||
"discord.detailsIdle": {
|
"discord.detailsIdle": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -78,12 +78,12 @@
|
||||||
"discord.lowerDetailsEditing": {
|
"discord.lowerDetailsEditing": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "Workspace: {workspace}",
|
"default": "Workspace: {workspace}",
|
||||||
"description": "Custom string for the state section of the rich presence"
|
"description": "Custom string for the state section of the rich presence\nIf this is set to '{null}', it will be replaced with an empty space"
|
||||||
},
|
},
|
||||||
"discord.lowerDetailsDebugging": {
|
"discord.lowerDetailsDebugging": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "Debugging: {workspace}",
|
"default": "Debugging: {workspace}",
|
||||||
"description": "Custom string for the state section of the rich presence when debugging"
|
"description": "Custom string for the state section of the rich presence when debugging\nIf this is set to '{null}', it will be replaced with an empty space"
|
||||||
},
|
},
|
||||||
"discord.lowerDetailsIdle": {
|
"discord.lowerDetailsIdle": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
@ -269,17 +269,20 @@ function generateDetails(debugging, editing, idling): string {
|
||||||
: false;
|
: false;
|
||||||
const workspaceFolder: WorkspaceFolder = checkState ? workspace.getWorkspaceFolder(window.activeTextEditor.document.uri) : null;
|
const workspaceFolder: WorkspaceFolder = checkState ? workspace.getWorkspaceFolder(window.activeTextEditor.document.uri) : null;
|
||||||
|
|
||||||
|
const emptyDebugState: boolean = config.get(debugging) === '{null}';
|
||||||
|
const emptyEditingState: boolean = config.get(editing) === '{null}';
|
||||||
|
|
||||||
return window.activeTextEditor
|
return window.activeTextEditor
|
||||||
? debug.activeDebugSession
|
? debug.activeDebugSession
|
||||||
? config.get(debugging)
|
? emptyDebugState
|
||||||
|
? '\u200b\u200b'
|
||||||
|
: config.get(debugging)
|
||||||
.replace('{filename}', fileName)
|
.replace('{filename}', fileName)
|
||||||
.replace('{workspace}', checkState
|
.replace('{workspace}', checkState ? workspaceFolder.name : config.get('lowerDetailsNotFound'))
|
||||||
? workspaceFolder.name
|
: emptyEditingState
|
||||||
: config.get('lowerDetailsNotFound'))
|
? '\u200b\u200b'
|
||||||
: config.get(editing)
|
: config.get(editing)
|
||||||
.replace('{filename}', fileName)
|
.replace('{filename}', fileName)
|
||||||
.replace('{workspace}', checkState
|
.replace('{workspace}', checkState ? workspaceFolder.name : config.get('lowerDetailsNotFound'))
|
||||||
? workspaceFolder.name
|
|
||||||
: config.get('lowerDetailsNotFound'))
|
|
||||||
: config.get(idling);
|
: config.get(idling);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue