-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for 'xml/executeClientCommand` access to server from extension
Signed-off-by: BoykoAlex <aboyko@pivotal.io>
- Loading branch information
Showing
9 changed files
with
408 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/IXMLCommandService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Pivotal, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Pivotal, Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.lemminx.services; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
import org.eclipse.lsp4j.ExecuteCommandParams; | ||
|
||
/** | ||
* Service available to XML LS extensions to add/remove/execute commands via the XML LS | ||
* | ||
* | ||
* @author Alex Boyko | ||
* | ||
*/ | ||
public interface IXMLCommandService { | ||
|
||
/** | ||
* Command handler to register with the workspace service | ||
*/ | ||
@FunctionalInterface | ||
public interface IDelegateCommandHandler { | ||
|
||
/** | ||
* Executes a command | ||
* @param params command execution parameters | ||
* @return the result of the command | ||
* @throws Exception | ||
*/ | ||
CompletableFuture<Object> executeCommand(ExecuteCommandParams params) throws Exception; | ||
|
||
} | ||
|
||
/** | ||
* Registers a command with the language server | ||
* | ||
* @param commandId unique id of the command | ||
* @param handler command handler function | ||
*/ | ||
void registerCommand(String commandId, IDelegateCommandHandler handler); | ||
|
||
/** | ||
* Unregisters the command from the language server | ||
* | ||
* @param commandId unique id of the command to unregister | ||
*/ | ||
void unregisterCommand(String commandId); | ||
|
||
/** | ||
* Executes a command via the client. The command can be registered by any language server | ||
* | ||
* @param command the LSP command | ||
* @return the result of the command | ||
*/ | ||
CompletableFuture<Object> executeClientCommand(ExecuteCommandParams command); | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/services/IXMLValidationService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Pivotal, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Pivotal, Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.lemminx.services; | ||
|
||
import org.eclipse.lemminx.dom.DOMDocument; | ||
|
||
/** | ||
* XML Document validation service available to XML LS extensions | ||
* | ||
* @author Alex Boyko | ||
* | ||
*/ | ||
public interface IXMLValidationService { | ||
|
||
/** | ||
* Performs XML document validation | ||
* @param document the XML document | ||
*/ | ||
void validate(DOMDocument document); | ||
|
||
} |
Oops, something went wrong.