Spring Data repo CA consecutive invocation while "query" is built

This commit is contained in:
aboyko
2023-03-06 19:29:16 -05:00
parent 86fd1e7c3a
commit c2a21e4002
8 changed files with 83 additions and 8 deletions

View File

@@ -95,6 +95,10 @@
class="org.springframework.tooling.ls.eclipse.commons.commands.JavaWorkspaceCommandHanlder"
commandId="java.execute.workspaceCommand">
</handler>
<handler
class="org.springframework.tooling.ls.eclipse.commons.commands.InvokeContentAssistCommandHandler"
commandId="editor.action.triggerSuggest">
</handler>
</extension>
<extension
point="org.eclipse.ui.commands">
@@ -121,6 +125,22 @@
optional="false">
</commandParameter>
</command>
<command
id="editor.action.triggerSuggest"
name="Invoke Content Assist">
<commandParameter
id="org.eclipse.lsp4e.path.param"
name="Resource Path (unnecessary, only to make lsp4e happy)"
optional="true"
typeId="org.eclipse.lsp4e.pathParameterType">
</commandParameter>
<commandParameter
id="org.eclipse.lsp4e.command.param"
name="Command id (unnecessary, only to make lsp4e happy)"
optional="true"
typeId="org.eclipse.lsp4e.commandParameterType">
</commandParameter>
</command>
</extension>
<extension
point="org.eclipse.e4.ui.css.swt.theme">

View File

@@ -0,0 +1,42 @@
/*******************************************************************************
* Copyright (c) 2023 VMware, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* VMware, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.tooling.ls.eclipse.commons.commands;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.NotEnabledException;
import org.eclipse.core.commands.NotHandledException;
import org.eclipse.core.commands.common.NotDefinedException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ICoreRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.progress.UIJob;
public class InvokeContentAssistCommandHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
UIJob.create("Invoke Content Assist", (ICoreRunnable) m -> {
try {
IHandlerService service = HandlerUtil.getActiveWorkbenchWindow(event).getService(IHandlerService.class);
service.executeCommand(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST, null);
} catch (ExecutionException | NotDefinedException | NotEnabledException | NotHandledException e) {
throw new CoreException(Status.error("", e));
}
}).schedule();
return null;
}
}