
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Tree Sitter grammar for d2lang (github). It's not yet finished, but usable for every-day cases with support for latest features like globs, filters and variables.
The goal is to provide better experience for existing keywords, code blocks injections, folds, etc.
I've never done anything remotely close to parsing grammar, so there could be some bad patterns and simply bad code. Feel free to open issues.
via lazy.nvim
{
"ravsii/tree-sitter-d2",
dependencies = { "nvim-treesitter/nvim-treesitter" },
build = "make nvim-install",
branch = "v0.7.1",
},
[!TIP] We recommend using
branch
set to the latest release tag instead ofmain
, as we cannot guarantee that there won't be breaking changes, because that's fully on d2 team. But if there are, we simply follow the latest release.
Fortunately Helix has it's own guide on how to add new languages and grammars.
A quick example for installing d2
would be:
languages.toml
[[language]]
name = "d2"
scope = "source.git"
file-types = ["d2"]
comment-token = "#"
roots = [""]
indent = { tab-width = 2, unit = " " }
[[grammar]]
source = { git = "https://github.com/ravsii/tree-sitter-d2", rev = "main" }
name = "d2"
hx --grammar fetch
&& hx --grammar build
~/.config/helix/runtime/queries/d2
~/.config/helix/runtime/queries/d2
├── highlights.scm
├── injections.scm
└── locals.scm
[!WARNING]
We found out that Helix is usingtree-sitter v0.22.x
which makes it incompatible with this grammar, as it was built usingtree-sitter v0.25.x
.If the highlighting doesn't work and
:log-open
has this error:Incompatible language version 15. Expected minimum 13, maximum 14
then try using these options
[[grammar]] source = { git = "https://github.com/ravsii/tree-sitter-d2", rev = "main-helix" } name = "d2"
For more info see: https://github.com/ravsii/tree-sitter-d2/issues/102
If you're using some other editor that's using tree-sitter, please open an issue. Would be great if you could also provide instructions for other how to install it.
Tokyo Night Storm
theme with CaskaydiaCove
font.
Props to Neovim's Tokyo Night theme for supporting pretty much every highlighting group.
https://github.com/user-attachments/assets/a9bd20d0-eb6c-43c2-8e58-7d211d350025
See CONTRIBUTION.md
This section is outdated and not maintained
Actually, there's another tree-sitter-d2 by pleshevskiy. My project's initial
goal was to fix issues his grammar had, but later I realized that his grammar
is not maintained and lacks many features d2
has added since then.
Here's a list of comparisons as of v0.2
version of this project, both using
Tokyonight Storm
theme.
Please note that:
FAQs
D2 grammar for tree-sitter
We found that tree-sitter-d2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.