Skip to content
On this page
字数:3.4k 字
预计:20 分钟
阅读量:

如何给Tree添加上折叠功能

作者:winches
更新于:4 个月前

showCollapseAll 设置为 true 即可。

ts
vscode.window.createTreeView('mixinsTree', { treeDataProvider: mixinsTreeProvider, showCollapseAll: true })

获取当前页面的outline数据

ts
await commands.executeCommand<DocumentSymbol[]>('vscode.executeDocumentSymbolProvider', textDocument.uri)

获取文本

ts
const wordRange = document.getWordRangeAtPosition(position) // 获取单词范围
const word = document.getText(wordRange) // 根据范围获取文本
const lineText = document.lineAt(position.line).text // 获取行文本

弹出选择框

ts
const result = await window.showQuickPick(['1', '2', '3'], { placeHolder: '请选择' })

为终端发送命令

ts
window.activeTerminal?.sendText('echo hello')

个人的settings

json
{
  "emmet.includeLanguages": {
    "javascript": "javascriptreact"
  },
  "workbench.colorTheme": "One Dark Pro Darker",
  "breadcrumbs.enabled": false,
  "editor.renderWhitespace": "none",
  "vscode-edge-devtools.fallbackRevision": "@a41122be052fe9616f0def5fe6842fa942930d46",
  "vscode-edge-devtools.webhint": false,
  "liveServer.settings.donotShowInfoMsg": true,
  "editor.fontSize": 14,
  "security.workspace.trust.untrustedFiles": "open",
  "editor.tabSize": 2,
  "workbench.tree.indent": 18,
  "marquee.configuration.proxy": "",
  "marquee.configuration.workspaceLaunch": false,
  "marquee.widgets.projects.workspaceFilter": "",
  "marquee.widgets.projects.openProjectInNewWindow": false,
  "marquee.widgets.github.language": "",
  "marquee.widgets.github.spoken": "",
  "marquee.widgets.github.trendFilter": "",
  "marquee.widgets.weather.city": "",
  "marquee.widgets.todo.todoFilter": "",
  "marquee.widgets.todo.hide": false,
  "marquee.widgets.todo.showArchived": false,
  "marquee.configuration.modes": {
    "default": {
      "layouts": {
        "lg": [
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 12,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 4,
            "y": 12,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 8,
            "y": 12,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 8,
            "y": 0,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 4,
            "y": 0,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 13,
            "x": 0,
            "y": 24,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 13,
            "x": 6,
            "y": 24,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          }
        ],
        "md": [
          {
            "minW": 2,
            "minH": 6,
            "w": 3,
            "h": 12,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 12,
            "x": 6,
            "y": 12,
            "i": "todo",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 3,
            "h": 12,
            "x": 7,
            "y": 0,
            "i": "weather",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 3,
            "h": 12,
            "x": 3,
            "y": 12,
            "i": "github",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 3,
            "h": 12,
            "x": 0,
            "y": 12,
            "i": "news",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 5,
            "h": 13,
            "x": 0,
            "y": 24,
            "i": "snippets",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 5,
            "h": 13,
            "x": 5,
            "y": 24,
            "i": "notes",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 12,
            "x": 3,
            "y": 0,
            "i": "projects",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "markdown"
          }
        ],
        "sm": [
          {
            "w": 3,
            "h": 12,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 12,
            "x": 0,
            "y": 12,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 12,
            "x": 0,
            "y": 24,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 12,
            "x": 3,
            "y": 24,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 12,
            "x": 3,
            "y": 12,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 12,
            "x": 3,
            "y": 0,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 13,
            "x": 0,
            "y": 36,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 13,
            "x": 0,
            "y": 49,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "markdown"
          }
        ],
        "xs": [
          {
            "minW": 2,
            "minH": 6,
            "w": 2,
            "h": 11,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 23,
            "i": "todo",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 2,
            "h": 11,
            "x": 2,
            "y": 0,
            "i": "weather",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 74,
            "i": "github",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 61,
            "i": "news",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 35,
            "i": "snippets",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 48,
            "i": "notes",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 11,
            "i": "projects",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "markdown"
          }
        ],
        "xxs": [
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 11,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 35,
            "i": "todo",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 11,
            "i": "weather",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 86,
            "i": "github",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 73,
            "i": "news",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 47,
            "i": "snippets",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 60,
            "i": "notes",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 23,
            "i": "projects",
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "markdown"
          }
        ]
      },
      "widgets": {
        "news": true,
        "github": true,
        "todo": true,
        "weather": true,
        "notes": true,
        "welcome": true,
        "snippets": true,
        "projects": true
      }
    },
    "play": {
      "layouts": {
        "sm": [
          {
            "w": 3,
            "h": 12,
            "x": 3,
            "y": 11,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 12,
            "x": 0,
            "y": 11,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 36,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 11,
            "x": 3,
            "y": 0,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 13,
            "x": 0,
            "y": 23,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 11,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 3,
            "minH": 9,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 48,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 60,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "markdown"
          }
        ],
        "xs": [
          {
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 37,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 24,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 62,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 11,
            "x": 0,
            "y": 13,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 50,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 3,
            "minH": 9,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 74,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 86,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "markdown"
          }
        ],
        "md": [
          {
            "w": 5,
            "h": 14,
            "x": 5,
            "y": 12,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 5,
            "h": 14,
            "x": 0,
            "y": 12,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 37,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 5,
            "h": 12,
            "x": 5,
            "y": 0,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 10,
            "h": 11,
            "x": 0,
            "y": 26,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 5,
            "h": 12,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 3,
            "minH": 9,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 49,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 61,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "markdown"
          }
        ],
        "lg": [
          {
            "w": 3,
            "h": 15,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 3,
            "minH": 9,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 14,
            "x": 6,
            "y": 0,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 14,
            "x": 0,
            "y": 15,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 15,
            "x": 3,
            "y": 0,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "todo"
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "projects"
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "snippets"
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "notes"
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "markdown"
          }
        ],
        "xxs": [
          {
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 37,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 24,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 62,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 11,
            "x": 0,
            "y": 13,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 50,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 3,
            "minH": 9,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 74,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 86,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "minW": 2,
            "minH": 6,
            "static": false,
            "moved": false,
            "x": 0,
            "y": 0,
            "h": 12,
            "w": 4,
            "i": "markdown"
          }
        ]
      },
      "widgets": {
        "news": true,
        "github": true,
        "todo": false,
        "weather": true,
        "notes": false,
        "welcome": true,
        "snippets": false,
        "projects": false
      },
      "icon": {
        "id": "beach_with_umbrella",
        "name": "Beach with Umbrella",
        "short_names": ["beach_with_umbrella"],
        "colons": ":beach_with_umbrella:",
        "unified": "1f3d6-fe0f"
      }
    },
    "work": {
      "layouts": {
        "sm": [
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 47,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 59,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 11,
            "x": 3,
            "y": 0,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 71,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 11,
            "x": 0,
            "y": 36,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 11,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 3,
            "minH": 9,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 13,
            "x": 0,
            "y": 23,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 12,
            "x": 0,
            "y": 11,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          }
        ],
        "xs": [
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 60,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 72,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 25,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 84,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 11,
            "x": 0,
            "y": 49,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 3,
            "minH": 9,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 37,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 13,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          }
        ],
        "md": [
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 26,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 38,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 12,
            "x": 3,
            "y": 0,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 50,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 5,
            "h": 14,
            "x": 5,
            "y": 12,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 3,
            "h": 12,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 3,
            "minH": 9,
            "moved": false,
            "static": false
          },
          {
            "w": 5,
            "h": 14,
            "x": 0,
            "y": 12,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 6,
            "y": 0,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          }
        ],
        "lg": [
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 28,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 40,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 13,
            "x": 8,
            "y": 0,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 52,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 15,
            "x": 6,
            "y": 13,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 3,
            "minH": 9,
            "moved": false,
            "static": false
          },
          {
            "w": 6,
            "h": 15,
            "x": 0,
            "y": 13,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 13,
            "x": 4,
            "y": 0,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          }
        ],
        "xxs": [
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 60,
            "i": "news",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 72,
            "i": "github",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 25,
            "i": "todo",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 84,
            "i": "weather",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 11,
            "x": 0,
            "y": 49,
            "i": "notes",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 13,
            "x": 0,
            "y": 0,
            "i": "welcome",
            "minW": 3,
            "minH": 9,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 37,
            "i": "snippets",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          },
          {
            "w": 4,
            "h": 12,
            "x": 0,
            "y": 13,
            "i": "projects",
            "minW": 2,
            "minH": 6,
            "moved": false,
            "static": false
          }
        ]
      },
      "widgets": {
        "news": false,
        "github": false,
        "todo": true,
        "weather": false,
        "notes": true,
        "welcome": true,
        "snippets": true,
        "projects": true
      },
      "icon": {
        "id": "briefcase",
        "name": "Briefcase",
        "short_names": ["briefcase"],
        "colons": ":briefcase:",
        "unified": "1f4bc"
      }
    }
  },
  "editor.unicodeHighlight.allowedLocales": {
    "zh-hant": true
  },
  "workbench.editor.splitInGroupLayout": "vertical",
  "editor.guides.bracketPairs": true,
  "workbench.editorAssociations": {
    "*.html": "default"
  },
  "auto-close-tag.activationOnLanguage": [
    "xml",
    "php",
    "blade",
    "ejs",
    "jinja",
    "javascript",
    "javascriptreact",
    "typescriptreact",
    "plaintext",
    "markdown",
    "vue",
    "liquid",
    "erb",
    "lang-cfml",
    "cfml",
    "HTML (EEx)",
    "HTML (Eex)",
    "plist"
  ],
  "emmet.triggerExpansionOnTab": true,
  "terminal.integrated.profiles.windows": {
    "PowerShell": {
      "source": "PowerShell",
      "icon": "terminal-powershell"
    },
    "Command Prompt": {
      "path": ["${env:windir}\\Sysnative\\cmd.exe", "${env:windir}\\System32\\cmd.exe"],
      "args": [],
      "icon": "terminal-cmd"
    },
    "Git Bash": {
      "source": "Git Bash"
    },
    "Windows PowerShell": {
      "path": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
    }
  },
  "terminal.integrated.defaultProfile.windows": "PowerShell",
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "git.autofetch": true,
  "editor.bracketPairColorization.independentColorPoolPerBracketType": true,
  "cSpell.userWords": [
    "antfu",
    "commitlint",
    "histoire",
    "idux",
    "kebabcase",
    "pathe",
    "picocolors",
    "stylelint",
    "typecheck",
    "unocss",
    "unplugin",
    "vueuse"
  ],
  "vite.autoStart": false,
  "cSpell.showAutocompleteSuggestions": true,
  "typescript.inlayHints.enumMemberValues.enabled": true,
  "typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName": false,
  "typescript.inlayHints.variableTypes.suppressWhenTypeMatchesName": false,
  "[javascript]": {
    "editor.defaultFormatter": "vscode.typescript-language-features"
  },
  "prettier.arrowParens": "avoid",
  "prettier.jsxSingleQuote": true,
  "prettier.printWidth": 120,
  "prettier.semi": false,
  "prettier.singleQuote": true,
  "[vue]": {
    "editor.defaultFormatter": "Vue.volar"
  },
  "editor.codeActionsOnSave": {
    "source.fixAll": "explicit"
  },
  "explorer.confirmDelete": false,
  "git.confirmSync": false,
  "terminal.integrated.enableMultiLinePasteWarning": false,
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "explorer.confirmDragAndDrop": false,
  "editor.unicodeHighlight.allowedCharacters": {
    "": true
  },
  "editor.suggest.snippetsPreventQuickSuggestions": false,
  "workbench.iconTheme": "material-icon-theme",
  "javascript.preferences.quoteStyle": "single",
  "typescript.preferences.quoteStyle": "single",
  "terminal.integrated.env.osx": {
    "FIG_NEW_SESSION": "1",
    "CW_NEW_SESSION": "1"
  },
  "editor.accessibilitySupport": "off",
  "explorer.fileNesting.enabled": true,
  "explorer.fileNesting.expand": false,
  "explorer.autoRevealExclude": {
    "**/node_modules": false
  },
  "github.copilot.enable": {
    "*": true,
    "plaintext": false,
    "markdown": "true",
    "yaml": false
  },
  "cSpell.languageSettings": [],
  "cSpell.customDictionaries": {},
  "tabnine.experimentalAutoImports": true,
  "eslint.codeActionsOnSave.rules": null,
  "volar.completion.preferredTagNameCase": "auto-kebab",
  "vitest.commandLine": "nr vitest",
  "vitest.debugExclude": ["<node_internals>/**", "**/node_modules/**"],
  "editor.cursorSmoothCaretAnimation": "explicit",
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  "[markdown]": {
    "editor.defaultFormatter": "yzhang.markdown-all-in-one"
  },
  "RegexSetting": "([a-zA-Z]+)(.?[a-zA-Z()]+)?",
  "gitlens.codeLens.authors.enabled": false,
  "gitlens.codeLens.recentChange.enabled": false,
  "editor.stickyScroll.enabled": true,
  "editor.minimap.enabled": false,
  "window.confirmBeforeClose": "keyboardOnly",
  "workbench.tree.enableStickyScroll": true,
  "window.commandCenter": false,
  "workbench.editor.wrapTabs": true,
  "security.promptForLocalFileProtocolHandling": false,
  "window.nativeTabs": true,
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "typescript.inlayHints.functionLikeReturnTypes.enabled": true,
  "editor.fontFamily": "OperatorMonoSSm Nerd Font",
  "wakatime.apiKey": "waka_753fb756-9fb9-4a1e-8dae-29b9fe6e2d1d",
  "githubPullRequests.pullBranch": "never",
  "gitlens.views.branches.branches.layout": "list",
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "launch": {
    "configurations": [],
    "compounds": []
  },
  "files.associations": {
    "*.mdx": "markdown"
  },
  "window.zoomLevel": -1,
  "svg.preview.mode": "svg",
  "github.copilot.editor.enableAutoCompletions": true,
  "diffEditor.ignoreTrimWhitespace": false,
  "settingsSync.ignoredExtensions": ["vue.volar"],
  "workbench.settings.applyToAllProfiles": [
    "typescript.updateImportsOnFileMove.enabled",
    "scm.showHistoryGraph",
    "scm.showIncomingChanges",
    "scm.showOutgoingChanges"
  ],
  "scm.showHistoryGraph": false,
  "scm.showIncomingChanges": "never",
  "scm.showOutgoingChanges": "never",
  "cursor.cpp.disabledLanguages": ["plaintext", "yaml"],
  "gitlens.codeLens.enabled": false,
  "workbench.activityBar.location": "top",
  "workbench.activityBar.orientation": "vertical",
  "[yaml]": {
    "diffEditor.ignoreTrimWhitespace": true
  },
  "window.newWindowProfile": "Default",
  "typescript.updateImportsOnFileMove.enabled": "always",
  "RadonIDE.panelLocation": "tab",
  "RadonIDE.stopPreviousDevices": false
}

