Skip to content

Commit

Permalink
Update test data
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad committed May 19, 2020
1 parent 3dd68c1 commit 3e9bf7e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 38 deletions.
2 changes: 2 additions & 0 deletions crates/rust-analyzer/src/lsp_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ pub struct CodeAction {
#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SnippetWorkspaceEdit {
#[serde(skip_serializing_if = "Option::is_none")]
pub changes: Option<HashMap<lsp_types::Url, Vec<lsp_types::TextEdit>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub document_changes: Option<Vec<SnippetDocumentChangeOperation>>,
}

Expand Down
52 changes: 14 additions & 38 deletions crates/rust-analyzer/tests/heavy_tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,29 +333,17 @@ fn main() {}
partial_result_params: PartialResultParams::default(),
work_done_progress_params: WorkDoneProgressParams::default(),
},
json!([
{
"command": {
"arguments": [
json!([{
"edit": {
"documentChanges": [
{
"cursorPosition": null,
"label": "Create module",
"workspaceEdit": {
"documentChanges": [
{
"kind": "create",
"uri": "file:///[..]/src/bar.rs"
}
]
}
"kind": "create",
"uri": "file:///[..]/src/bar.rs"
}
],
"command": "rust-analyzer.applySourceChange",
"title": "Create module"
]
},
"title": "Create module"
}
]),
}]),
);

server.request::<CodeActionRequest>(
Expand Down Expand Up @@ -416,29 +404,17 @@ fn main() {{}}
partial_result_params: PartialResultParams::default(),
work_done_progress_params: WorkDoneProgressParams::default(),
},
json!([
{
"command": {
"arguments": [
json!([{
"edit": {
"documentChanges": [
{
"cursorPosition": null,
"label": "Create module",
"workspaceEdit": {
"documentChanges": [
{
"kind": "create",
"uri": "file:///[..]/src/bar.rs"
}
]
}
"kind": "create",
"uri": "file://[..]/src/bar.rs"
}
],
"command": "rust-analyzer.applySourceChange",
"title": "Create module"
]
},
"title": "Create module"
}
]),
}]),
);

server.request::<CodeActionRequest>(
Expand Down

0 comments on commit 3e9bf7e

Please sign in to comment.