Allow the language key to be added to the largeImage (#39)

Naming for the params can be changed, but as it currently stands, it represents
the language extension
This commit is contained in:
Frangu Vlad 2018-02-04 18:06:42 +02:00 committed by Crawl
parent 06be6e722d
commit e83619ae37
2 changed files with 3 additions and 3 deletions

View file

@ -91,8 +91,8 @@
},
"discord.largeImage": {
"type": "string",
"default": "",
"description": "Custom string for the largeImageText section of the rich presence"
"default": "Editing a {LANG} file",
"description": "Custom string for the largeImageText section of the rich presence.\n\t- '{lang}' will be replaced with the lowercased language ID\n\t- '{LANG}' will be replaced with the uppercased language ID"
},
"discord.largeImageIdle": {
"type": "string",

View file

@ -245,7 +245,7 @@ function setActivity(workspaceElapsedTime: boolean = false): void {
|| largeImageKey
: 'txt',
largeImageText: window.activeTextEditor
? config.get('largeImage')
? config.get('largeImage').replace('{lang}', largeImageKey.image || largeImageKey).replace('{LANG}', largeImageKey.image.toUpperCase() || largeImageKey.toUpperCase())
|| window.activeTextEditor.document.languageId.padEnd(2, '\u200b')
: config.get('largeImageIdle'),
smallImageKey: debug.activeDebugSession