Freed-Wu / coc-bitbake

Port vscode-bitbake to vim
https://github.com/yoctoproject/vscode-bitbake/pull/178
Other
1 stars 0 forks source link

BitBake recipe language support plugin for Visual Studio Code

Ported from vscode-bitbake.

Because some APIs of vscode are missing in coc.nvim, disable some features temporarily:

Install

" command line
CocInstall coc-bitbake
" or add the following code to your vimrc
let g:coc_global_extensions = ['coc-bitbake', 'other coc-plugins']

vscode-bitbake CI/CD

For a description of the extension itself, please see the client's 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.

Manual installation

Manual installation takes place in two steps. The code must be installed via npm and subsequently built within Visual Studio Code. Before performing these steps, please ensure you have cloned this repository.

Commands

To install the dependencies:

npm install

To compile the typescript files:

npm run compile

To clean up the project (This deletes node_modules):

npm run clean

For more commands, refer to the script section in the root package.json.

Debugging

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.

Testing

BitBake and Yocto docs are required for some features to work. They need to be fetched before testing and development:

npm run fetch:docs

Similar for the command that fetches poky, it needs to be run before running the integration tests:

npm run fetch:poky

A wrapper npm script allows running several kinds of tests. To run all tests, use:

npm test

All the tests mentionned are run in our GitHub CI.

Linter tests

One can check coding style using

npm run lint

Install the recommended extensions to automatically fix linting errors when possible.

Unit tests

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.

Grammar tests

See the individual grammar tests README.

Integration tests

These tests allow running the BitBake extension in a live VSCode environment. See the individual integration tests README.

Tree-sitter

This extension uses tree-sitter to parse the documents. The .wasm file used for creating the parser is generated from latest release at here.

For more information about the tree-sitter and its CLI, Check out the offical site and npm page

Publishing

Publishing is automated via GitHub Actions and reserved to project maintainers. To publish a new version:

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:

Contributing

Development of this extension happens on GitHub. Issues and pull requests are welcome.

Acknowledgements