GithubHelp home page GithubHelp logo

leonardssh / vscord Goto Github PK

View Code? Open in Web Editor NEW
465.0 5.0 94.0 10.35 MB

๐Ÿ˜Ž Fully customizable VS Code extension to get Discord Rich Presence integration.

Home Page: https://marketplace.visualstudio.com/items?itemName=LeonardSSH.vscord

License: MIT License

TypeScript 100.00%
discord vscode rich presence rich-presence rpc visual-studio-code discord-rpc discord-rich-presence discord-vscode customizable visual-studio vscode-extension

vscord's Introduction

VSCord Logo


Visual Studio Marketplace Version Visual Studio Marketplace Downloads Visual Studio Marketplace Installs Visual Studio Marketplace Rating

Open VSX Version Open VSX Downloads Open VSX Rating

Continuous Integration Gitter Support Chat

Continuous Delivery


VSCord

Highly customizable Discord Rich Presence extension for Visual Studio Code

Remember to ๐ŸŒŸ this GitHub if you ๐Ÿ’– it.

Disclaimer

This extension does not work with snapstore / flatpak version of VSCode, please use the official version from the VSCode website!

๐Ÿ“Œ Features

  • Shows what you're working on!
  • Switch between 3 IDE names (Code, Visual Studio Code and VSCodium) or a custom one if you wish!
  • Packed with 60+ extension settings!
  • Tons of variable to use!
  • Support for over 130+ of the most popular languages!
  • Support custom images (using HTTP link)
  • Support custom button link!
  • Support flatpak / snapstore version of Discord!
  • Detect when you are Debugging!
  • Detect when you are using the Insiders build!
  • Detect when you are Idling!

๐Ÿ‘€ Preview

1 2 3

๐Ÿ“ฅ Installation

Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.

ext install LeonardSSH.vscord

OR

Use the Extension Marketplace

a4

โš™๏ธ Configuration

The following variables will be replaced with the respective value in custom strings.

Variable Value
{app_name} current editor name
{app_id} editor name that's suitable for using inside url
{file_name} name of the file
{file_extension} extension of the file
{file_size} size of the file
{folder_and_file} folder and file name
{relative_file_path} filepath relative to the workspace folder
{directory_name} directory name
{full_directory_name} full directory name
{workspace} name of the workspace
{workspace_folder} name of the workspace folder
{workspace_and_folder} name of the workspace and folder
{lang} | {Lang} | {LANG} format of the lang string (css, Css, CSS)
{problems} problems text defined in settings
{problems_count} number of problems
{problems_count_errors} number of problems that are errors
{problems_count_warnings} number of problems that are warnings
{problems_count_infos} number of problems that are infos
{problems_count_hints} number of problems that are hints
{line_count} number of lines
{current_line} current line
{current_column} current column
{git_url} link to current git repository
{git_owner} current git repository owner
{git_provider} domain (including .com) to the provider of current git repository
{git_repo} repository name for current repository
{git_branch} current git branch
{empty} an empty space

๐Ÿ‘จโ€๐Ÿ’ป Contributing

To contribute to this repository, feel free to create a new fork of the repository and submit a pull request.

  1. Fork / Clone the main branch.
  2. Create a new branch in your fork.
  3. Make your changes.
  4. Commit your changes and push them.
  5. Submit a Pull Request here!

๐Ÿ‘จโ€๐Ÿ’ป Adding a new language

We have a guide for adding a new language here!

๐ŸŽ‰ Thanks

Much of the code in this repository is based on iCrawl/discord-vscode & Satoqz/vscode-discord. This extension would not exist without them.

๐Ÿ“‹ License

This project is licensed under the MIT License - see the LICENSE file for details.

vscord's People

Contributors

birdlinux avatar cathaypacific8747 avatar espenja avatar eutropios avatar ewen-lbh avatar hqnna avatar itspi3141 avatar jerse1 avatar jsostmann avatar justsxm avatar leonardssh avatar lynxx007 avatar malix-off avatar marioparaschiv avatar max-programming avatar miguelndecarvalho avatar mopsgamer avatar nick22985 avatar nix6839 avatar ptrichr avatar pungrumpy avatar r-unic avatar robloxiandemo avatar sominemo avatar spotandjake avatar sylvester-roos avatar thedevconnor avatar timtechdev avatar xhayper avatar yuno2k23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vscord's Issues

