Skip to content

Commit

Permalink
New API: Port LSCompletionProposal Command Execution (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenporras authored Feb 26, 2023
1 parent f543bf6 commit 0584590
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@
import org.eclipse.lsp4e.LSPEclipseUtils;
import org.eclipse.lsp4e.LanguageServerPlugin;
import org.eclipse.lsp4e.LanguageServerWrapper;
import org.eclipse.lsp4e.command.CommandExecutor;
import org.eclipse.lsp4e.operations.hover.FocusableBrowserInformationControl;
import org.eclipse.lsp4e.ui.LSPImages;
import org.eclipse.lsp4j.Command;
import org.eclipse.lsp4j.CompletionItem;
import org.eclipse.lsp4j.ExecuteCommandParams;
import org.eclipse.lsp4j.InsertReplaceEdit;
import org.eclipse.lsp4j.InsertTextFormat;
import org.eclipse.lsp4j.InsertTextMode;
Expand Down Expand Up @@ -609,7 +610,9 @@ protected void apply(IDocument document, char trigger, int stateMask, int offset
}

if (item.getCommand() != null) {
CommandExecutor.executeCommand(item.getCommand(), document, languageServerWrapper.serverDefinition.id);
Command command = item.getCommand();
languageServerWrapper.execute(ls -> ls.getWorkspaceService()
.executeCommand(new ExecuteCommandParams(command.getCommand(), command.getArguments())));;
}
} catch (BadLocationException ex) {
LanguageServerPlugin.logError(ex);
Expand Down

0 comments on commit 0584590

Please sign in to comment.