elastic / kibana

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

[Console] Language Markers #58322

Open jloleysens opened 4 years ago

jloleysens commented 4 years ago

Describe the feature:

Console supports three different languages: the console language itself (combination of cURL-like and XJSON), Painless and Elasticsearch SQL. Currently, syntax highlighting is automatically inferred from surrounding text like:

POST _search
{
...
    "script": """
         // Here is some Painless
    """
...
}

# and

POST _sql
{
...
    "query": """
       -- This is some Elasticsearch SQL
    """
...
}

The common denominator being """. The result has been a collection of lexer rules that are not very portable to other pieces of text in the editor. To make the lexer rules more simple and offer the end user more control over highlighting in different regions of text we could do something like:

POST _another_endpoint
{
...
    "any_key": """painless
         // Here is some Painless
    """
...
}

# and

POST _something_else
{
...
    "some_key": """sql
       -- This is some Elasticsearch SQL
    """
...
}

Describe a specific use case for the feature:

elasticmachine commented 4 years ago

Pinging @elastic/es-ui (Team:Elasticsearch UI)

jloleysens commented 4 years ago

The Monaco-based editor supports """sql Type your SQL here """ at the moment.

We will need to add collapseStringLiteral support for these cases.

elasticmachine commented 2 months ago

Pinging @elastic/kibana-management (Team:Kibana Management)