diff --git a/assets/icon.png b/assets/icon.png new file mode 100644 index 0000000..4609e5e Binary files /dev/null and b/assets/icon.png differ diff --git a/package.json b/package.json index 26411a7..f3a2bee 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,46 @@ "activationEvents": [ "*" ], + "contributes": { + "configuration": [ + { + "title": "Visual Studio Code Discord Configuration", + "type": "object", + "properties": { + "discord.clientID": { + "type": "string", + "default": "383226320970055681", + "description": "Only modify this if you know what you are doing (most of you don't)." + } + } + } + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/iCrawl/discord-vscode.git" + }, + "bugs": { + "url": "https://github.com/iCrawl/discord-vscode/issues" + }, + "keywords": [ + "discord", + "vscode", + "status", + "update", + "rich", + "presence", + "rpc", + "rich presence" + ], + "categories": [ + "Other" + ], + "homepage": "https://github.com/iCrawl/discord-vscode#readme", + "icon": "assets/icon.png", + "galleryBanner": { + "theme": "dark" + }, "dependencies": { "discord-rpc": "^3.0.0-beta.2" }, diff --git a/src/extension.ts b/src/extension.ts index 123cd3a..105085c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,17 +1,16 @@ import { Client } from 'discord-rpc'; import { basename, extname } from 'path'; -import { ExtensionContext, commands, window, workspace, Uri, TextDocumentChangeEvent } from 'vscode'; +import { ExtensionContext, commands, window, workspace, Uri, TextDocumentChangeEvent, TextDocument } from 'vscode'; export function activate(context: ExtensionContext) { const rpc = new Client({ transport: 'ipc' }); + const config = workspace.getConfiguration('discord'); rpc.once('ready', () => { setActivity(rpc); - workspace.onDidChangeTextDocument((e: TextDocumentChangeEvent) => { - setActivity(rpc); - }); + workspace.onDidChangeTextDocument((e: TextDocumentChangeEvent) => setActivity(rpc)); }); - rpc.login('').catch(error => + rpc.login(config.get('clientID')).catch(error => window.showErrorMessage(`Could not connect to discord via rpc: ${error.message}`) ); }