patch 9.1.0823: filetype: Zephyr overlay files not recognized
Problem: filetype: Zephyr overlay files not recognized
Solution: detect '*.overlay' files as dts filetype,
include syntax tests for DTS files
(Xudong Zheng)
Reference:
https://docs.zephyrproject.org/latest/build/dts/howtos.html
closes: #15963
Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/syntax/testdir/input/dts_zephyr.overlay b/runtime/syntax/testdir/input/dts_zephyr.overlay
new file mode 100644
index 0000000..40d9aa6
--- /dev/null
+++ b/runtime/syntax/testdir/input/dts_zephyr.overlay
@@ -0,0 +1,16 @@
+/ {
+ chosen {
+ zephyr,uart-mcumgr = &cdc_acm_uart0;
+ zephyr,shell-uart = &cdc_acm_uart1;
+ };
+};
+
+&zephyr_udc0 {
+ cdc_acm_uart0: cdc_acm_uart0 {
+ compatible = "zephyr,cdc-acm-uart";
+ };
+
+ cdc_acm_uart1: cdc_acm_uart1 {
+ compatible = "zephyr,cdc-acm-uart";
+ };
+};
diff --git a/runtime/syntax/testdir/input/dts_zmk.keymap b/runtime/syntax/testdir/input/dts_zmk.keymap
new file mode 100644
index 0000000..14fb210
--- /dev/null
+++ b/runtime/syntax/testdir/input/dts_zmk.keymap
@@ -0,0 +1,23 @@
+#include <behaviors.dtsi>
+#include <dt-bindings/zmk/keys.h>
+
+// Define macro for layers.
+#define LAYER_MAIN 0
+
+/ {
+ keymap {
+ compatible = "zmk,keymap";
+
+ layer_0 {
+ bindings = <
+ &kp Z
+ &kp M
+ &kp K
+ &zmk_string
+ &to LAYER_MAIN
+ >;
+ };
+ };
+
+ ZMK_MACRO(zmk_string, wait-ms = <10>; tap-ms = <10>; bindings = <¯o_tap &kp Z &kp M &kp K>;)
+};