diff mbox series

contrib/vim: highlight inherit_defer and include_all

Message ID 20260423151340.2082495-1-twoerner@gmail.com
State New
Headers show
Series contrib/vim: highlight inherit_defer and include_all | expand

Commit Message

Trevor Woerner April 23, 2026, 3:13 p.m. UTC
The vim syntax file's "Includes and requires" rule only matched
inherit, include and require. BitBake also accepts the inherit_defer
and include_all directives, so they should be highlighted the same
way.

Add both keywords to bbInclude and to the bbIncludeLine match
pattern. Longer keywords are listed first in the alternation so the
regex does not match the shorter prefix (e.g. inherit_defer must win
over inherit).

AI-Generated: codex/claude-opus 4.7 (xhigh)
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 contrib/vim/syntax/bitbake.vim | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Antonin Godard April 23, 2026, 4:17 p.m. UTC | #1
Hi,

On Thu Apr 23, 2026 at 5:13 PM CEST, Trevor Woerner via lists.openembedded.org wrote:
> The vim syntax file's "Includes and requires" rule only matched
> inherit, include and require. BitBake also accepts the inherit_defer
> and include_all directives, so they should be highlighted the same
> way.
>
> Add both keywords to bbInclude and to the bbIncludeLine match
> pattern. Longer keywords are listed first in the alternation so the
> regex does not match the shorter prefix (e.g. inherit_defer must win
> over inherit).

Why do we maintain a syntax file here since it's already part of upstream vim [1]?

[1]: https://github.com/vim/vim/blob/master/runtime/syntax/bitbake.vim

Antonin
diff mbox series

Patch

diff --git a/contrib/vim/syntax/bitbake.vim b/contrib/vim/syntax/bitbake.vim
index 8f39b8f95115..fcf024563a97 100644
--- a/contrib/vim/syntax/bitbake.vim
+++ b/contrib/vim/syntax/bitbake.vim
@@ -62,9 +62,9 @@  syn match bbVarFlagDef          "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.+]\+\
 syn region bbVarFlagFlag        matchgroup=bbArrayBrackets start="\[" end="\]\s*\(:=\|=\|.=\|=.|+=\|=+\|?=\)\@=" contained contains=bbIdentifier nextgroup=bbVarEq
 
 " Includes and requires
-syn keyword bbInclude           inherit include require contained 
+syn keyword bbInclude           inherit inherit_defer include include_all require contained
 syn match bbIncludeRest         ".*$" contained contains=bbString,bbVarDeref,bbVarPyValue
-syn match bbIncludeLine         "^\(inherit\|include\|require\)\s\+" contains=bbInclude nextgroup=bbIncludeRest
+syn match bbIncludeLine         "^\(inherit_defer\|inherit\|include_all\|include\|require\)\s\+" contains=bbInclude nextgroup=bbIncludeRest
 
 " Add taks and similar
 syn keyword bbStatement         addtask deltask addhandler after before EXPORT_FUNCTIONS contained