Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 6fb840b

Browse files
authored
Merge pull request #313 from Enet4/fix/312
Update language server types, making ClientCapabilities.experimental optional
2 parents 92f5889 + 45f6624 commit 6fb840b

File tree

4 files changed

+12
-23
lines changed

4 files changed

+12
-23
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build = "build.rs"
99
cargo = { git = "https://github.com/rust-lang/cargo" }
1010
derive-new = "0.3"
1111
env_logger = "0.4"
12-
languageserver-types = "0.8.0"
12+
languageserver-types = "0.9.0"
1313
log = "0.3"
1414
racer = "2.0.6"
1515
rls-analysis = "0.2.1"

src/cmd.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use vfs::Vfs;
1818
use server::{self, ServerMessage, Request, Notification, Method, LsService, ParseError, ResponseData};
1919

2020
use ls_types::{ClientCapabilities, TextDocumentPositionParams, TextDocumentIdentifier, TraceOption, Position, InitializeParams};
21-
use serde_json::Value;
2221
use std::time::Duration;
2322
use std::io::{stdin, stdout, Write};
2423
use std::path::Path;
@@ -121,7 +120,7 @@ fn initialize(root_path: String) -> ServerMessage {
121120
capabilities: ClientCapabilities {
122121
workspace: None,
123122
text_document: None,
124-
experimental: Value::Null,
123+
experimental: None,
125124
},
126125
trace: TraceOption::Off,
127126
};

src/test/mod.rs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn test_hover() {
7878
let url = Url::from_file_path(cache.abs_path(&source_file_path)).expect("couldn't convert file path to URL");
7979
let text_doc = serde_json::to_string(&TextDocumentIdentifier::new(url)).expect("couldn't convert path to JSON");
8080
let messages = vec![Message::new("initialize", vec![("processId", "0".to_owned()),
81-
("capabilities", "{ \"experimental\": null }".to_owned()),
81+
("capabilities", "{}".to_owned()),
8282
("rootPath", root_path),
8383
("rootUri", "null".to_owned()),
8484
("trace", "\"off\"".to_owned())]),
@@ -116,9 +116,7 @@ fn test_find_all_refs() {
116116
"id": 0,
117117
"params": {
118118
"processId": 0,
119-
"capabilities": {
120-
"experimental": null
121-
},
119+
"capabilities": {},
122120
"rootPath": root_path,
123121
"rootUri": null,
124122
"trace": "off"
@@ -169,9 +167,7 @@ fn test_find_all_refs_no_cfg_test() {
169167
"id": 0,
170168
"params": {
171169
"processId": 0,
172-
"capabilities": {
173-
"experimental": null
174-
},
170+
"capabilities": {},
175171
"rootPath": root_path,
176172
"rootUri": null,
177173
"trace": "off"
@@ -217,9 +213,7 @@ fn test_borrow_error() {
217213
"id": 0,
218214
"params": {
219215
"processId": 0,
220-
"capabilities": {
221-
"experimental": null
222-
},
216+
"capabilities": {},
223217
"rootPath": root_path,
224218
"rootUri": null,
225219
"trace": "off"
@@ -254,9 +248,7 @@ fn test_highlight() {
254248
"id": 0,
255249
"params": {
256250
"processId": 0,
257-
"capabilities": {
258-
"experimental": null
259-
},
251+
"capabilities": {},
260252
"rootPath": root_path,
261253
"rootUri": null,
262254
"trace": "off"
@@ -303,9 +295,7 @@ fn test_rename() {
303295
"id": 0,
304296
"params": {
305297
"processId": 0,
306-
"capabilities": {
307-
"experimental": null
308-
},
298+
"capabilities": {},
309299
"rootPath": root_path,
310300
"rootUri": null,
311301
"trace": "off"
@@ -349,7 +339,7 @@ fn test_completion() {
349339
let url = Url::from_file_path(cache.abs_path(&source_file_path)).expect("couldn't convert file path to URL");
350340
let text_doc = serde_json::to_string(&TextDocumentIdentifier::new(url)).expect("couldn't convert path to JSON");
351341
let messages = vec![Message::new("initialize", vec![("processId", "0".to_owned()),
352-
("capabilities", "{ \"experimental\": null }".to_owned()),
342+
("capabilities", "{}".to_owned()),
353343
("rootPath", root_path),
354344
("rootUri", "null".to_owned()),
355345
("trace", "\"off\"".to_owned())]),

0 commit comments

Comments
 (0)