diff --git a/docs/index.html b/docs/index.html index 673d25a529..8d00635e91 100644 --- a/docs/index.html +++ b/docs/index.html @@ -205,6 +205,18 @@

Summary

+ + + /receive_messages + + + POST + + +

Long poll for asynchronous server messages.

+ + + /run_completer_command @@ -878,7 +890,7 @@

POST /event_

The server needs to react to a number of client events in order to - provide things like diagnotics and to handler downstream server states + provide things like diagnostics and to handle downstream server states etc. The client must inform the server of the following events, populating the event name in the event_name property:

    @@ -886,11 +898,11 @@

    POST /event_ Call when a new buffer is opened or after the user has stopped typing for some time, or at any other time when the client believes that it is worthwhile reparsing the current file and - updating semantic engines'' ASTs and reporting things like updated + updating semantic engines' ASTs and reporting things like updated diagnostics. -
  • BufferUnload (optional) +
  • BufferUnload Call when the user closes a buffer that was previously known to be - open.
  • + open. Closing buffers is important to limit resource usage.
  • BufferVisit (optional) Call when the user focusses on a buffer that is already known. Note: The ultisnips_snippets property is optional when firing @@ -1164,9 +1176,9 @@

    POST /filter

    For filetypes not natively supported by ycmd, clients can often determine a set of suitable candidate completion suggestions by other - means. In Vim this is is typically from the omnifunc and other - clients will have equivalents.

    -

    This endpoint allows clients to use ycmd''s powerful filtering and + means. In Vim this is typically from the omnifunc and other clients + will have equivalents.

    +

    This endpoint allows clients to use ycmd's powerful filtering and ranking capabilities (including longest-common-subsequence and word-boundary-character ranking) on arbitrary sets of identifiers.

    NOTE: This API is primarily intended for use when subclassing the @@ -1558,6 +1570,127 @@

    POST /load_e

+ +
+
+
Long poll for asynchronous server messages.
+

POST /receive_messages

+
+
+
+

Return asynchronous messages from the server. This request is + used by clients in a "long poll" style, and does not return until + either:

+
    +
  • A message (or messages) becomes available, in which case a list of + messages is returned, or
  • +
  • a timeout occurs (after 60s), in which case true is returned and + the client should re-send this request, or
  • +
  • for some reason the server determined that the client should stop + sending receive_messages requests, in which case false is + returned, and the client should only send the request again when + something substantial changes such as a new file type is opened, or + the completer server is manually restarted.
  • +
+

The following types of event are delivered asynchronously for certain + filetypes:

+
    +
  • Status messages to be displayed unobtrusively to the user.
  • +
  • Diagnostics (for Java only).
  • +
+

This message is optional. Clients do not require to implement this + method, but it is strongly recommended for certain languages to offer + the best user experience.

+ +
+ + +
+ +
+
+

The context data, including the current cursor position, and details + of dirty buffers.

+

+
+
+
+ +
+
+
+ +
+

+

+ +
+
+ 200 OK + +
+
+
+
+

Messages are ready, the request timed out, or the request + is not supported and should not be retried.

+

The response may be one of MessagePollResponse or + MessagesList.

+ +
+
+
+
+
Example for application/json
+
[
{
"message": "Initializing: 19% complete"
},
{
"message": "Initializing: Done."
},
{
"diagonostics": {
"diagnotics": [
{
"fixit_available": false,
"kind": "WARNING",
"location": {
"column_num": 11,
"filepath": "/file",
"line_num": 10
}
,
"location_extent": {
"end": {
"column_num": 11,
"filepath": "/file",
"line_num": 10
}
,
"start": {
"column_num": 11,
"filepath": "/file",
"line_num": 10
}
}
,
"ranges": [
{
"end": {
"column_num": 20,
"filepath": "/file",
"line_num": 10
}
,
"start": {
"column_num": 11,
"filepath": "/file",
"line_num": 10
}
}
]
,
"text": "Very naughty code!"
},
{
"fixit_available": true,
"kind": "ERROR",
"location": {
"column_num": 11,
"filepath": "/file",
"line_num": 19
}
,
"location_extent": {
"end": {
"column_num": 11,
"filepath": "/file",
"line_num": 19
}
,
"start": {
"column_num": 11,
"filepath": "/file",
"line_num": 19
}
}
,
"ranges": [
{
"end": {
"column_num": 20,
"filepath": "/file",
"line_num": 19
}
,
"start": {
"column_num": 11,
"filepath": "/file",
"line_num": 19
}
}
]
,
"text": "Very dangerous code!"
}
]
,
"filepath": "/file"
}
}
]
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+ 500 Internal Server Error + +
+
+
+
+

