Skip to content

Commit

Permalink
[8.6] [PresentationUtil] Fix Canvas expression autocomplete (#146425) (
Browse files Browse the repository at this point in the history
…#146465)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[PresentationUtil] Fix Canvas expression autocomplete
(#146425)](#146425)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nick
Peihl","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-11-28T19:30:37Z","message":"[PresentationUtil]
Fix Canvas expression autocomplete (#146425)\n\nFixes #146243 \r\n\r\n##
Summary\r\n\r\nFixes Canvas expression
autocomplete\r\n\r\nhttps://github.com//pull/143739
upgraded the monaco-editor\r\ndependency which uses a callback to the
`onLanguage` method to\r\ninitialize the expressions. The PR moved the
`monaco.languages.register`\r\ncommand inside this callback and which
was never triggered.\r\n\r\nMoving the `monaco.languages.register`
command outside the callback\r\nappears to fix the
issue.","sha":"19413b7daae983b95dbb9f5c7b39cb8f3578ebfa","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","backport:prev-minor","v8.6.0","v8.7.0"],"number":146425,"url":"https://github.com/elastic/kibana/pull/146425","mergeCommit":{"message":"[PresentationUtil]
Fix Canvas expression autocomplete (#146425)\n\nFixes #146243 \r\n\r\n##
Summary\r\n\r\nFixes Canvas expression
autocomplete\r\n\r\nhttps://github.com//pull/143739
upgraded the monaco-editor\r\ndependency which uses a callback to the
`onLanguage` method to\r\ninitialize the expressions. The PR moved the
`monaco.languages.register`\r\ncommand inside this callback and which
was never triggered.\r\n\r\nMoving the `monaco.languages.register`
command outside the callback\r\nappears to fix the
issue.","sha":"19413b7daae983b95dbb9f5c7b39cb8f3578ebfa"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146425","number":146425,"mergeCommit":{"message":"[PresentationUtil]
Fix Canvas expression autocomplete (#146425)\n\nFixes #146243 \r\n\r\n##
Summary\r\n\r\nFixes Canvas expression
autocomplete\r\n\r\nhttps://github.com//pull/143739
upgraded the monaco-editor\r\ndependency which uses a callback to the
`onLanguage` method to\r\ninitialize the expressions. The PR moved the
`monaco.languages.register`\r\ncommand inside this callback and which
was never triggered.\r\n\r\nMoving the `monaco.languages.register`
command outside the callback\r\nappears to fix the
issue.","sha":"19413b7daae983b95dbb9f5c7b39cb8f3578ebfa"}}]}]
BACKPORT-->

Co-authored-by: Nick Peihl <[email protected]>
  • Loading branch information
kibanamachine and nickpeihl authored Nov 28, 2022
1 parent 3dbe456 commit 301bd83
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function registerExpressionsLanguage(functions: ExpressionFunction[]) {
expressionsLanguage.keywords = functions.map((fn) => fn.name);
expressionsLanguage.deprecated = functions.filter((fn) => fn.deprecated).map((fn) => fn.name);
monaco.languages.onLanguage(EXPRESSIONS_LANGUAGE_ID, () => {
monaco.languages.register({ id: EXPRESSIONS_LANGUAGE_ID });
monaco.languages.setMonarchTokensProvider(EXPRESSIONS_LANGUAGE_ID, expressionsLanguage);
});
monaco.languages.register({ id: EXPRESSIONS_LANGUAGE_ID });
}

0 comments on commit 301bd83

Please sign in to comment.