Are there any examples of color provider?
javaduke opened this issue · 3 comments
I'm working on implementing a language server using LSP4J for a custom language, and I couldn't find any example of how to create a color provider. I understand I have to have res.getCapabilities().setColorProvider(Boolean.TRUE);
but then it's not quite clear to me what information should I return in documentColor
method. Any example or tutorial would help.
Hi. You can check bsl language server:
LemMinx, the XML language server used in Eclipse IDE and vscode provides color support https://github.com/redhat-developer/vscode-xml/blob/main/docs/Features/XMLColorsFeatures.md
LemMinx which is extensible works with participant, here the participant which support colors https://github.com/eclipse/lemminx/blob/main/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/colors/participants/XMLDocumentColorParticipant.java
You can see some test at
Perfect, exactly what I was looking for.