Reputation: 974
Is there a way of having a clickable link on autocompletion's documentation? I tried adding raw HTML and it's being escaped for security reasons (and that's a good thing).
Cheers!
Upvotes: 1
Views: 662
Reputation: 14472
Yes, it's possible: the doc states that completionitem.documentation can either be a string, or a IMarkdownString
.
So to add a link, just use the markdown syntax instead of pure HTML. For example:
monaco.languages.registerCompletionItemProvider('json', {
provideCompletionItems: function(model, position) {
return [{
label: '"nullif(expression)"',
kind: monaco.languages.CompletionItemKind.Function,
documentation: {
value: "The NULLIF function... [see Google](https://www.google.com)"
},
insertText: '"nullif(expression)"'
}];
}
});
Upvotes: 3