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"

    ],

相关推荐
超级大福宝9 小时前
VS Code Remote-SSH 因 RemoteForward 端口冲突导致连接失败的排查与解决
运维·服务器·windows·vscode·ssh
MandalaO_O1 天前
IDEA 开发(快捷键 + 调试 + 序列化)
java·ide·intellij-idea
golang学习记1 天前
VSCode AI完成任务的仪式感:撒礼花
ide·vscode·编辑器
菜_小_白2 天前
codex
linux·vscode·ai
1024奇点2 天前
【仓颉语言入门 · 第26课】
开发语言·ide·开源
cuijiecheng20182 天前
Codex VS Code 插件新版卡住、界面异常:通过降级插件版本解决
vscode
golang学习记3 天前
VSCode AI新特性:HydraFusion来了:系统会自己组队干活
ide·人工智能·vscode
文祐3 天前
下载Visual Studio 2017 Build Tools version 15.9
ide·visual studio
golang学习记3 天前
Jetbrains 正式官宣:全新AI IDE正式发布!
ide·人工智能·intellij-idea·air
mklpo1473 天前
在win7 sp1 系统上安装最新版 的 Visual Studio Code。2026-10-04
ide·vscode·编辑器