Search in sources :

Example 1 with DocumentSymbolOptions

use of org.eclipse.lsp4j.DocumentSymbolOptions in project OberonEmulator by schierlm.

the class Server method fillCapabilities.

protected void fillCapabilities(ServerCapabilities cap, InitializeParams params) {
    cap.setTextDocumentSync(TextDocumentSyncKind.Full);
    cap.setSemanticTokensProvider(new SemanticTokensWithRegistrationOptions(new SemanticTokensLegend(Bridge.TOKEN_TYPES, Bridge.TOKEN_MODIFIERS), new SemanticTokensServerFull(false), false));
    cap.setDocumentSymbolProvider(new DocumentSymbolOptions("Oberon"));
    cap.setCompletionProvider(new CompletionOptions(false, null));
    cap.setDefinitionProvider(true);
    cap.setDocumentHighlightProvider(true);
    cap.setReferencesProvider(true);
    cap.setLinkedEditingRangeProvider(true);
    cap.setSignatureHelpProvider(new SignatureHelpOptions(Arrays.asList("("), Arrays.asList(",", ")")));
    cap.setFoldingRangeProvider(true);
    cap.setHoverProvider(true);
    cap.setRenameProvider(new RenameOptions(true));
    cap.setDocumentFormattingProvider(true);
    cap.setCallHierarchyProvider(true);
    CodeActionOptions cao = new CodeActionOptions(Arrays.asList(CodeActionKind.QuickFix));
    cao.setResolveProvider(true);
    cap.setCodeActionProvider(cao);
}
Also used : CompletionOptions(org.eclipse.lsp4j.CompletionOptions) RenameOptions(org.eclipse.lsp4j.RenameOptions) SignatureHelpOptions(org.eclipse.lsp4j.SignatureHelpOptions) DocumentSymbolOptions(org.eclipse.lsp4j.DocumentSymbolOptions) CodeActionOptions(org.eclipse.lsp4j.CodeActionOptions) SemanticTokensLegend(org.eclipse.lsp4j.SemanticTokensLegend) SemanticTokensServerFull(org.eclipse.lsp4j.SemanticTokensServerFull) SemanticTokensWithRegistrationOptions(org.eclipse.lsp4j.SemanticTokensWithRegistrationOptions)

Example 2 with DocumentSymbolOptions

use of org.eclipse.lsp4j.DocumentSymbolOptions 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)2 CodeActionOptions (org.eclipse.lsp4j.CodeActionOptions)1 CompletionOptions (org.eclipse.lsp4j.CompletionOptions)1 DocumentSymbolRegistrationOptions (org.eclipse.lsp4j.DocumentSymbolRegistrationOptions)1 Registration (org.eclipse.lsp4j.Registration)1 RenameOptions (org.eclipse.lsp4j.RenameOptions)1 SemanticTokensLegend (org.eclipse.lsp4j.SemanticTokensLegend)1 SemanticTokensServerFull (org.eclipse.lsp4j.SemanticTokensServerFull)1 SemanticTokensWithRegistrationOptions (org.eclipse.lsp4j.SemanticTokensWithRegistrationOptions)1 SignatureHelpOptions (org.eclipse.lsp4j.SignatureHelpOptions)1