vscode编辑设备树插件 devicetree LSP

  1. 下载 dt-schema(可选,更完整的检查) git clone https://github.com/devicetree-org/dt-schema

  2. 在settings.json中配置: // 1. 设置工作目录为你的内核源码绝对路径

    "devicetree.cwd": "/root/project/linux",

    // 2. 指定为 Linux 的设备树组织规范(而不是单片机的 Zephyr)

    "devicetree.defaultBindingType": "DevicetreeOrg",

    // 3. 必须使用绝对路径!让 LSP 能够跨越 SSH 找到头文件,从而实现宏定义补全

    "devicetree.defaultIncludePaths": [

    "/root/project/linux/include",

    "/root/project/linux/arch/arm/include",

    "/root/project/linux/arch/arm/boot/dts"

    ],

    //引入标准的元模式(Meta-Schemas),用于规范 YAML 本身的语法

    "devicetree.defaultDeviceOrgBindingsMetaSchema": [

    "/home/yang/dt-schema/dtschema/meta-schemas"

    ],

    // 4. 导入内核自带的硬件绑定规则属性(用于提示 compatible 属性)

    "devicetree.defaultDeviceOrgTreeBindings": [

    "/home/yang/dt-schema/dtschema/schemas",

    "/root/project/linux/Documentation/devicetree/bindings"

    ],

相关推荐
摇滚侠3 小时前
IDEA 新建 JavaWeb 项目 Tomcat 和 Servlet
java·ide·intellij-idea
我先去打把游戏先4 小时前
VMware NAT 模式 Ubuntu 虚拟机「宿主机能上网、虚拟机 ping 不通外网 + apt 更新卡死」全故障复盘
linux·运维·vscode·单片机·嵌入式硬件·ubuntu·keil5
朝阳5815 小时前
VS Code 1.122 重磅登场:AI 全面自主,浏览器变身专业测试仪
人工智能·vscode
万粉变现经纪人6 小时前
2026最新Windows11系统CMD安装Claude Code 快速接入DeepSeek V4 Pro在VSCode编程工具中使用保姆级入门教程指南
linux·运维·ide·windows·vscode·macos·编辑器
兔老大RabbitMQ8 小时前
IDEA 打字打在光标右边 / 删除异常问题
java·ide·intellij-idea
码农小旋风8 小时前
Codex中文网 | Codex CLI 中文指南
运维·服务器·ide·人工智能·chatgpt·claude
问心无愧05139 小时前
ctf show web入门100
android·ide·笔记·android studio
AutumnWind042019 小时前
【Intelij IDEA使用手册】
java·ide·intellij-idea
你疯了抱抱我20 小时前
【Mac】vscode 配置 GD32E230CXXX 开发环境
ide·vscode·macos·嵌入式