如何知道我当前正在/或编辑的文件,在VSCODE扩展中?
我正在尝试将所有内容都在这里建立一个个人网站,但是我不知道这个网站,我想让网站知道我在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
The extension looks like this ^^^, I just want to know how they did the "Editing [file].js" and "Workspace: [name]"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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 getTextDocument
property which have afileName
string property.