Skip to content

Commit

Permalink
added temporary fix for language providor to appear for more than one…
Browse files Browse the repository at this point in the history
… language

Signed-off-by: Paul Sebastian <[email protected]>
  • Loading branch information
paulstn committed Jul 2, 2024
1 parent aaeb95a commit 423b0fe
Showing 1 changed file with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,31 +127,31 @@ export class CodeEditor extends React.Component<Props, {}> {
this.props.editorWillMount();
}

monaco.languages.onLanguage(this.props.languageId, () => {
if (this.props.suggestionProvider) {
monaco.languages.registerCompletionItemProvider(
this.props.languageId,
this.props.suggestionProvider
);
}

if (this.props.signatureProvider) {
monaco.languages.registerSignatureHelpProvider(
this.props.languageId,
this.props.signatureProvider
);
}

if (this.props.hoverProvider) {
monaco.languages.registerHoverProvider(this.props.languageId, this.props.hoverProvider);
}

if (this.props.languageConfiguration) {
monaco.languages.setLanguageConfiguration(
this.props.languageId,
this.props.languageConfiguration
);
}
// TEMPORARY fix for suggestion providor not appear for more than one language
['SQL', 'kuery'].forEach((language) => {
monaco.languages.onLanguage(language, () => {
if (this.props.suggestionProvider) {
monaco.languages.registerCompletionItemProvider(language, this.props.suggestionProvider);
}

if (this.props.signatureProvider) {
monaco.languages.registerSignatureHelpProvider(
this.props.languageId,
this.props.signatureProvider
);
}

if (this.props.hoverProvider) {
monaco.languages.registerHoverProvider(this.props.languageId, this.props.hoverProvider);
}

if (this.props.languageConfiguration) {
monaco.languages.setLanguageConfiguration(
this.props.languageId,
this.props.languageConfiguration
);
}
});
});

// Register the theme
Expand Down

0 comments on commit 423b0fe

Please sign in to comment.