I have Custom Languages created using Xtext.
I want show a documentation with CodeCompletion(ctrl+space) using LSP and need to show it in Intellij.
Like forexample, here function a(): void is shown when we see autocompletion proposals.
Similarly I also want to do that.
I am using below code to set additionContentAssist in org.eclipse.xtext.ide.editor.contentassist.ContentAssistEntry
ContentAssistEntry entry = new ContentAssistEntry();
String additionalProposalInfo = configurableProposal.getAdditionalProposalInfo();
MarkupContent content = new MarkupContent(MarkupKind.MARKDOWN, additionalProposalInfo);
entry.setProposal(proposal);
entry.setDocumentation(content.toString());
In my case, additionalProposalInfo
is some html kind of text
which I want to show in proper readable format.
Actually, In org.eclipse.xtext.ide.server.contentassist.ContentAssistService
, we have this code
where completionItem.setDocumentation(String doc)
needs String.
So, I just sent content.toString
and that’s why its kind of plain String.
I don’t understand how should I send MarkupContent properly to this setDocumentation or what else should I do to show the content in proper readable format.