WSL - Remote Support

I'm using WSL - Remote extension for coding in Windows environment but vscord doesn't support it, so presence doesn't work properly when I open the file. It shows the status as idle.
image
image

Running in debug Cannot use import statement outside a module.

I am getting this error when trying to run the plugin in debug mode in vscode. I am compiling and using npm run watch am i doing something dumb?

Activating extension 'vscord-extension.vscord' failed: Cannot use import statement outside a module.

Customize message / Hide project

Nice extension! I rather not have project to be visible on Discord but file name is OK. Is there a way to hide workspace/project name from the playing msg?

Timestamp

Can i activate the timestamp using the vscode command?

Git branch string

Could a string token be added for showing the current git branch?

Elapsed time resets after exceeding 24 hours

Hey,

I noticed that when the "elapsed time" exceeds the value of 24 hours, the elapsed time "resets".

What do I mean exactly?

If I was programming for 25 hours, it shows on the discord that I was programming only for 1 hour.
The expected result would be for example "elapsed: 1 day" or ideally just "elapsed: 25:00:00"

I have looked at the code of this extension but I didn't see anything that could cause this bug.

Cheers!

Ignored Workspaces displaying

To reacreate this you just need to make a file inside a ignored folder without saving it to the working directory. This is also the case if opening a external file in current working directory. I think this is because it checks the current directory of a file and not the vscode workspace directory maybe. (I have not looked at the code just assuming this).

When doing this it will show In (workspace Name) Working on untitled-1. When it should not say the workspace name.

Github Repo TypeError: Cannot read property 'repository' of undefined

When switching to another git repo in the same workspace it will cause this error.

stack trace: TypeError: Cannot read property 'name' of undefined
    at details (/HDD/1TBSSD/projects/Personal/vscord/src/activity.ts:142:50)
    at activity (/HDD/1TBSSD/projects/Personal/vscord/src/activity.ts:39:1)
    at sendActivity (/HDD/1TBSSD/projects/Personal/vscord/src/extension.ts:17:27)
    at /HDD/1TBSSD/projects/Personal/vscord/src/listener.ts:16:244
    at u.fire (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:66:1712)
    at Data.updateGit (/HDD/1TBSSD/projects/Personal/vscord/src/data.ts:189:1)
    at /HDD/1TBSSD/projects/Personal/vscord/src/data.ts:169:1
    at /opt/visual-studio-code/resources/app/extensions/git/dist/main.js:2:1045061
    at u.fire (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:66:1712)
    at m.open (/opt/visual-studio-code/resources/app/extensions/git/dist/main.js:2:991145)
    at m.openRepository (/opt/visual-studio-code/resources/app/extensions/git/dist/main.js:2:989724)
    at i (/opt/visual-studio-code/resources/app/extensions/git/dist/main.js:2:943438)
    at /opt/visual-studio-code/resources/app/extensions/git/dist/main.js:2:989054
    at async Promise.all (index 0)
    at m.onDidChangeVisibleTextEditors (/opt/visual-studio-code/resources/app/extensions/git/dist/main.js:2:988953)

Possibly something to do with a variable not being set when it detects a git repo switch

Request: Could you make version 3.2.3 avaliable to install from the marketplace again?

I dislike the changes made in version 4.0.0, as for me at least it has the bugs of the bottom idle message not showing, and it updates the rich presence far more slowly. I had to format my system and was going to install that version again; but apparently it is gone from the marketplace? I could try building it from source but i have no idea how to tbh, i tried running the build but it always gives me errors

Edit: apparently it seems the bottom message not showing issue is solved / being solved - however i still dislike the newer version's slower responsiveness when updating user status

Always reporting Idling

When I did a check on what the extension is showing on Discord, it always says "Idling", no matter what I do.

I am working with Python in a folder that also is a git repo.

Please publish your extension to the Open VSX registry

Publishing your extension to this registry would open up the extension to many more users.

a) Many Linux builds use the Open VSX registry (https://wiki.archlinux.org/title/Visual_Studio_Code#No_extensions_found)

The packages are configured to use the Open VSX registry instead of the Microsoft one. This explains why some extensions are missing from the vscode explorer while they appear to be listed online.

b) VSCodium support

According to the VS Code Marketplace Terms of Use, you may only install and use Marketplace Offerings with Visual Studio Products and Services. For this reason, VSCodium uses open-vsx.org, an open source registry for VS Code extensions.