cursor 从 vscode 安装开源市场没有的 插件

~/.vscode/extensions 复制 cursor-cpp-0.3.0~/.cursor/extensions/ 里,同时要把 extensions.json 的内容复制过去,但是至此,只是 default profile 能用,其他 profile 还不能用

需要其他 profile 能用的话,需要从 ~/Library/Application Support/Cursor/User/profiles 里把对应的 extensions.json 也复制过去

cursor的应用市场搜不到vscode插件的解决办法

修改Cursor的插件市场地址 打开Cursor安装目录下的resources/app/product.json文件。

修改extensionsGallery中的resourceUrlTemplate和serviceUrl。

json
{
  "extensionsGallery": {
    "galleryId": "cursor",
    "serviceUrl": "https://marketplace.cursorapi.com/_apis/public/gallery",
    "itemUrl": "https://marketplace.cursorapi.com/items",
    "resourceUrlTemplate": "https://marketplace.cursorapi.com/{publisher}/{name}/{version}/{path}",
    "controlUrl": "https://api2.cursor.sh/extensions-control",
    "recommendationsUrl": "",
    "nlsBaseUrl": "",
    "publisherUrl": ""
  }
}

新的配置

json
{
  "extensionsGallery": {
    "resourceUrlTemplate": "https://{publisher}.vscode-unpkg.net/{publisher}/{name}/{version}/{path}",
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery"
  }
}

Made with ❤️