Adblock Language support for VSCode.
Table of Contents:
This extension adds support for AdGuard, uBlock Origin and Adblock Plus syntaxes to Visual Studio Code, so you can write adblock rules in a convenient way. It also provides a linter to check your rules for errors.
We recommend using this extension if you are working with adblock rules.
You can easily install the update from the Visual Studio Marketplace or the Open VSX Registry:
Here is a screenshot of the extension in action:
GitHub Linguist support is also available, so you can highlight your adblock rules in GitHub repositories. See GitHub Linguist support for more details. Quick example:
In this section we will describe the main features of this extension.
Syntax highlighting is available for AdGuard, uBlock Origin and Adblock Plus syntaxes. Nowadays it is unimaginable to work with code without highlighting, which helps you to distinguish different parts of the code and makes it easier to read.
AGLint integration (linter)
We integrated AGLint into this extension, that makes it able to check your rules for various issues, such as invalid syntax, invalid domains, invalid / incompatible CSS selectors, unknown / incompatible scriptlets, bad practices, etc. For more information about AGLint, please refer to its repository.
AGLint integration is done in the following way:
This extension provides the following configuration options:
GitHub Linguist support
GitHub supports adblock syntax officially via the Linguist library. Our extension provides a
TMLanguage file, which is used by Linguist to highlight adblock rules (VSCode highlight also based on
this file). This means that if you have a repository with adblock rules, GitHub can highlight your
In addition, adblock code blocks can be inserted in markdown files and comments according to the following pattern:
```adblock ! Example rule example.org##.banner ```
will be rendered as:
Ideas & Questions
If you have any questions or ideas for new features, please open an issue or a discussion. We will be happy to discuss it with you.
If you found a bug or have a feature request, please report it here. Please make sure to include as much information as possible, including screenshots or example rules.
Please note that the highlighter issues on GitHub will not be fixed immediately when we update the TMLanguage in this repository. GitHub's highlighter is only updated after Linguist releases. This process happens roughly every quarter. Before release, Linguist maintainers will update all integrated TMLanguage to the latest version. You can find more information about Linguist's release process here.
If you want to contribute to this project, please read the CONTRIBUTING file.
This extension is licensed under the MIT License. See the LICENSE file for details.
Here are some useful links to help you write adblock rules. This list is not exhaustive, so if you know any other useful resources, please let us know.