Please consider this ๐Ÿ™

View Repository button doesn't show up

I think the title is enough... The "View Repository" button doesn't show up on my discord.
Here is what shows:
image
No button below that. IDK what's the issue, the project is a git repository, and there also exists a remote named origin

One more suspicious thing is that i cannot find any settings named rpc.buttonEnabled in my settings.json, neither such a setting exists in the settings tab. Although this setting's value is set to True by default, still there is no affect. My VSCode is also of the latest version.

RPC not starting & showing in discord

Every time i try starting the rpc by pressing F1 and typing "Discord Rich Presence: Enable Discord Presence in the current workspace" it gives me this error, and nothing is showing up in my discord activity

image

Doesnt work on Ubuntu 20.04

hello, after i installed the extension, it doesnt seem to work on discord with linux, i tried re-opening vs code while discord is running but the issue still persists infact there is no "smiley face" or notification at the status bar that shows the extension.

The variable {currentline} shows: 1

The variable {currentline} shows the value: 1 instead of the current line in which I am editing, this happens with all the files that I have been able to test: .JS - .HTML - .JSON and .MD

Example:

File: test.js
Editing: Line 5

image

Discord Rich Presence showing "Line: {currentline}" = "Line: 1"

image

Settings:

image

Error with rpc

Hi, i have problem with rpc every time i open vsc it don't start,to fix it i reinstall this excention

Extension throws an exception when used in cdr/code-server

Here's the exception:

[2021-11-18 20:55:03.124] [exthost] [info] ExtensionService#_doActivateExtension vscord-extension.vscord {"startup":false,"extensionId":{"value":"vscord-extension.vscord","_lower":"vscord-extension.vscord"},"activationEvent":"onStartupFinished"}
[2021-11-18 20:55:03.124] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/quentincaffeino/.local/share/code-server/extensions/vscord-extension.vscord-4.1.6/dist/extension.js
[2021-11-18 20:55:03.434] [exthost] [error] Activating extension vscord-extension.vscord failed due to an error:
[2021-11-18 20:55:03.435] [exthost] [error] TypeError: Cannot read property 'write' of null
	at IPCTransport.send (/home/quentincaffeino/.local/share/code-server/extensions/vscord-extension.vscord-4.1.6/dist/extension.js:2107:17)
	at /home/quentincaffeino/.local/share/code-server/extensions/vscord-extension.vscord-4.1.6/dist/extension.js:2113:12
	at new Promise (<anonymous>)
	at IPCTransport.close (/home/quentincaffeino/.local/share/code-server/extensions/vscord-extension.vscord-4.1.6/dist/extension.js:2111:12)
	at RPCClient.destroy (/home/quentincaffeino/.local/share/code-server/extensions/vscord-extension.vscord-4.1.6/dist/extension.js:1710:26)
	at login (/home/quentincaffeino/.local/share/code-server/extensions/vscord-extension.vscord-4.1.6/dist/extension.js:368:19)
	at runMicrotasks (<anonymous>)
	at processTicksAndRejections (internal/process/task_queues.js:95:5)
	at async activate (/home/quentincaffeino/.local/share/code-server/extensions/vscord-extension.vscord-4.1.6/dist/extension.js:460:9)
	at async Promise.all (index 0)

package.json

Screen Shot 2022-02-04 at 21 02 18

Currently the file is shown as a JSON, but i suggest making it a npm icon. Couldnโ€™t seem to get it to work but it shouldnโ€™t be a biggy

Tag {fulldirname} seems to be not working properly

Hey there, I've been trying to display the full path to the current file I am editing, say foo\bar\file.go, and thought {fulldirname} would do exactly that. However, when I use it as In {fulldirname} for any upper detail, it will only display foo\, where foo is my workspace, as opposed to the expected result

In foo\bar

When there is something that I am missing, please point that out to me, and I will close this issue. I got it closely working with In {fulldirname}{dirname}, however that quickly ceases to work when we have a path like foo\bar\assets\web.html and will display instead

In foo\assets

If need be, I can send screenshots as well.

[Language Request] Odin

Was looking at your extension as it seems iCrawl's extension hasn't been receiving updates besides dependabot dependency upgrades, a bit ago on theirs i requested a language, specifically Odin to be added, but it was never looked into, assuming this extension is more updated is it possible this could be added?

