BitBake recipe language support in Visual Studio CodeConfigurationSome advanced features of this extension will need to locate and run BitBake. It can be configured from VSCode's settings. To access the settings, you can navigate to Files -> Preferences -> Settings (or use the shortcut [Ctrl+,]). BitBake's settings are under Extensions. More options are available to tweak the extension's behavior. Here's an example
BitBake Command wrappersVarious tools provide ways to automatically configure the BitBake environment, or even call it inside containers. The
Or, if
You can also control the directory from which they are started by using the Here are some examples using the most popular bitbake wrappers:
Defining Multiple ConfigurationsSometimes it is necessary to build the same project with different distros or
machines configurations. You can define alternative settings for the extension
through the
Additional settings recommendationsIf your workspace contains a Yocto build directory, some other extensions may
be hogging lots of resources to parse it's contents and stall your machine. Here are
some example settings to improve your experience (assuming your build directory
is called
Note that the extension deactivates the "files.trimTrailingWhitespace" setting for Python and Shell script, as it interferes with the functioning of features related to embedded languages. FeaturesSyntax highlightingThe extension provides syntax highlighting for BitBake recipes, classes, configuration and inc-files. Syntax highlighting also supports embedded languages inside BitBake recipes including inline Python variable expansion, shell code and Python code. The BitBake language is automatically detected based on the file extension:
[ Context-based suggestionsCTRL+SPACE may be used to provide suggestions. For example, typing The following suggestions are currently supported:
Go to definitionThis feature requires to have properly configured the extension CTRL and click may be used to open the file associated with a class, inc-file, recipe or variable. If more than one definition exists, a list of definitions is provided. The go to definition feature currently behaves as follows:
Show definitions of BitBake's defined variables on hoverThis feature requires to have properly configured the extension Place your cursor over a variable. If it is a BitBake defined variable, then its definition from the documentation will be displayed. Other code suggestionsOverrides, variable flags, frequently-used task names and more. BitBake tasksBitBake build tasks may be defined through the Here's an example
BitBake commandsThe extension provides commands and shortcuts to run BitBake tasks. These commands are available in the command palette ( BitBake recipes viewThe extension provides a view to display the list of recipes in the current workspace. This view is available in the left panel. You can quickly navigate to a recipe's source or build it by clicking on it. Problems matcherBy default, this extension will run BitBake in parse only mode in the background on file saves to identify syntax errors. They will be displayed in the problems panel. You can disable this feature through the extension's settings. BitBake status barBitbake parsing status is displayed in the status bar at the bottom of the screen. It will show wether the last BitBake run was successful or not. The BitBake server queues all BitBake commands and runs them sequentially. The status bar will show you if the extension is currently trying to access the bitbake server. Devtool and eSDK integrationThe recipe's contextual menu provides shortcuts to open new Once the workspace is set up, it will appear in the left panel. Use the contextual menu or the action buttons to build, update the recipe, or close ("reset") the workspace. Clicking on the workspace name will open the sources' workspace in a new window. You may edit the sources and generate patches in your Yocto recipes by following the devtool workflow described in Yocto's documentation:
You can also set up the SDK for the recipe by running the
Note: This feature depends on poky versions 5.0 and above ( If your recipe's class is not supported, or you have an older version of poky, the BitBake terminal profileIf you need to run custom commands not covered by this extension like Recipe scanThis extension can run bitbake commands to parse recipes through context menu, command palette, or whenever a certain managed file is saved. Upon saving You may toggle this behaviour through the setting The extension will receive additional information about the recipe from the ToasterToaster users may start toaster through the main context menu -> Bitbake -> Start toaster in browser. It will open the web UI in the default browser. Toaster can also be stopped by the command
LintingThis extension provides linting based on BitBake parsing results and Pylance. The BitBake parsing can be triggered with the command Optionally, the following Python and Shell extensions are also supported:
Refer to the troubleshooting guide and the documentation for each extension if you encounter any issues. For advanced styling recommendations, we also suggest using the oelint-adv extension. TroubleshootingSee the TROUBLESHOOTING.md file. OthersThis extension also doesn't support WKS files, you should find another extension such as openembedded-kickstart ContributingReporting issuesUser feedback is very welcome on this extension's repository. Please report any issues or feature requests you may have with a detailed description of the problem and the steps to reproduce it. Contributing codeContributions are welcome! Please submit your contributions as pull requests on this extension's repository Instructions to build, test and debug the extension are available in the README-DEVELOPER. |