Repository navigation
Conversation
Contributor
Author
|
Please review! |
Add grammar, highlighting, autocompletion, and linting for the
step(), range(), min(), and max() duration pseudo-functions
behind --enable-feature=promql-duration-expr.
- lezer-promql: add DurationExpr rule; update MatrixSelector and
SubqueryExpr to accept DurationExpr in duration slots; define
DurationStep/DurationRange via condFn to preserve step/range as
valid identifiers outside duration context
- highlight.js: tag DurationExpr child nodes as function(variableName)
- promql.terms.ts: add durationExprTerms with step(), range(), snippets
- hybrid.ts: add ContextKind.DurationExpr; use node.getChild('DurationExpr')
instead of containsAtLeastOneChild with string arg; add dedupeCompletions
- parser.ts: warn when range() is in subquery step position; error on
step()/range() in offset position without duplicating parse error
Signed-off-by: ADITYA TIWARI <[email protected]>
adity-a34
force-pushed
the
feat-promql-duration-expression
branch
from
April 22, 2026 06:55
071ff30 to
8d2129e
Compare
Signed-off-by: Aditya Tiwari <[email protected]>
Contributor
Author
|
my changes do not touch any Go code so I guess the CI / Go tests on Windows (pull_request) is flaky. |
Member
|
Thanks! A quick test in the netlify preview is not looking great:
|
Contributor
Author
Hi @roidelapluie I see there is a PR linked that fixes this review/issue. |
Member
|
Hello from the bug-scrub! @adity-a34 yes, #18625 took your work here and added a bit more. As you can see in the discussion there, it was not perfect. If you have some time, please contribute to that discussion or continue the work here. |
Member
|
Merged in #18625, thanks! |
Contributor
Author
|
Completed in #18625. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add grammar, highlighting, autocompletion, and linting for the step(), range(), min(), and max() duration pseudo-functions behind --enable-feature=promql-duration-expr.
Which issue(s) does the PR fix:
Fixes #17742
Release notes for end users (ALL commits must be considered).
Reviewers should verify clarity and quality.
Testing
I used the following expression to validate the implementation is correct: