Skip to content

Add PromQL language support#2628

Merged
RunDevelopment merged 9 commits intoPrismJS:masterfrom
arendjr:PromQL-support
Nov 12, 2020
Merged

Add PromQL language support#2628
RunDevelopment merged 9 commits intoPrismJS:masterfrom
arendjr:PromQL-support

Conversation

@arendjr
Copy link
Copy Markdown
Contributor

@arendjr arendjr commented Nov 10, 2020

Copy link
Copy Markdown
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @arendjr!

I gave your PR a quick look and left you some comments. I'll give it a more in-depth review later.

Additional notes:

  • We only use single-quoted strings
  • Please quote all token names (e.g. 'comment', 'range-duration', etc) (like here).
  • Please use an IIFE to fix global namespace pollution (like here).

Comment thread components/prism-promql.js Outdated
Comment thread components/prism-promql.js Outdated
Comment thread components/prism-promql.js Outdated
Comment thread components/prism-promql.js Outdated
Comment thread components/prism-promql.js Outdated
Comment thread components/prism-promql.js Outdated
Comment thread components/prism-promql.js Outdated
Comment thread tests/languages/promql/time_series_selection.test Outdated
Comment thread tests/languages/promql/subquery_selection.test Outdated
Comment thread tests/languages/promql/aggregate_selection.test Outdated
@arendjr
Copy link
Copy Markdown
Contributor Author

arendjr commented Nov 10, 2020

Thanks for the thorough feedback already! I have addressed the styling issues, split keywords and functions as appropriate, simplified some things and added another comment to address one of your questions :) To be honest, I'm not sure about all the original motivations, as I reused some code from the Monaco highlighter and the blog post I referenced, but thanks to your review, I think it's pretty cleaned up now.

Comment thread examples/prism-promql.html Outdated
Comment thread components/prism-promql.js Outdated
@RunDevelopment
Copy link
Copy Markdown
Member

Thank you for the quick response!

I still have some minor nits but it's overall it looks really good now.

arendjr and others added 2 commits November 10, 2020 22:18
Co-authored-by: Michael Schmidt <mitchi5000.ms@googlemail.com>
Comment thread components/prism-promql.js Outdated
Co-authored-by: Michael Schmidt <mitchi5000.ms@googlemail.com>
Copy link
Copy Markdown
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebuild, so I can merge.

@arendjr
Copy link
Copy Markdown
Contributor Author

arendjr commented Nov 12, 2020

Done!

@RunDevelopment RunDevelopment merged commit 8831c70 into PrismJS:master Nov 12, 2020
@RunDevelopment
Copy link
Copy Markdown
Member

Thank you for contributing @arendjr!

@arendjr
Copy link
Copy Markdown
Contributor Author

arendjr commented Nov 12, 2020

Thanks for your support! 🚀

This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants