Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change message params types to match JSON-RPC spec #373

Merged
merged 3 commits into from Mar 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions specification.md
Expand Up @@ -89,7 +89,7 @@ interface RequestMessage extends Message {
/**
* The method's params.
*/
params?: any
params?: Array<any> | object;
}
```

Expand Down Expand Up @@ -164,7 +164,7 @@ interface NotificationMessage extends Message {
/**
* The notification's params.
*/
params?: any
params?: Array<any> | object;
}
```

Expand Down Expand Up @@ -195,6 +195,8 @@ A request that got canceled still needs to return from the server and send a res

The language server protocol defines a set of JSON-RPC request, response and notification messages which are exchanged using the above base protocol. This section starts describing the basic JSON structures used in the protocol. The document uses TypeScript interfaces to describe these. Based on the basic JSON structures, the actual requests with their responses and the notifications are described.

In general, the language server protocol supports JSON-RPC messages, however the base protocol defined here uses a convention such that the parameters passed to request/notification messages should be of `object` type (if passed at all). However, this does not disallow using `Array` parameter types in custom messages.

The protocol currently assumes that one server serves one tool. There is currently no support in the protocol to share one server between different tools. Such a sharing would require additional protocol to either lock a document to support concurrent editing.

### Basic JSON Structures
Expand Down