Visual Studio Code 使用的所有配置文件是什么? [英] What are ALL configuration files used by Visual Studio Code?

查看:53
本文介绍了Visual Studio Code 使用的所有配置文件是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所知道的 VS Code 以 JSON 格式处理 UserWorkspace 配置.它会在工作目录(必要时)和用户主目录(例如用于存储市场扩展)中创建.vscode文件夹.>

我想知道是否还有其他地方.

例如,如果您在不使用新建文件"按钮的情况下创建文件,例如从终端:

echo "dummy" >dummy.abc

然后你在编辑器中打开它,你会看到一个这样的对话框提示:

如果你点击 Don't Show Again... 并在同一个目录或另一个目录中重复相同的实验,VS Code 会记住它(它不会第二次显示对话框).

我知道这不是什么重要的事情...但我想知道它的存储位置.

那么,VS Code 是否还有其他配置文件?

解决方案

You have default settings, user settings, workspace settings, <代码>单个文件夹设置(旧版)和存储库设置.

您可以通过在命令面板(Shift+Cmd+PShift+Ctrl+P 在 Windows/Linux 中).

您可以通过按 Cmd+,(或 Ctrl+, 在 Windows/Linux 中)访问您的用户 settings.json 文件.

工作区设置位于 .code-workspace 文件中设置"键,如下所示:

<代码>{设置":{"breadcrumbs.enabled": true//此处设置}}

单文件夹设置进入 /.vscode/settings.json 文件.单文件夹状态是一个遗留功能.当处于单文件夹状态时,您可以在/.vscode/settings.json 文件中插入存储库范围和工作区范围的设置,但如果将其转换为工作区,则工作区设置将停止工作.这可能会令人困惑,因为如果您在文件资源管理器中选择Remove folder from Workspace"或Add folder to workspace"选项,VS Code 会创建一个隐式/未保存的工作区.

存储库设置进入 /.vscode/settings.json 文件.

我录制了一段关于设置位置的视频应用 包含一个轻微的误解,我希望尽快纠正,围绕着我在录制时不知道的单文件夹遗留功能.我希望这会有所帮助:)

VS Code from what I know handles User and Workspace configurations in JSON format. It creates .vscode folder in the working directory (when necessary) and another in user home (e.g. used to store marketplace extensions).

I'm wondering if there's also another place.

For example, if you create a file without using New File button, e.g. from terminal:

echo "dummy" >dummy.abc

And then you open it in the editor, you will be prompted with a dialog like this:

If you hit Don't Show Again... and repeat the same experiment in the same directory or in another, VS Code will remember it (it will not present the dialog a second time).

I know it's not an important thing... But I want to know where this is stored.

So, are there any other config file that VS Code uses?

解决方案

You have default settings, user settings, workspace settings, single folder settings (legacy) and repository settings.

You can access your defaultSettings.json by typing "default settings" in the command palette (Shift+Cmd+P or Shift+Ctrl+P in Windows/Linux).

You can access your user settings.json file by pressing Cmd+, (or Ctrl+, in Windows/Linux).

The workspace settings go inside a .code-workspace file in the "settings" key, like so:

{
    "settings": {
        "breadcrumbs.enabled": true // Settings here
    }
}

The single-folder settings go into the /.vscode/settings.json file. The single-folder state is a legacy feature. You can insert both repository-wide and workspace-wide settings inside the /.vscode/settings.json file when in a single-folder state but workspace settings stop working if you turn that into a workspace. This can be confusing because VS Code creates an implicit/unsaved workspace if you choose the "Remove folder from Workspace" or the "Add folder to workspace" options in your file explorer.

The repository settings go into the /.vscode/settings.json file.

I've recorded a video on where settings are applied that contains a slight misconception, which I'm hoping to correct soon, around the single-folder legacy functionality that I was not aware of at the time of the recording. I hope this helps :)

这篇关于Visual Studio Code 使用的所有配置文件是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