All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.vespa.schemals.lsp.command.ExecuteCommand Maven / Gradle / Ivy

There is a newer version: 8.465.15
Show newest version
package ai.vespa.schemals.lsp.command;

import java.util.Optional;

import ai.vespa.schemals.context.EventExecuteCommandContext;
import ai.vespa.schemals.lsp.command.commandtypes.SchemaCommand;

/**
 * Responsible for LSP workspace/executeCommand requests.
 */
public class ExecuteCommand {
    public static Object executeCommand(EventExecuteCommandContext context) {
        Optional command = CommandRegistry.getCommand(context.params);

        if (command.isEmpty()) {
            for (Object obj : context.params.getArguments()) {
                context.logger.info(obj.getClass().toString() + " ||| " + obj.toString());
            }
        }

        command.ifPresent(cmd -> cmd.execute(context));
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy