Skip to content

Commit

Permalink
fix WorkspaceFolder setup in some testclasses
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Pollert <[email protected]>
  • Loading branch information
jnt0r committed Nov 5, 2023
1 parent b555226 commit f8b281a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void testExecute() throws Exception {
initialize((InitializeParams it) -> {
ClientCapabilities clientCapabilities = new ClientCapabilities();
WorkspaceClientCapabilities workspaceClientCapabilities = new WorkspaceClientCapabilities();
workspaceClientCapabilities.setWorkspaceFolders(true);
workspaceClientCapabilities.setExecuteCommand(new ExecuteCommandCapabilities(true));
clientCapabilities.setWorkspace(workspaceClientCapabilities);
it.setCapabilities(clientCapabilities);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
import org.eclipse.lsp4j.DocumentSymbolCapabilities;
import org.eclipse.lsp4j.InitializeParams;
import org.eclipse.lsp4j.TextDocumentClientCapabilities;
import org.eclipse.lsp4j.WorkspaceClientCapabilities;
import org.eclipse.xtext.testing.DocumentSymbolConfiguration;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.junit.Test;

public class HierarchicalDocumentSymbolTest extends AbstractTestLangLanguageServerTest {
private static final Procedure1<? super InitializeParams> INITIALIZER = (InitializeParams it) -> {
ClientCapabilities clientCapabilities = new ClientCapabilities();
WorkspaceClientCapabilities workspaceClientCapabilities = new WorkspaceClientCapabilities();
workspaceClientCapabilities.setWorkspaceFolders(true);
clientCapabilities.setWorkspace(workspaceClientCapabilities);
DocumentSymbolCapabilities documentSymbolCapabilities = new DocumentSymbolCapabilities();
documentSymbolCapabilities.setHierarchicalDocumentSymbolSupport(true);
TextDocumentClientCapabilities textDocumentClientCapabilities = new TextDocumentClientCapabilities();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ private InitializeResult initializeWithPrepareSupport() {
return super.initialize((InitializeParams params) -> {
ClientCapabilities clientCapabilities = new ClientCapabilities();
WorkspaceClientCapabilities workspaceClientCapabilities = new WorkspaceClientCapabilities();
workspaceClientCapabilities.setWorkspaceFolders(true);
clientCapabilities.setWorkspace(workspaceClientCapabilities);
TextDocumentClientCapabilities textDocumentClientCapabilities = new TextDocumentClientCapabilities();
textDocumentClientCapabilities.setRename(new RenameCapabilities(true, false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ protected InitializeResult initialize() {
return super.initialize((InitializeParams params) -> {
ClientCapabilities clientCapabilities = new ClientCapabilities();
WorkspaceClientCapabilities workspaceClientCapabilities = new WorkspaceClientCapabilities();
workspaceClientCapabilities.setWorkspaceFolders(true);
WorkspaceEditCapabilities workspaceEditCapabilities = new WorkspaceEditCapabilities();
workspaceEditCapabilities.setDocumentChanges(true);
workspaceClientCapabilities.setWorkspaceEdit(workspaceEditCapabilities);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ protected InitializeResult initialize() {
return super.initialize((InitializeParams params) -> {
ClientCapabilities clientCapabilities = new ClientCapabilities();
WorkspaceClientCapabilities workspaceClientCapabilities = new WorkspaceClientCapabilities();
workspaceClientCapabilities.setWorkspaceFolders(true);
WorkspaceEditCapabilities workspaceEditCapabilities = new WorkspaceEditCapabilities();
workspaceEditCapabilities.setDocumentChanges(true);
workspaceClientCapabilities.setWorkspaceEdit(workspaceEditCapabilities);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.eclipse.lsp4j.RenameParams;
import org.eclipse.lsp4j.TextDocumentClientCapabilities;
import org.eclipse.lsp4j.TextDocumentIdentifier;
import org.eclipse.lsp4j.WorkspaceClientCapabilities;
import org.eclipse.lsp4j.WorkspaceEdit;
import org.eclipse.lsp4j.jsonrpc.ResponseErrorException;
import org.eclipse.lsp4j.jsonrpc.messages.Either3;
Expand Down Expand Up @@ -103,6 +104,9 @@ protected void renameWithSuccess(String model, Position position) throws Excepti
String modelFile = writeFile("MyType.testlang", model);
initialize((InitializeParams params) -> {
ClientCapabilities clientCapabilities = new ClientCapabilities();
WorkspaceClientCapabilities workspaceCapabilities = new WorkspaceClientCapabilities();
workspaceCapabilities.setWorkspaceFolders(true);
clientCapabilities.setWorkspace(workspaceCapabilities);
TextDocumentClientCapabilities textDocumentClientCapabilities = new TextDocumentClientCapabilities();
textDocumentClientCapabilities.setRename(new RenameCapabilities(true, false));
clientCapabilities.setTextDocument(textDocumentClientCapabilities);
Expand Down

0 comments on commit f8b281a

Please sign in to comment.