elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.61k stars 8.22k forks source link

[ES|QL] consider rule-based syntax highlighting #197732

Open drewdaemon opened 1 week ago

drewdaemon commented 1 week ago

Describe the feature: ES|QL is key to company strategy. Having syntax highlighting available at least everywhere in Elastic's UIs and possibly more broadly in the open source community is a great way to promote its use and treat it as a "first class citizen."

In https://github.com/elastic/eui/discussions/8046 we began a discussion about adding support to EUI. We originally considered using our official ANTLR lexer to power syntax highlighting as we do in the ES|QL editor. However, Regex-based highlighters are very popular (see Prism and Highlight.js) and are currently used to power EUI's code highlighting (through Prism).

The ask is to build a PoC for an ES|QL regex-based highlighter. We should evaluate its maintainability.

If we're happy with it, we should consider where it can fit in at Elastic and in the broader community.

Ideas

elasticmachine commented 1 week ago

Pinging @elastic/kibana-esql (Team:ESQL)

drewdaemon commented 8 hours ago

Switching to Monarch in the editor may also resolve https://github.com/elastic/kibana/issues/197250