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

Remove license headers #1235

Merged
merged 2 commits into from
Jan 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/actions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Actions that the RLS can perform: responding to requests, watching files,
//! etc.
10 changes: 0 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! The Rust Language Server.
//!
//! The RLS provides a server that runs in the background, providing IDEs,
10 changes: 0 additions & 10 deletions src/lsp_data.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Types, helpers, and conversions to and from LSP and `racer` types.
use std::error::Error;
10 changes: 0 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! The Rust Language Server.
//!
//! The RLS provides a server that runs in the background, providing IDEs,
9 changes: 0 additions & 9 deletions tests/fixtures/common/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
struct Bar {
x: u64,
}
9 changes: 0 additions & 9 deletions tests/fixtures/find_all_refs_no_cfg_test/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
struct Bar {
x: u64,
}
10 changes: 0 additions & 10 deletions tests/fixtures/workspace_symbol/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

mod x {
pub fn nemo() {}
}
10 changes: 0 additions & 10 deletions tests/fixtures/workspace_symbol_duplicates/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[path="shared.rs"]
mod a;
#[path="shared.rs"]
10 changes: 0 additions & 10 deletions tests/fixtures/workspace_symbol_duplicates/src/shared.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[allow(unused)]
struct Frobnicator;
10 changes: 0 additions & 10 deletions tests/support/harness.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![allow(clippy::expect_fun_call)]

use std::collections::HashMap;
10 changes: 0 additions & 10 deletions tests/support/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use serde_json::{self, json};

use std::env;
10 changes: 0 additions & 10 deletions tests/support/paths.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![allow(unknown_lints)]

use std::cell::Cell;
162 changes: 76 additions & 86 deletions tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use serde_json::{self, json};

use std::io::Write;
@@ -307,27 +297,27 @@ fn cmd_changing_workspace_lib_retains_bin_diagnostics() {
rls.notify(
"textDocument/didChange",
Some(json!({
"contentChanges": [
{
"range": {
"start": {
"line": 1,
"character": 38,
},
"end": {
"line": 1,
"character": 41,
}
"contentChanges": [
{
"range": {
"start": {
"line": 1,
"character": 38,
},
"rangeLength": 3,
"text": "u64"
}
],
"textDocument": {
"uri": format!("file://{}/library/src/lib.rs", root_path.display()),
"version": 0
"end": {
"line": 1,
"character": 41,
}
},
"rangeLength": 3,
"text": "u64"
}
})),
],
"textDocument": {
"uri": format!("file://{}/library/src/lib.rs", root_path.display()),
"version": 0
}
})),
)
.unwrap();

@@ -362,27 +352,27 @@ fn cmd_changing_workspace_lib_retains_bin_diagnostics() {
rls.notify(
"textDocument/didChange",
Some(json!({
"contentChanges": [
{
"range": {
"start": {
"line": 1,
"character": 38,
},
"end": {
"line": 1,
"character": 41,
}
"contentChanges": [
{
"range": {
"start": {
"line": 1,
"character": 38,
},
"rangeLength": 3,
"text": "u32"
}
],
"textDocument": {
"uri": format!("file://{}/library/src/lib.rs", root_path.display()),
"version": 1
"end": {
"line": 1,
"character": 41,
}
},
"rangeLength": 3,
"text": "u32"
}
})),
],
"textDocument": {
"uri": format!("file://{}/library/src/lib.rs", root_path.display()),
"version": 1
}
})),
)
.unwrap();

@@ -478,27 +468,27 @@ fn cmd_implicit_workspace_pick_up_lib_changes() {
rls.notify(
"textDocument/didChange",
Some(json!({
"contentChanges": [
{
"range": {
"start": {
"line": 1,
"character": 23,
},
"end": {
"line": 1,
"character": 26,
}
"contentChanges": [
{
"range": {
"start": {
"line": 1,
"character": 23,
},
"rangeLength": 3,
"text": "bar"
}
],
"textDocument": {
"uri": format!("file://{}/inner/src/lib.rs", root_path.display()),
"version": 0
"end": {
"line": 1,
"character": 26,
}
},
"rangeLength": 3,
"text": "bar"
}
})),
],
"textDocument": {
"uri": format!("file://{}/inner/src/lib.rs", root_path.display()),
"version": 0
}
})),
)
.unwrap();

