Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console] Language Markers #58322

Open
jloleysens opened this issue Feb 24, 2020 · 3 comments
Open

[Console] Language Markers #58322

jloleysens opened this issue Feb 24, 2020 · 3 comments
Labels
discuss enhancement New value added to drive a business result Feature:Console Dev Tools Console Feature Feature:Dev Tools Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@jloleysens
Copy link
Contributor

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:

  • Giving the user a well defined way to get syntax highlighting for a supported language at any point in the text.
  • The addition of """xlang markers gives maintainers a much better way of introducing new languages to the lexer rules without needing to make them more complex.
  • We can advertise supported languages by providing autocomplete options after """
  • Having simpler rules makes them easier to test manually.
@jloleysens jloleysens added discuss Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Feb 24, 2020
@elasticmachine
Copy link
Contributor

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

@cjcenizal cjcenizal added Feature:Console Dev Tools Console Feature Feature:Dev Tools labels Jun 2, 2020
@jloleysens
Copy link
Contributor Author

jloleysens commented Jun 26, 2020

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

We will need to add collapseStringLiteral support for these cases.

@alisonelizabeth alisonelizabeth removed the Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more label Sep 17, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Sep 17, 2024
@alisonelizabeth alisonelizabeth added the Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more label Sep 17, 2024
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Sep 17, 2024
@alisonelizabeth alisonelizabeth added the enhancement New value added to drive a business result label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss enhancement New value added to drive a business result Feature:Console Dev Tools Console Feature Feature:Dev Tools Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

4 participants