Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for 'xml/executeClientCommand' protocol extension #543

Closed
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions org.eclipse.wildwebdeveloper.xml/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ Automatic-Module-Name: org.eclipse.wildwebdeveloper.xml
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.tm4e.registry;bundle-version="0.3.0",
org.eclipse.tm4e.ui;bundle-version="0.1.0",
org.eclipse.lsp4e;bundle-version="0.5.0",
org.eclipse.lsp4e;bundle-version="0.13.4",
org.eclipse.lsp4j;bundle-version="0.9.0",
org.eclipse.core.filesystem;bundle-version="1.7.0",
org.eclipse.core.resources;bundle-version="3.12.0",
org.eclipse.core.runtime;bundle-version="3.10.0",
org.eclipse.ui;bundle-version="3.105.0",
org.eclipse.ui.ide;bundle-version="3.14.0",
org.eclipse.ui.genericeditor;bundle-version="1.0.0",
org.eclipse.core.net;bundle-version="1.3.0"
org.eclipse.core.net;bundle-version="1.3.0",
org.eclipse.lsp4j.jsonrpc,
org.eclipse.text
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.wildwebdeveloper.xml.internal.Activator
Export-Package: org.eclipse.wildwebdeveloper.xml;x-friends:="org.eclipse.m2e.editor.lemminx"
1 change: 1 addition & 0 deletions org.eclipse.wildwebdeveloper.xml/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
point="org.eclipse.lsp4e.languageServer">
<server
class="org.eclipse.wildwebdeveloper.xml.internal.XMLLanguageServer"
clientImpl="org.eclipse.wildwebdeveloper.xml.internal.XmlLanguageClientImpl"
id="org.eclipse.wildwebdeveloper.xml"
label="XML Language Server"
singleton="true">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.eclipse.wildwebdeveloper.xml.internal;

import java.util.concurrent.CompletableFuture;

import org.eclipse.lsp4j.ExecuteCommandParams;
import org.eclipse.lsp4j.jsonrpc.services.JsonRequest;

public interface XMLLanguageClient {

@JsonRequest("xml/executeClientCommand")
CompletableFuture<Object> executeClientCommand(ExecuteCommandParams params);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.eclipse.wildwebdeveloper.xml.internal;

import java.util.concurrent.CompletableFuture;

import org.eclipse.lsp4e.LanguageClientImpl;
import org.eclipse.lsp4e.command.CommandExecutor;
import org.eclipse.lsp4j.Command;
import org.eclipse.lsp4j.ExecuteCommandParams;

@SuppressWarnings("restriction")
public class XmlLanguageClientImpl extends LanguageClientImpl implements XMLLanguageClient{

public CompletableFuture<Object> executeClientCommand(ExecuteCommandParams params) {
Command cmd = new Command();
cmd.setCommand(params.getCommand());
cmd.setArguments(params.getArguments());
return CommandExecutor.executeCommand(cmd, null, null);
}

}
2 changes: 1 addition & 1 deletion target-platform/target-platform.target
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<unit id="org.eclipse.mylyn.wikitext_feature.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/lsp4e/releases/latest/"/>
<repository location="https://download.eclipse.org/lsp4e/snapshots/"/>
<unit id="org.eclipse.lsp4e" version="0.0.0"/>
<unit id="org.eclipse.lsp4e.debug" version="0.0.0"/>
<unit id="org.eclipse.lsp4j" version="0.0.0"/>
Expand Down