Skip to content

Commit

Permalink
Update types dependency (fix rust-lang#312)
Browse files Browse the repository at this point in the history
- update "languageserver-types" to 0.9.0
- modify initialization params to use `None` in experimental field of ClientCapabilities
- change tests to consider an empty object in client capabilities
  • Loading branch information
Enet4 committed May 12, 2017
1 parent 92f5889 commit 45f6624
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build = "build.rs"
cargo = { git = "https://github.com/rust-lang/cargo" }
derive-new = "0.3"
env_logger = "0.4"
languageserver-types = "0.8.0"
languageserver-types = "0.9.0"
log = "0.3"
racer = "2.0.6"
rls-analysis = "0.2.1"
Expand Down
3 changes: 1 addition & 2 deletions src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use vfs::Vfs;
use server::{self, ServerMessage, Request, Notification, Method, LsService, ParseError, ResponseData};

use ls_types::{ClientCapabilities, TextDocumentPositionParams, TextDocumentIdentifier, TraceOption, Position, InitializeParams};
use serde_json::Value;
use std::time::Duration;
use std::io::{stdin, stdout, Write};
use std::path::Path;
Expand Down Expand Up @@ -121,7 +120,7 @@ fn initialize(root_path: String) -> ServerMessage {
capabilities: ClientCapabilities {
workspace: None,
text_document: None,
experimental: Value::Null,
experimental: None,
},
trace: TraceOption::Off,
};
Expand Down
24 changes: 7 additions & 17 deletions src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn test_hover() {
let url = Url::from_file_path(cache.abs_path(&source_file_path)).expect("couldn't convert file path to URL");
let text_doc = serde_json::to_string(&TextDocumentIdentifier::new(url)).expect("couldn't convert path to JSON");
let messages = vec![Message::new("initialize", vec![("processId", "0".to_owned()),
("capabilities", "{ \"experimental\": null }".to_owned()),
("capabilities", "{}".to_owned()),
("rootPath", root_path),
("rootUri", "null".to_owned()),
("trace", "\"off\"".to_owned())]),
Expand Down Expand Up @@ -116,9 +116,7 @@ fn test_find_all_refs() {
"id": 0,
"params": {
"processId": 0,
"capabilities": {
"experimental": null
},
"capabilities": {},
"rootPath": root_path,
"rootUri": null,
"trace": "off"
Expand Down Expand Up @@ -169,9 +167,7 @@ fn test_find_all_refs_no_cfg_test() {
"id": 0,
"params": {
"processId": 0,
"capabilities": {
"experimental": null
},
"capabilities": {},
"rootPath": root_path,
"rootUri": null,
"trace": "off"
Expand Down Expand Up @@ -217,9 +213,7 @@ fn test_borrow_error() {
"id": 0,
"params": {
"processId": 0,
"capabilities": {
"experimental": null
},
"capabilities": {},
"rootPath": root_path,
"rootUri": null,
"trace": "off"
Expand Down Expand Up @@ -254,9 +248,7 @@ fn test_highlight() {
"id": 0,
"params": {
"processId": 0,
"capabilities": {
"experimental": null
},
"capabilities": {},
"rootPath": root_path,
"rootUri": null,
"trace": "off"
Expand Down Expand Up @@ -303,9 +295,7 @@ fn test_rename() {
"id": 0,
"params": {
"processId": 0,
"capabilities": {
"experimental": null
},
"capabilities": {},
"rootPath": root_path,
"rootUri": null,
"trace": "off"
Expand Down Expand Up @@ -349,7 +339,7 @@ fn test_completion() {
let url = Url::from_file_path(cache.abs_path(&source_file_path)).expect("couldn't convert file path to URL");
let text_doc = serde_json::to_string(&TextDocumentIdentifier::new(url)).expect("couldn't convert path to JSON");
let messages = vec![Message::new("initialize", vec![("processId", "0".to_owned()),
("capabilities", "{ \"experimental\": null }".to_owned()),
("capabilities", "{}".to_owned()),
("rootPath", root_path),
("rootUri", "null".to_owned()),
("trace", "\"off\"".to_owned())]),
Expand Down

0 comments on commit 45f6624

Please sign in to comment.