An error occurred.

+ +
+
+
+ +
+
+ +
+
+
+
+
+
@@ -1575,14 +1708,14 @@

POST /run_co which is the command name followed by any command- and completer-specific additional arguments. This "command line" is passed in the command_arguments property.

-

The list of available subcommands for a particular semantic compelter +

The list of available subcommands for a particular semantic completer can be queried using the /defined_subcommands endpoint.

Subcommands may return one of a number of actions, depending on the type of command. The following types of response are returned:

  • A simple display message response. This is identified where the type of the response is scalar (i.e. boolean, number, string) or the - type of the response is am obkect with a message property. These + type of the response is an object with a message property. These messages are typically only a single line and can be displayed in a message-box or similarly echoed in a status bar or equivalent.
  • A FixIt response. This is identified where the type of the response @@ -2461,6 +2594,10 @@

    DiagnosticData WARNING , ERROR + , + INFORMATION + , + HINT } @@ -2470,7 +2607,9 @@

    DiagnosticData

    The type of diagnostic being reported. Typically semantic engines will - differentiate between warnings and fatal errors.

    + differentiate between warnings and fatal errors. Informational and + hint messages should be treated as warnings where the client does not + differentiate.

    @@ -2519,6 +2658,67 @@

    Diagnostic

+
+
+

DiagnosticsMessage: + + object + + + +

+
+
+
+

Diagnostics for a particular file. Note: diagnostics may be supplied for + any arbitrary file. The client is responsible for displaying the + diagnostics in an appropriate manner. The server supplies an empty set of + diagnostics to clear the diagnostics for a particular file.

+ +
+ +
+
+
+ filpath: + + FilePath + + + +
+
+ +
+ +
+
+
+ diagnotics: + + object[] + + +
+
+ +
+ +
+ + DiagnosticData + + + +
+ +
+
+
+
+
+
+

Exception: @@ -2666,7 +2866,7 @@

FileData:
-

The entire contents of the buffer encoded as UTF-8

+

The entire contents of the buffer encoded as UTF-8.

@@ -2689,7 +2889,15 @@

FileDataMap:

An object mapping whose keys are the absolute paths to the - files and whose values are data relating to dirty buffers.

+ files and whose values are data relating unsaved buffers.

+

An unsaved buffer is any file that is opened in the editor and has been + changed without saving the contents to disk.

+

The file referred to in the request filepath entry must always be + included. For most requests this is the user's current buffer, but may + be any buffer (e.g. in the case of closing a buffer which is not current).

+

When a file is closed in the editor, a BufferUnload event should be sent + and the file should not be included in further FileDataMap entries + until (or unless) it is opened and changed again.

@@ -2966,6 +3174,117 @@

Location:

+
+
+

Message: + + object + + + +

+
+
+
+

An object containing a single asynchronous message. + It is either a SimpleDisplayMessage or a DiagnosticsMessage

+ +
+ +
+
+
+ message: + + SimpleDisplayMessage + + + +
+
+

If present, this object is a SimpleDisplayMessage

+ +
+ +
+
+
+ diagnostics: + + DiagnosticsMessage + + + +
+
+

If present, this object is a DiagnosticsMessage

+ +
+ +
+
+
+
+
+
+
+
+

MessageList: + + object[] + + + +

+
+
+
+

A list of messages in the sequence they should be handled.

+

The type of message in each item is determined by the property name:

+
    +
  • An object with a property message is a simple display message where + the property value is the message.
  • +
  • An object with a property diagnostics contains diagnotics for a + project file. The value of the property is described below.
  • +
