Skip to content

Commit

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

## Summary

Fixes Canvas expression autocomplete

#143739 upgraded the monaco-editor
dependency which uses a callback to the `onLanguage` method to
initialize the expressions. The PR moved the `monaco.languages.register`
command inside this callback and which was never triggered.

Moving the `monaco.languages.register` command outside the callback
appears to fix the issue.
  • Loading branch information
nickpeihl authored Nov 28, 2022
1 parent 55b5972 commit 19413b7
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 19413b7

Please sign in to comment.