-1

I am trying to make a personal website where all of my things are in, but I can't figure out this one, I want to let the website know what file I am looking at in vs-code, It's the same as the Discord RichPrecence extensions, but when I try to read their codes, It's just all scrambled

enter image description here

The extension looks like this ^^^, I just want to know how they did the "Editing [file].js" and "Workspace: [name]"

  • where is this image taken, id this a Webview Panel? You can get the name of the workspace from the `Workspace` object, name of editor from `activeEditor` or let VSC search for workspace editor document belongs to `getWorkspaceFolder` you get an URI – rioV8 Jun 20 '22 at 19:57
  • Thank you for your answers but I've got another problem.... https://stackoverflow.com/questions/72697148/error-installing-vscode-d-ts-error-request-returned-status-code-404 –  Jun 21 '22 at 08:03

1 Answers1

0

The code of discord rich presence extension is open source so you can look it up yourself.

Alternatively you can read the vscode API docs, you are probably looking for something like activeTextEditor from which you can get TextDocument property which have a fileName string property.

Grekkq
  • 679
  • 6
  • 14