随风逐叶 随风逐叶
首页
  • Quick Reference (opens new window)
  • EgretEngine开发者文档 (opens new window)
  • TinaX框架
  • SSH教程
  • VSCode插件开发
关于
  • 分类
  • 标签
  • 归档

rontian

从事游戏开发10多年的老菜鸟一枚!
首页
  • Quick Reference (opens new window)
  • EgretEngine开发者文档 (opens new window)
  • TinaX框架
  • SSH教程
  • VSCode插件开发
关于
  • 分类
  • 标签
  • 归档
  • 环境配置
  • 脚手架
  • 启动与调试插件

  • Command配置

  • 发布

  • snippets
  • 插件配置

    • 插件配置
    • 默认配置
    • 配置修改
  • 常见编辑器API

  • 参考文章

默认配置

# 默认配置

很多插件是需要一些额外配置才能工作的,设置默认配置同样在package.json里:

"contributes": {
  "configuration": { // 默认配置
    "type": "object",
    "title": "",
    "required": [
      "sid"
    ],
    "properties": {
      "includes": {
        "type": "Array",
        "default": [
          "json"
        ],
        "description": "文件类型过滤器"
      }
    }
  },
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

默认配置是json schema格式,在覆盖默认配置时如果校验出错会有提示。

插件中使用getConfiguration来读取配置:

function getConfig() {
  const config = vscode.workspace.getConfiguration();
  const includes: string[] | undefined = config.get('includes'); // 获取指定配置项

  return {
    includes: includes || [],
  };
}
1
2
3
4
5
6
7
8
上次更新: 2023/10/17, 16:50:29 访问次数: 0
插件配置
配置修改

← 插件配置 配置修改→

最近更新
01
一些Shell常用的功能写法整理
10-20
02
删除git仓库submodule的步骤
10-20
03
django基本命令
10-16
更多文章>
Copyright © 2017-2025 随风逐叶
沪ICP备18008791号-1 | 沪公网安备31011502401077号

网站访问总次数: 0次
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式