Skip to content

Commit

Permalink
Missing fields (#543)
Browse files Browse the repository at this point in the history
Error code updates and adds allCommitCharacters.
  • Loading branch information
KamasamaK authored Apr 9, 2021
1 parent ccb3c44 commit d445251
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public class ResponseError {

/**
* A number indicating the error type that occured.
* A number indicating the error type that occurred.
*/
@NonNull
private int code;
Expand All @@ -39,7 +39,7 @@ public void setCode(ResponseErrorCode code) {
}

/**
* A string providing a short decription of the error.
* A string providing a short description of the error.
*/
@NonNull
private String message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,76 @@ public enum ResponseErrorCode {

InternalError(-32603),

serverErrorStart(-32099),
/**
* This is the start range of JSON RPC reserved error codes.
* It doesn't denote a real error code. No LSP error codes should
* be defined between the start and end range. For backwards
* compatibility the {@link #serverNotInitialized} and the
* {@link #UnknownErrorCode} are left in the range.
*
* Since 3.16.0
*/
jsonrpcReservedErrorRangeStart(-32099),

serverErrorEnd(-32000),
/** @deprecated use {@link #jsonrpcReservedErrorRangeStart} */
@Deprecated
serverErrorStart(-32099),

/**
* Error code indicating that a server received a notification or
* request before the server has received the {@code initialize} request.
*
* Should be {@code ServerNotInitialized}
*/
serverNotInitialized(-32002),

UnknownErrorCode(-32001),

RequestCancelled(-32800);
/**
* This is the start range of JSON RPC reserved error codes.
* It doesn't denote a real error code.
*
* Since 3.16.0
*/
jsonrpcReservedErrorRangeEnd(-32000),

/** @deprecated use {@link #jsonrpcReservedErrorRangeEnd} */
@Deprecated
serverErrorEnd(-32000),

/**
* This is the start range of LSP reserved error codes.
* It doesn't denote a real error code.
*
* Since 3.16.0
*/
lspReservedErrorRangeStart(-32899),

/**
* The server detected that the content of a document got
* modified outside normal conditions. A server should
* NOT send this error code if it detects a content change
* in it unprocessed messages. The result even computed
* on an older state might still be useful for the client.
*
* If a client decides that a result is not of any use anymore
* the client should cancel the request.
*/
ContentModified(-32801),

/**
* The client has canceled a request and a server as detected
* the cancel.
*/
RequestCancelled(-32800),

/**
* This is the end range of LSP reserved error codes.
* It doesn't denote a real error code.
*
* Since 3.16.0
*/
lspReservedErrorRangeEnd(-32800);

private final int value;

Expand Down
26 changes: 26 additions & 0 deletions org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend
Original file line number Diff line number Diff line change
Expand Up @@ -2534,6 +2534,19 @@ class CompletionOptions extends AbstractWorkDoneProgressOptions {
*/
List<String> triggerCharacters

/**
* The list of all possible characters that commit a completion. This field
* can be used if clients don't support individual commit characters per
* completion item. See client capability
* {@link CompletionItemCapabilities#commitCharactersSupport}.
*
* If a server provides both {@code allCommitCharacters} and commit characters on
* an individual completion item the ones on the completion item win.
*
* Since 3.2.0
*/
List<String> allCommitCharacters

new() {
}

Expand Down Expand Up @@ -6629,6 +6642,19 @@ class CompletionRegistrationOptions extends AbstractTextDocumentRegistrationAndW
*/
Boolean resolveProvider

/**
* The list of all possible characters that commit a completion. This field
* can be used if clients don't support individual commit characters per
* completion item. See client capability
* {@link CompletionItemCapabilities#commitCharactersSupport}.
*
* If a server provides both {@code allCommitCharacters} and commit characters on
* an individual completion item the ones on the completion item win.
*
* Since 3.2.0
*/
List<String> allCommitCharacters

new() {
}

Expand Down

0 comments on commit d445251

Please sign in to comment.