From e83619ae37c5442387a787e3dbd41374b6b39eec Mon Sep 17 00:00:00 2001 From: Frangu Vlad Date: Sun, 4 Feb 2018 18:06:42 +0200 Subject: [PATCH] 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 --- package.json | 4 ++-- src/extension.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f582bee..fa298d2 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/extension.ts b/src/extension.ts index e23be66..5249a40 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -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