For a description of the extension itself, please see the README.
It is also possible to use some features of the language server on other editors (Vim, ...). Follow the server's README.
The changelog for the extension can be found here.
Installing from VS Code Extension Marketplace
To install this extension from the VS Code Extension Marketplace, please follow this guide. For more information regarding the Extension Marketplace, please see the official documentation.
Once compiled, the extension can either be launched in VS Code's debug mode or built into a VSIX file and installed.
- Install the dependencies:
npm install
npm run fetch:wasm # Download and build Wasm dependencies
npm run fetch:docs # Download Yocto's doc. Required for hints on hover
- Compile the Typescript files:
npm run compile
Press F5
or navigate to the debug section on the left of the VS Code and select the client or server to to launch the debug client.
- Build the VSIX file:
npm run package
- Install the VSIX file. See VS Code's documentation.
This deletes the Wasm files, the Yocto's doc, Poky, node_modules, and the compiled files:
npm run clean
To run all the tests:
- See compilation steps.
- Fetch Poky (required for the integration tests):
npm run fetch:poky
- Run all the tests:
# Note the integration tests require 'npm run compile' to be executed every time the Typescript files are modified.
npm test
All the tests mentionned are run in our GitHub CI.
One can check coding style using
npm run lint
Install the recommended extensions to automatically fix linting errors when possible.
Unit tests are powered by Jest. They allow mocking the behavior of VSCode and other external libraries. They can individually be run with:
npm run jest
Unit tests are defined in the __tests__
folders.
If you have installed the recommended extensions, you'll find launch and debug tasks for the unit tests in the debug section of VSCode.
See the individual grammar tests README.
These tests allow running the BitBake extension in a live VSCode environment. See the individual integration tests README.
This extension uses tree-sitter-bitbake and tree-sitter-bash to parse the BitBake documents. They are installed with npm run fetch:wasm
. The versions of tree-sitter-bitbake and tree-sitter-bash are documented in server/tree-sitter-bitbake.info and server/tree-sitter-bash.info respectively, along with the versions of the tree-sitter-cli that have to be used.
To update the .info files with the latest versions of tree-sitter-bitbake and tree-sitter-bash, it is recommended to use the scripts scripts/update-tree-sitter-bitbake.sh and scripts/update-tree-sitter-bash.sh. The GitHub workflow update-tree-sitter-parser-info-file.yml is already responsible for doing it automatically.
After updating the .info files, it is required to call npm run fetch:wasm
in order to rebuild the Wasm files.
For more information about the tree-sitter and its CLI, Check out the official site and npm page
Publishing is automated via GitHub Actions and reserved to project maintainers. To publish a new version:
- Update all the
package.json
files with the new version numberX.Y.Z
. - Document new changes in the
client/CHANGELOG.md
file. - Make sure the
VSCE_PAT
secret is valid in the GitHub repository settings. - Make sure the
NODE_AUTH_TOKEN
secret is valid in the GitHub repository settings. - Update the main branch with the latest staging branch.
- Create a new release on GitHub with a tag in the format
vX.Y.Z
. - Admin approval is required to run the GitHub Action.
The release will be published to the VS Code Marketplace automatically by the GitHub Action. Admin approval is required to run the GitHub Action, and the VSCE_PAT
must be updated to match a valid token for the yocto-project
Azure DevOps publisher. See:
- https://code.visualstudio.com/api/working-with-extensions/publishing-extension
- https://code.visualstudio.com/api/working-with-extensions/continuous-integration
The
NODE_AUTH_TOKEN
secret is used to push the language server package to the npm registry. The token must be linked to account with push permission on: - https://www.npmjs.com/package/language-server-bitbake
The
VSX_PAT
secret is used for VS Codium / Open-VSX. Instructions: - https://open-vsx.org/extension/yocto-project/yocto-bitbake
Development of this extension happens on GitHub. Issues and pull requests are welcome.
- Syntax derived from https://github.com/mholo65/vscode-bitbake, which is licensed under the MIT License.