Summary
Ctrl+click / F12 on a compatible string value (e.g. compatible = "qcom,sm8450-pinctrl") should navigate to the matching of_device_id entry in the kernel driver C source. If no driver match is found, fall back to the corresponding DT binding YAML file.
Current behavior
- Go to Definition works on
&label phandle references and property names.
- Hovering a
compatible string already shows the binding documentation (since v0.9.0).
- Autocompletion suggests compatible strings from the binding index.
- But F12 / Ctrl+click on the compatible string value itself does nothing.
Expected behavior
When the cursor is on a string literal inside a compatible property, the LSP textDocument/definition handler should:
- Primary target — driver source: Search for the compatible string in
of_device_id tables (.compatible = "qcom,sm8450-pinctrl") across the kernel tree and navigate to the matching line in the driver C file.
- Fallback — binding YAML: If no driver match is found, resolve it to the YAML binding file that declares that compatible (using the already-loaded binding index).
This mirrors how developers actually work: the first thing you want to see when clicking a compatible string is the driver that handles it — the binding schema is secondary.
Use case
Kernel developers frequently need to jump from a DTS compatible string to the driver that probes it. Today this requires a manual grep -r across the tree. Direct F12 navigation would make the workflow significantly faster — especially in large SoC trees with hundreds of drivers.
Implementation notes
- The compatible string already exists in the binding index (used for hover/autocomplete).
- For driver lookup, a workspace-wide index of
of_device_id tables (grepping for .compatible = "..." patterns in *.c files) would cover the vast majority of cases.
- Priority: driver C file > binding YAML > nothing.
Environment
- Extension version: 0.9.3
- Binding type:
DevicetreeOrg
- Binding path configured:
Documentation/devicetree/bindings
- OS: Linux (remote SSH via VS Code)
Notes
Happy to test pre-release builds if helpful.
Summary
Ctrl+click / F12 on a
compatiblestring value (e.g.compatible = "qcom,sm8450-pinctrl") should navigate to the matchingof_device_identry in the kernel driver C source. If no driver match is found, fall back to the corresponding DT binding YAML file.Current behavior
&labelphandle references and property names.compatiblestring already shows the binding documentation (since v0.9.0).Expected behavior
When the cursor is on a string literal inside a
compatibleproperty, the LSPtextDocument/definitionhandler should:of_device_idtables (.compatible = "qcom,sm8450-pinctrl") across the kernel tree and navigate to the matching line in the driver C file.This mirrors how developers actually work: the first thing you want to see when clicking a compatible string is the driver that handles it — the binding schema is secondary.
Use case
Kernel developers frequently need to jump from a DTS compatible string to the driver that probes it. Today this requires a manual
grep -racross the tree. Direct F12 navigation would make the workflow significantly faster — especially in large SoC trees with hundreds of drivers.Implementation notes
of_device_idtables (grepping for.compatible = "..."patterns in*.cfiles) would cover the vast majority of cases.Environment
DevicetreeOrgDocumentation/devicetree/bindingsNotes
Happy to test pre-release builds if helpful.