Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Conversation

aocenas
Copy link
Member

@aocenas aocenas commented Aug 3, 2022

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.

};
}
onProfileTypeChange = (value: string[], selectedOptions: CascaderOption[]) => {
function onProfileTypeChange(value: string[], selectedOptions: CascaderOption[]) {
Copy link
Member Author

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) {
Copy link
Member Author

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.

@aocenas aocenas force-pushed the aocenas/add-monaco-to-query-editor branch from ba4aa0d to 3348aea Compare August 3, 2022 16:58
height={'30px'}
containerStyles={styles.queryField}
monacoOptions={{
folding: false,
Copy link
Member Author

@aocenas aocenas Aug 3, 2022

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.

Copy link
Contributor

@joey-grafana joey-grafana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@aocenas aocenas merged commit e9b0313 into main Aug 4, 2022
@aocenas aocenas deleted the aocenas/add-monaco-to-query-editor branch August 4, 2022 08:06
simonswine pushed a commit to simonswine/pyroscope that referenced this pull request Jun 30, 2023
Add Monaco editor and some basic language config
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants