如何知道我当前正在/或编辑的文件,在VSCODE扩展中?

发布于 2025-02-09 00:48:42 字数 341 浏览 2 评论 0原文

我正在尝试将所有内容都在这里建立一个个人网站,但是我不知道这个网站,我想让网站知道我在VS-Code中查看的文件,与Discord相同RichPrecence扩展,但是当我尝试阅读他们的代码时,只是全部争夺

“在此处输入图像说明”

扩展名看起来像这样^^^,我只想知道他们如何完成“编辑[file] .js”和“工作区:[名称]”

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]"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

强辩 2025-02-16 00:48:42

Discord Rich Scormention扩展的代码为开源,因此您可以自己查找。

另外,您可以读取 vscode api docs ,您可能正在寻找类似的东西activeTexteditor您可以从中获得具有filename字符串属性的textDocument属性。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文