diff --git a/CHANGELOG.md b/CHANGELOG.md index c7db54a..d23708e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,4 +12,12 @@ Rewritten Discord Register * Removed Discord Registers for other Os than Windows. * Added python support -* Added a VSCode disposable client, to let the Rich Presence reset when the process quit. \ No newline at end of file +* Added a VSCode disposable client, to let the Rich Presence reset when the process quit. + +## 1.0.0 + +* First realease + +* Removed Registry + +* Added a new option: show debug diff --git a/README.md b/README.md index c84e0e2..603a12e 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,16 @@ * Strings entirely modifiable +* Removed registery writing + ## Requirements * Discord client +## Can I get banned + +Well, [someone already asked for it](https://github.com/maxerbox/vscode-discord/issues/3). I emailed the Discord Team, and that's totally fine, until your respect the discord conditions. + ## Install * Install the extension. The extension needs discord to be launched @@ -30,6 +36,8 @@ This extension contributes the following settings: * `discord.enable`: enable/disable this extension +* `discord.showDebug`: Show the debugging icon in the rich presence when debugging +* `discord.debugIconText`: The small image debug text when debugging * `discord.clientID`: the client ID used by discord-rpc * `discord.state`: The dicord rich presence state. Default to `Working on {projectName}`. `{projectName}`:workspace name * `discord.details`: The discord rpc details. Default to `Editing {filename}`. {filename}: filename, {language} : language id. @@ -65,4 +73,12 @@ Rewritten Discord Register * Added python support * Added a VSCode disposable client, to let the Rich Presence reset when the process quit. +## 1.0.0 + +* First realease + +* Removed Registry + +* Added a new option: show debug + ----------------------------------------------------------------------------------------------------------- diff --git a/extension.js b/extension.js index 9489422..c348a67 100644 --- a/extension.js +++ b/extension.js @@ -4,14 +4,14 @@ const vscode = require('vscode') const {basename, extname} = require('path') const DisposableClient = require('./lib/DisposableClient') const format = require('string-template') -const DiscordRegisterWin = require('./lib/DiscordRegisterWindows') +// const DiscordRegisterWin = require('./lib/DiscordRegisterWindows') var configuration var client var isReady = false var lastFileEditing = '' var startTimestamp var contextSave -const VSCODE_PATH = process.execPath +// const VSCODE_PATH = process.execPath // this method is called when your extension is activated // your extension is activated the very first time the command is executed function activate (context) { @@ -20,12 +20,13 @@ function activate (context) { console.log(process.version) context.subscriptions.push(vscode.commands.registerCommand('discord.updatePresence', updatePresence), vscode.commands.registerCommand('discord.enable', enable), vscode.commands.registerCommand('discord.disable', disable)) if (!configuration.enable) return - if (process.platform === 'win32') { + /* if (process.platform === 'win32') { var discordRegister = new DiscordRegisterWin(configuration.clientID, VSCODE_PATH) discordRegister.register().then(function () { startClient() }).catch(err => vscode.window.showErrorMessage('vscode discord registering error: ' + err.message)) - } else startClient() + } else */ + startClient() } function startClient () { client = new DisposableClient({ transport: 'ipc' }) @@ -34,10 +35,6 @@ function startClient () { // This line of code will only be executed once when your extension is activated client.on('ready', () => { isReady = true - vscode.workspace.onDidChangeTextDocument = updatePresence - vscode.workspace.onDidCloseTextDocument = function () { - console.log('closed') - } console.log('Discord-rpc ready') updatePresence() setInterval(updatePresence, configuration.interval) @@ -69,9 +66,10 @@ exports.deactivate = deactivate function updatePresence () { if (!isReady) return if (!vscode.workspace.getConfiguration('discord').get('enable', true)) return + var debugShow = vscode.debug.activeDebugSession && configuration.showDebug var activityObject = { - smallImageKey: 'vscode', - smallImageText: configuration.vscodeIconText + smallImageKey: debugShow ? 'debug' : 'vscode', + smallImageText: debugShow ? configuration.debugIconText : configuration.vscodeIconText } if (vscode.workspace.name) activityObject.state = format(configuration.state, {projectName: vscode.workspace.name}) if (vscode.window.activeTextEditor) { diff --git a/package.json b/package.json index 9ac3bff..0ff7443 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-discord", "displayName": "vscode-discord", "description": "Display your current project on vscode in discord with Rich Presence", - "version": "0.0.3", + "version": "1.0.0", "publisher": "maxerbox", "engines": { "vscode": "^1.18.0" @@ -52,6 +52,16 @@ "default": true, "description": "Enable vscode-discord" }, + "discord.showDebug": { + "type": "boolean", + "default": true, + "description": "Show the debugging icon in the rich presence when debugging" + }, + "discord.debugIconText": { + "type": "string", + "default": "Debugging", + "description": "The small image debug text when debugging" + }, "discord.details": { "type": "string", "default": "Editing {filename}",