A fork of Grafana's lezer-logql, published as
@oxynote/lezer-logql. It adds two things, so an editor does not mark a templated query as broken: duration placeholders ($__auto,$__interval,$__range) parse as durations, and variable references ($env) parse as aVariableReferencewherever a label name, a number or a duration goes. A variable inside a quoted value ({app="$app"}) is part of the string, as upstream already parses it. Everything else is upstream's, andNOTICElists the changes.
LogQL lezer grammar based on https://github.com/grafana/loki/blob/main/pkg/logql/syntax/syntax.y.
npm install @oxynote/lezer-logql
npm run build
npm test
Bump version in package.json to upstream's version plus this fork's
counter (0.4.2-oxynote.2), then push a matching tag (v0.4.2-oxynote.2).
The publish workflow builds, runs the tests, checks the tag against the
manifest and publishes to npm with provenance.
This repository is a GitHub fork, so upstream's changes come in with a merge:
git remote add upstream https://github.com/grafana/lezer-logql.git
git fetch upstream
git merge upstream/main
Then add any new change of this fork to NOTICE.