我正try 在vscode中为C和Python文件添加自定义尺子.以下是我的settings.json文件

{
    "C_Cpp.updateChannel": "Insiders",
    "editor.inlineSuggest.enabled": true,
    "security.workspace.trust.untrustedFiles": "open",
    "python.defaultInterpreterPath": "C:\\Path\\to\\my\\python.exe",
    "python.formatting.provider": "black",
    "[C_Cpp]": {
        "editor.rulers": [
            80
        ],
    },
    "editor.formatOnSave": true,
    "[python]": {
        "editor.defaultFormatter": "ms-python.black-formatter",
        "editor.rulers": [
            88
        ],
    },
}

这是我的main.cpp文件

#include <iostream>

int main()
{
    return 0;
}

对于.py文件,尺子可以正确显示,但.C.C..cpp.cpp文件不显示预期的标尺.

推荐答案

试一试:

"[cpp]": {
        "editor.rulers": [
            80
        ],
    },

I guess it overrides the config for a language, and not an extension, as when you put the cursor on the word, the following popup appears:enter image description here

Json相关问答推荐

使用JSONata将具有相同键的字典合并

使用Shell深入挖掘到最低的SON元素

时间序列的Vega Lite分组条形图

Allof Indide的JSON模式之一

如何在我的响应模型中修复此问题:[期望的值类型为';Map<;Dynamic,Dynamic&>;,但获得的值类型为';NULL&39;]

Pandas 对REST API的自定义响应

如何从一个700MB的json文件中列出PowerShell中的所有密钥?

使用Kotlin限制序列化类属性的允许整数值

在深度嵌套数组中使用布尔属性的jq-select

在Snowflake中查询JSON时,属性名称是否支持绑定参数?

NoneType 对象的 Python 类型错误

Bicep脚本中如何设置弹性池的维护窗口?

将带有::text[]的JSON数组转换未按预期工作

Powershell 7.2:ConvertFrom-Json - 日期处理

jq:来自嵌套 JSON 的映射

现代浏览器一次可以处理多少个 HTML 元素?

如何使用 Newtonsoft.Json 反序列化 JSON 数组

case 类只有一个字段时如何将json转为 case 类

如何在本地存储中存储对象数组?

log4j 支持 JSON 格式吗?