Shows idling

Issue Type: Bug

I am editing a app.js file but back at discord it still says I am idling

Extension version: 3.2.3
VS Code version: Code 1.56.2 (054a9295330880ed74ceaedda236253b4f39a335, 2021-05-12T17:13:13.157Z)
OS version: Windows_NT x64 10.0.19042

System Info
Item Value
CPUs Intel(R) Core(TM) i3-2330M CPU @ 2.20GHz (4 x 2195)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: unavailable_off
opengl: enabled_on
rasterization: unavailable_off
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: unavailable_off
Load (avg) undefined
Memory (System) 2.91GB (0.44GB free)
Process Argv --crash-reporter-id ccb62c63-0c11-4f1b-9db0-cbd3c312a867
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspyt653:30270858
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
vspre833cf:30267465
pythonptprofiler:30281270
vshan820:30294714
vscoreces:30290705
pythondataviewer:30285071
vscus158cf:30286554
vscgsv2ct:30301613
vscorehov:30302759
bridgeflight:30302069
vscod805:30301674

Disable notification that Discord couldn't be connected

I like this extension but I tend to often switch projects in vscode while Discord is not open. This results in the following error notification:

Couldn't connect to Discord via RPC: Error: Could not connect

I can easily check the status of this extension in the status bar, if I want to know whether it is connected or not. Having this notification pop up all the time is quite annoying.

Would it be possible to have a toggle in the settings to turn this notification off?

Icon for .moon extension

Hey!
I often code MoonScript, and I was wondering if you could add icons for it to RPC?
Currently how it looks:
image

It would be amazing if you added it.

Requests

  • Setting to remove details/lower details stuff #30
  • ButtonEnabled disabled by default #28
  • Git branch support #35
  • Support for Remote SSH & WSL #26

Git Ignore Repo / Git Ignore Org / Replace workplace

  • Add the ability to have a exluded repos from displaying. Have it so if the repo matches the ignored list then have it not display on the button
  • Add the ability to exlude git repo orginastions from displaying a link to the git repo
  • Add the ability instead of completly not starting the extension when a ignored list is started make it so that you can put some other text in replace of the data that you do not want to say. Example if it is the project u could change it to say [Redacted] or something like that so people can still see that you are coding just cant see what u are coding.

Not connecting to gateway

[7:35:31 p.m. - INFO] [data.ts] ext(): Git extension is active
[7:35:31 p.m. - INFO] Initialize the extension...
[7:35:31 p.m. - ERROR] Could not connect
[7:35:31 p.m. - ERROR] Error: Could not connect
at Socket.onerror (c:\Users\ronni.vscode\extensions\leonardssh.vscord-4.4.0\node_modules\discord-rpc\src\transports\ipc.js:32:1)
at Object.onceWrapper (events.js:422:26)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

Support For TSX Files

It would be great if you add TSX support,
Whenever I open a TSX file, it shows like this

img

Command not found.

When i want reconnect to Discord Gateway, i get "Command 'Discord Rich Presence: Reconnect Discord Presence to Discord Gateway' resulted in an error (command 'rpc.reconnect' not found)" error. And all commands are like that.

OS: MacOS Monterey 12.2
Vscode Version: 1.63.2

Reconnect/Disconnect discord presence from command palette throws exception

Command Palette

Error Received

I receive an error saying:

Command 'Discord Rich Presence: Reconnect Discord Presence to Gateway' resulted in an error (Cannot read property 'write' of null)

Every time i try to reconnect presence from the command palette. The same error happens when disconnecting presence. Tried reinstalling the extension, still getting the errors

[Request] Please add an option to hide the Could not connect error

Hi

I don't always have Discord open or running, so I keep getting this notification

Shot 2021-07-14 at 10-55-39@2x

Would you mind adding an option to hide or ignore it? I don't mind if the extension can't connect to discord, as I'm aware it's not running, but the notification is a bit annoying.

Thanks in advance

Should language be more important then file extension?

Hey,

For example when I am messing with ansible, name of the file main.yml the plugin will show that I'm editing a YAML file instead of Ansible file. But the language of the file is Ansible. Is is possible to give priority to the Language?

Thanks,
MiguelNdeCarvalho

Memory Leak

Their appears to be a minor memory leak.
image

After disabling & reloading:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.