vscode.workspace.getConfiguration(' languajeid')。update(prediedades' ,,

发布于 2025-02-12 05:13:40 字数 334 浏览 3 评论 0原文

我有超过2周的时间试图弄清楚如何从VSCODE API中更改我的设置值,但没有结果。

它开始变得非常沮丧,因为Vscode API并未得到充分记录,在Internet上,我发现的示例并非没有用。

我正在创建VSCODE语言扩展名,但是我要做的是从扩展名中。JS将我的语言配置设置的字符串值更改为另一个字符串值。

这是我使用的代码支持工作但不做:vscode.workspace.getConfiguration('languajeid')。update('pripiedades','stringval',true,true,true);>

I have more than 2 weeks trying to figure out how can I change my setting value from VSCode API but without a result.

It is started getting quite frustrated, because the VSCode API is not greatly documented, and on the internet not of the example I find doesn't work.

I am creating a VSCode language extension, but what I want to do is from the extension.js change the string value of my language configuration setting to another string value.

This is the code I am using that is support to work but doesn't: vscode.workspace.getConfiguration('languajeID').update('propiedades','stringVal', true, true);

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

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

发布评论

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

评论(1

傲影 2025-02-19 05:13:40

这是我解决这个问题的解决方案。我忘记了将其发布。

因此,通过使用extension.js文件中的变量,将VSCODE配置属性值更改为另一个值。

vscode.workspace.getConfiguration().update("extantionName-property.propertyName", variableName.toString(), vscode.ConfigurationTarget.Global);

ExtantionName-property.propertyname:它是您在配置面板中已将其声明时已经给它的名称
package.json文件。

variablename:它是您在extention.js文件中声明的变量的名称,该文件具有您希望在属性上的值为
分配。

我希望这可以帮助任何有示例音乐会的人,因为我想要我进行VSCODE扩展。

Here is my solution for this problem that I had. I forget to post it.

So, to change a VSCode configuration property value to another value by using a variable in your extension.js file here is how it should be done:

vscode.workspace.getConfiguration().update("extantionName-property.propertyName", variableName.toString(), vscode.ConfigurationTarget.Global);

extantionName-property.propertyName: It is the name you already gave to your configuration panel when you declared it in your
package.json file.

variableName: It is the name of the variable you declared in your extention.js file, which has the value you want on your property to be
assigned.

I hope this can help anyone who has the sample concert as I did want I was making my VSCode extension.

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