Search in sources :

Example 1 with DocumentSymbolRegistrationOptions

use of org.eclipse.lsp4j.DocumentSymbolRegistrationOptions in project lxtk by lxtk-org.

the class DocumentSymbolFeature method initialize.

@Override
void initialize(ServerCapabilities capabilities, List<DocumentFilter> documentSelector) {
    if (documentSelector == null)
        return;
    Either<Boolean, DocumentSymbolOptions> capability = capabilities.getDocumentSymbolProvider();
    if (capability == null || !(capability.isRight() || Boolean.TRUE.equals(capability.getLeft())))
        return;
    DocumentSymbolRegistrationOptions registerOptions = new DocumentSymbolRegistrationOptions();
    registerOptions.setDocumentSelector(documentSelector);
    DocumentSymbolOptions options = capability.getRight();
    if (options != null) {
        registerOptions.setWorkDoneProgress(options.getWorkDoneProgress());
        registerOptions.setLabel(options.getLabel());
    }
    register(new Registration(UUID.randomUUID().toString(), METHOD, registerOptions));
}
Also used : DocumentSymbolRegistrationOptions(org.eclipse.lsp4j.DocumentSymbolRegistrationOptions) DocumentSymbolOptions(org.eclipse.lsp4j.DocumentSymbolOptions) Registration(org.eclipse.lsp4j.Registration)

Aggregations

DocumentSymbolOptions (org.eclipse.lsp4j.DocumentSymbolOptions)1 DocumentSymbolRegistrationOptions (org.eclipse.lsp4j.DocumentSymbolRegistrationOptions)1 Registration (org.eclipse.lsp4j.Registration)1