coc-discord-rpc icon indicating copy to clipboard operation
coc-discord-rpc copied to clipboard

Wiki for configuration variables uses wrong values

Open whisperity opened this issue 4 years ago • 3 comments

Unfortunately the Wiki cannot be pull requested against, so I have to just detail the issues and can't submit a fix.

  • [x] The Wiki page shows that {appname} and {appversion} will get replaced with the Vim flavour, however, the code searches for {app_name} and {app_version} instead.
  • [x] The code contains searches for {empty}, while the documentation mentions {null}.
  • [x] It seems that largeImageIdle is no longer used, but the documentation still mentions it.
  • [ ] #54

In addition, Discord has potentially changed the API and added an assertion which I can't find in the plugin's code. If you set largeImage to be just {lang} (or any flavour thereof) and you work on a C file, the RPC call sends large_image: "C" to which Discord replies

"child "activity" fails because [child "assets" fails because [child "large_text" fails because ["large_text" length must be at least 2 characters long]]]"

This message is visible both in Vim and in the Discord binary's console, so it is a rejection on Discord's end.

whisperity avatar Aug 27 '21 17:08 whisperity

Refer task 4, I don't think there is anything I can do at the code level, I think it is up to the user of the extension to configure it properly. Otherwise, I've resolved all reported issues.

leonardssh avatar Aug 31 '21 19:08 leonardssh

@LeonardSSH Your "fake space" character works to trick Discord into considering the string to be longer than in reality. But if you think so, it's enough to just mention this to the user :blush:. Or a really kick-ass solution would be to allow the user to define their own "file map" or something where I could assign *.c files to C99 or something. (E.g. assigning .h files to be C++ instead of C...)

"rpc.largeImage": "\u200b\u200b{Lang}"

whisperity avatar Sep 01 '21 09:09 whisperity

Sounds pretty interesting about the file map customization. I think I can do something about that. 😅

leonardssh avatar Sep 01 '21 09:09 leonardssh