Skip to content

Commit

Permalink
feat: initialize GeneralClientCapabilities
Browse files Browse the repository at this point in the history
Signed-off-by: azerr <azerr@redhat.com>
  • Loading branch information
angelozerr committed Dec 7, 2024
1 parent 860d575 commit badc06b
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,22 @@
public class ClientCapabilitiesFactory {

public static ClientCapabilities create(Object experimental) {
return new ClientCapabilities(
ClientCapabilities clientCapabilities = new ClientCapabilities(
getWorkspaceClientCapabilities(),
getTextDocumentClientCapabilities(),
getWindowClientCapabilities(),
experimental);
clientCapabilities.setGeneral(getGeneralClientCapabilities());
return clientCapabilities;
}

private static GeneralClientCapabilities getGeneralClientCapabilities() {
GeneralClientCapabilities generalCapabilities = new GeneralClientCapabilities();
StaleRequestCapabilities staleRequestCapabilities = new StaleRequestCapabilities();
staleRequestCapabilities.setCancel(true);
generalCapabilities.setStaleRequestSupport(staleRequestCapabilities);
generalCapabilities.setPositionEncodings(List.of(PositionEncodingKind.UTF16));
return generalCapabilities;
}

private static @NotNull WorkspaceClientCapabilities getWorkspaceClientCapabilities() {
Expand Down

0 comments on commit badc06b

Please sign in to comment.