Skip to content

Commit

Permalink
apply changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
jnt0r committed Sep 12, 2023
1 parent acea2af commit 95dd2ea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.util.concurrent.CompletableFuture;

import org.eclipse.lsp4j.ClientCapabilities;
import org.eclipse.lsp4j.DidChangeNotebookDocumentParams;
import org.eclipse.lsp4j.DidChangeWorkspaceFoldersParams;
import org.eclipse.lsp4j.InitializeParams;
import org.eclipse.lsp4j.InitializeResult;
Expand Down Expand Up @@ -80,7 +79,6 @@ public void testInitializeWithWorkspaceFolders() throws Exception {
new WorkspaceFolder(uriExtensions.toUriString(rootFolder2.toURI()), "root2")));
});
Assert.assertEquals(true, capabilities.getCapabilities().getWorkspace().getWorkspaceFolders().getSupported());
;
Assert.assertEquals(2, getDiagnostics().size());
Assert.assertEquals(1, getDiagnostics().get(twoUri).size());
withBuild(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
result.setCapabilities(createServerCapabilities(params));
access.addBuildListener(this);
return requestManager.runWrite(() -> {
if (isWorkspaceFoldersSupported() && workspaceManager.isSupportsWorkspaceFolders()) {
if (clientSupportsWorkspaceFolders() && workspaceManager.isSupportsWorkspaceFolders()) {
List<WorkspaceFolder> workspaceFolders = params.getWorkspaceFolders();
if (workspaceFolders == null)
workspaceFolders = Collections.emptyList();
Expand All @@ -244,7 +244,7 @@ public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
}, (cancelIndicator, it) -> it).thenApply(it -> initializeResult = it);
}

protected boolean isWorkspaceFoldersSupported() {
protected boolean clientSupportsWorkspaceFolders() {
return this.initializeParams.getCapabilities() != null
&& this.initializeParams.getCapabilities().getWorkspace() != null
&& this.initializeParams.getCapabilities().getWorkspace().getWorkspaceFolders() == Boolean.TRUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ abstract class AbstractLanguageServerTest implements Endpoint {
new WorkspaceFolder(root.toURI.normalize.toUriString, '')
]
]
initializer?.apply(params)
if (!useRootPath) {
if (params.capabilities === null) {
params.capabilities = new ClientCapabilities
Expand All @@ -239,6 +238,7 @@ abstract class AbstractLanguageServerTest implements Endpoint {
}
params.capabilities.workspace.workspaceFolders = true
}
initializer?.apply(params)
hierarchicalDocumentSymbolSupport = params.capabilities?.textDocument?.documentSymbol?.
hierarchicalDocumentSymbolSupport ?: false;
val result = languageServer.initialize(params).get
Expand Down

0 comments on commit 95dd2ea

Please sign in to comment.