+ +
+ +
+ + Message + + + +
+ +
+
+
+
+
+

MessagePollResponse: + + boolean + + + +

+
+
+
+

When true is returned, the request timed out (meaning no + messages were returned in the poll period). Clients should + send another receive_messages request immediately.

+

When false is returned, the server determined that message + polling should abort for the current file type context. Clients + should not re-send this request until the filetype being edited + changes or the server is restarted.

+ +
+ +
+

Range: @@ -3178,6 +3497,26 @@

ServerData:

+
+
+

SimpleDisplayMessage: + + string + + + +

+
+
+
+

A message for display to the user. Note: the message should be displayed + discreetly (such as in a status bar) and should not block the user or + interrupt them.

+ +
+ +
+

SimpleRequest: diff --git a/docs/openapi.yaml b/docs/openapi.yml similarity index 99% rename from docs/openapi.yaml rename to docs/openapi.yml index d10df6494b..c59225df67 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yml @@ -162,7 +162,7 @@ definitions: type: string contents: type: string - description: The entire contents of the buffer encoded as UTF-8 + description: The entire contents of the buffer encoded as UTF-8. FileDataMap: type: object description: |- @@ -584,14 +584,14 @@ paths: summary: Notify the server of various client events. description: |- The server needs to react to a number of client events in order to - provide things like diagnotics and to handler downstream server states + provide things like diagnostics and to handle downstream server states etc. The client must inform the server of the following events, populating the event name in the `event_name` property: - `FileReadyToParse` Call when a new buffer is opened or after the user has stopped typing for some time, or at any other time when the client believes that it is worthwhile reparsing the current file and - updating semantic engines'' ASTs and reporting things like updated + updating semantic engines' ASTs and reporting things like updated diagnostics. - `BufferUnload` Call when the user closes a buffer that was previously known to be @@ -702,7 +702,7 @@ paths: completer-specific additional arguments. This "command line" is passed in the `command_arguments` property. - The list of available subcommands for a particular semantic compelter + The list of available subcommands for a particular semantic completer can be queried using the `/defined_subcommands` endpoint. Subcommands may return one of a number of actions, depending on the @@ -710,7 +710,7 @@ paths: - A *simple display message* response. This is identified where the type of the response is scalar (i.e. boolean, number, string) or the - type of the response is am obkect with a `message` property. These + type of the response is an object with a `message` property. These messages are typically only a single line and can be displayed in a message-box or similarly echoed in a status bar or equivalent. - A *FixIt* response. This is identified where the type of the response @@ -892,10 +892,10 @@ paths: description: |- For filetypes not natively supported by ycmd, clients can often determine a set of suitable candidate completion suggestions by other - means. In Vim this is is typically from the `omnifunc` and other - clients will have equivalents. + means. In Vim this is typically from the `omnifunc` and other clients + will have equivalents. - This endpoint allows clients to use ycmd''s powerful filtering and + This endpoint allows clients to use ycmd's powerful filtering and ranking capabilities (including longest-common-subsequence and word-boundary-character ranking) on arbitrary sets of identifiers. @@ -1246,8 +1246,8 @@ paths: The following types of event are delivered asynchronously for certain filetypes: - - Status messages to be displayed unobtrusively to the user - - Diagnostics (for Java only) + - Status messages to be displayed unobtrusively to the user. + - Diagnostics (for Java only). This message is optional. Clients do not require to implement this method, but it is strongly recommended for certain languages to offer diff --git a/update_api_docs.py b/update_api_docs.py index e5e4728eaf..766f091677 100755 --- a/update_api_docs.py +++ b/update_api_docs.py @@ -55,7 +55,7 @@ def GenerateApiDocs(): bootprint = FindExecutable( os.path.join( DIR_OF_DOCS, 'node_modules', '.bin', 'bootprint' ) ) - api = os.path.join( DIR_OF_DOCS, 'openapi.yaml' ) + api = os.path.join( DIR_OF_DOCS, 'openapi.yml' ) subprocess.call( [ bootprint, 'openapi', api, DIR_OF_DOCS ] )