Search code examples
azure-data-explorermonaco-editor

How to add custom keywords or aliases to Monaco Editor at runtime


I am working with the Monaco Editor, specifically using the kusto language support monaco-kusto. I am trying to replicate functionality inside Azure Data Explorer (ADX) which contains an editor for kusto and it allows you to define 2 placeholders (_startTime and _endTime) which are augmented using a dropdown selector.

Now, in my own project I have everything working except for the keyword recognition of those names. I am not sure what ADX does, whether its got a custom build of the kusto library or there is some way in Monaco that you are able to add custom keywords to get over the error highlighting?


Solution

  • You can take a look at the Grafana implementation of a similar functionality here:

    https://github.com/grafana/azure-data-explorer-datasource/tree/main/src/editor