-
Notifications
You must be signed in to change notification settings - Fork 74
Add Monaco editor and some basic language config #140
Conversation
}; | ||
} | ||
onProfileTypeChange = (value: string[], selectedOptions: CascaderOption[]) => { | ||
function onProfileTypeChange(value: string[], selectedOptions: CascaderOption[]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to function component mainly because at this moment it's a bit easier to use hooks for example to get grafana theme or to deal with async stuff.
</div> | ||
); | ||
function ensureFireQL(monaco: Monaco) { | ||
if (fireqlSetupDone === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of rip off from our prometheus setup will have to find out if double init is really bad or why this is needed.
ba4aa0d
to
3348aea
Compare
height={'30px'} | ||
containerStyles={styles.queryField} | ||
monacoOptions={{ | ||
folding: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some overrides, also mostly taken from prometheus data source. At some point, it would probably make sense to have this as a different editor style constant or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Add Monaco editor and some basic language config
At this moment this does do much, just some basic syntax highlight but I assume we will add some autocomplete once we have labels/values API ready.