From 5ef1a90bde9da5de400c772e49523fe29821df8c Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Mon, 8 Apr 2024 00:35:11 +0800 Subject: [PATCH] :sparkles: Support petalinux --- .pre-commit-config.yaml | 4 ++-- src/bitbake_language_server/server.py | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 97e6a54..1c0e827 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: - id: check-toml - id: check-json - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.4 + rev: v1.5.5 hooks: - id: remove-crlf - repo: https://github.com/codespell-project/codespell @@ -47,7 +47,7 @@ repos: hooks: - id: check-mailmap - repo: https://github.com/rhysd/actionlint - rev: v1.6.26 + rev: v1.6.27 hooks: - id: actionlint - repo: https://github.com/adrienverge/yamllint diff --git a/src/bitbake_language_server/server.py b/src/bitbake_language_server/server.py index 84fc906..0205899 100644 --- a/src/bitbake_language_server/server.py +++ b/src/bitbake_language_server/server.py @@ -59,10 +59,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: @self.feature(INITIALIZE) def initialize(params: InitializeParams) -> None: if params.root_path: - path = os.path.join(params.root_path, "conf/bitbake.conf") - if os.path.exists(path): - self.stash.AddFile(path) - self.show_message(f"Add {path}") + for filename in { + "conf/bitbake.conf", + "components/yocto/layers/poky/meta/conf/bitbake.conf", + }: + path = os.path.join(params.root_path, filename) + if os.path.exists(path): + self.stash.AddFile(path) + self.show_message(f"Add {path}") + return @self.feature(TEXT_DOCUMENT_DID_OPEN) @self.feature(TEXT_DOCUMENT_DID_CHANGE)