@@ -520,27 +510,27 @@ fn cmd_implicit_workspace_pick_up_lib_changes() {
rls.notify(
"textDocument/didChange",
Some(json!({
"contentChanges": [
{
"range": {
"start": {
"line": 1,
"character": 23,
},
"end": {
"line": 1,
"character": 26,
}
"contentChanges": [
{
"range": {
"start": {
"line": 1,
"character": 23,
},
"rangeLength": 3,
"text": "foo"
}
],
"textDocument": {
"uri": format!("file://{}/inner/src/lib.rs", root_path.display()),
"version": 1
"end": {
"line": 1,
"character": 26,
}
},
"rangeLength": 3,
"text": "foo"
}
})),
],
"textDocument": {
"uri": format!("file://{}/inner/src/lib.rs", root_path.display()),
"version": 1
}
})),
)
.unwrap();

56 changes: 23 additions & 33 deletions tests/tests_old.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![allow(clippy::cyclomatic_complexity)]

use rls::actions::{notifications, requests};
@@ -144,7 +134,7 @@ fn test_goto_def() {
text_document: TextDocumentIdentifier::new(url),
position: env
.cache
.mk_ls_position(src(&source_file_path, 22, "world")),
.mk_ls_position(src(&source_file_path, 13, "world")),
},
).to_string(),
];
@@ -172,7 +162,7 @@ fn test_goto_def() {
expect_message(
&mut server,
results,
ExpectedMessage::new(Some(11)).expect_contains(r#""start":{"line":20,"character":8}"#),
ExpectedMessage::new(Some(11)).expect_contains(r#""start":{"line":11,"character":8}"#),
);
}

@@ -194,7 +184,7 @@ fn test_hover() {
text_document: TextDocumentIdentifier::new(url),
position: env
.cache
.mk_ls_position(src(&source_file_path, 22, "world")),
.mk_ls_position(src(&source_file_path, 13, "world")),
},
).to_string(),
];
@@ -238,7 +228,7 @@ fn test_hover_after_src_line_change() {

let world_src_pos = env
.cache
.mk_ls_position(src(&source_file_path, 21, "world"));
.mk_ls_position(src(&source_file_path, 12, "world"));
let world_src_pos_after = Position {
line: world_src_pos.line + 1,
..world_src_pos
@@ -261,11 +251,11 @@ fn test_hover_after_src_line_change() {
content_changes: vec![TextDocumentContentChangeEvent {
range: Some(Range {
start: Position {
line: 19,
line: 10,
character: 15,
},
end: Position {
line: 19,
line: 10,
character: 15,
},
}),
@@ -371,7 +361,7 @@ fn test_workspace_symbol() {
.expect_contains(r#"main.rs"#)
.expect_contains(r#""name":"nemo""#)
.expect_contains(r#""kind":12"#)
.expect_contains(r#""range":{"start":{"line":11,"character":11},"end":{"line":11,"character":15}}"#)
.expect_contains(r#""range":{"start":{"line":1,"character":11},"end":{"line":1,"character":15}}"#)
.expect_contains(r#""containerName":"x""#)

// in foo.rs
@@ -431,8 +421,8 @@ fn test_workspace_symbol_duplicates() {
"kind": 23,
"location": {
"range": {
"end": { "line": 11, "character": 18 },
"start": { "line": 11, "character": 7 }
"end": { "line": 1, "character": 18 },
"start": { "line": 1, "character": 7 }
},
"uri": "shared.rs"
},
@@ -457,7 +447,7 @@ fn test_find_all_refs() {
42,
ReferenceParams {
text_document: TextDocumentIdentifier::new(url),
position: env.cache.mk_ls_position(src(&source_file_path, 10, "Bar")),
position: env.cache.mk_ls_position(src(&source_file_path, 1, "Bar")),
context: ReferenceContext {
include_declaration: true,
},
@@ -489,11 +479,11 @@ fn test_find_all_refs() {
results,
ExpectedMessage::new(Some(42))
.expect_contains(
r#"{"start":{"line":9,"character":7},"end":{"line":9,"character":10}}"#,
r#"{"start":{"line":0,"character":7},"end":{"line":0,"character":10}}"#,
).expect_contains(
r#"{"start":{"line":15,"character":14},"end":{"line":15,"character":17}}"#,
r#"{"start":{"line":6,"character":14},"end":{"line":6,"character":17}}"#,
).expect_contains(
r#"{"start":{"line":23,"character":15},"end":{"line":23,"character":18}}"#,
r#"{"start":{"line":14,"character":15},"end":{"line":14,"character":18}}"#,
),
);
}
@@ -515,7 +505,7 @@ fn test_find_all_refs_no_cfg_test() {
42,
ReferenceParams {
text_document: TextDocumentIdentifier::new(url),
position: env.cache.mk_ls_position(src(&source_file_path, 10, "Bar")),
position: env.cache.mk_ls_position(src(&source_file_path, 1, "Bar")),
context: ReferenceContext {
include_declaration: true,
},
@@ -546,9 +536,9 @@ fn test_find_all_refs_no_cfg_test() {
results,
ExpectedMessage::new(Some(42))
.expect_contains(
r#"{"start":{"line":9,"character":7},"end":{"line":9,"character":10}}"#,
r#"{"start":{"line":0,"character":7},"end":{"line":0,"character":10}}"#,
).expect_contains(
r#"{"start":{"line":22,"character":15},"end":{"line":22,"character":18}}"#,
r#"{"start":{"line":13,"character":15},"end":{"line":13,"character":18}}"#,
),
);
}
@@ -603,7 +593,7 @@ fn test_highlight() {
text_document: TextDocumentIdentifier::new(url),
position: env
.cache
.mk_ls_position(src(&source_file_path, 22, "world")),
.mk_ls_position(src(&source_file_path, 13, "world")),
},
).to_string(),
];
@@ -631,9 +621,9 @@ fn test_highlight() {
results,
ExpectedMessage::new(Some(42))
.expect_contains(
r#"{"start":{"line":20,"character":8},"end":{"line":20,"character":13}}"#,
r#"{"start":{"line":11,"character":8},"end":{"line":11,"character":13}}"#,
).expect_contains(
r#"{"start":{"line":21,"character":27},"end":{"line":21,"character":32}}"#,
r#"{"start":{"line":12,"character":27},"end":{"line":12,"character":32}}"#,
),
);
}
@@ -656,7 +646,7 @@ fn test_rename() {
text_document: text_doc,
position: env
.cache
.mk_ls_position(src(&source_file_path, 22, "world")),
.mk_ls_position(src(&source_file_path, 13, "world")),
new_name: "foo".to_owned(),
},
).to_string(),
@@ -686,9 +676,9 @@ fn test_rename() {
results,
ExpectedMessage::new(Some(42))
.expect_contains(
r#"{"start":{"line":20,"character":8},"end":{"line":20,"character":13}}"#,
r#"{"start":{"line":11,"character":8},"end":{"line":11,"character":13}}"#,
).expect_contains(
r#"{"start":{"line":21,"character":27},"end":{"line":21,"character":32}}"#,
r#"{"start":{"line":12,"character":27},"end":{"line":12,"character":32}}"#,
).expect_contains(r#"{"changes""#),
);
}
@@ -1754,7 +1744,7 @@ fn fail_uninitialized_request() {
text_document: TextDocumentIdentifier::new(url),
position: env
.cache
.mk_ls_position(src(&source_file_path, 22, "world")),
.mk_ls_position(src(&source_file_path, 13, "world")),
},
).to_string(),
initialize(1, root_path.as_os_str().to_str().map(|x| x.to_owned())).to_string(),