aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cargo_watch/src/conv/snapshots/ra_cargo_watch__conv__test__snap_multi_line_fix.snap
blob: 0557a2e79ebd607764b99bffeaea624ca9f3d0cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
source: crates/ra_cargo_watch/src/conv/test.rs
expression: diag
---
[
    MappedRustDiagnostic {
        location: Location {
            uri: "file:///test/src/main.rs",
            range: Range {
                start: Position {
                    line: 3,
                    character: 4,
                },
                end: Position {
                    line: 3,
                    character: 5,
                },
            },
        },
        diagnostic: Diagnostic {
            range: Range {
                start: Position {
                    line: 3,
                    character: 4,
                },
                end: Position {
                    line: 3,
                    character: 5,
                },
            },
            severity: Some(
                Warning,
            ),
            code: Some(
                String(
                    "let_and_return",
                ),
            ),
            source: Some(
                "clippy",
            ),
            message: "returning the result of a let binding from a block\n`#[warn(clippy::let_and_return)]` on by default\nfor further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return",
            related_information: Some(
                [
                    DiagnosticRelatedInformation {
                        location: Location {
                            uri: "file:///test/src/main.rs",
                            range: Range {
                                start: Position {
                                    line: 2,
                                    character: 4,
                                },
                                end: Position {
                                    line: 2,
                                    character: 30,
                                },
                            },
                        },
                        message: "unnecessary let binding",
                    },
                ],
            ),
            tags: None,
        },
        fixes: [
            CodeAction {
                title: "return the expression directly",
                kind: Some(
                    "quickfix",
                ),
                diagnostics: None,
                edit: Some(
                    WorkspaceEdit {
                        changes: Some(
                            {
                                "file:///test/src/main.rs": [
                                    TextEdit {
                                        range: Range {
                                            start: Position {
                                                line: 2,
                                                character: 4,
                                            },
                                            end: Position {
                                                line: 2,
                                                character: 30,
                                            },
                                        },
                                        new_text: "",
                                    },
                                    TextEdit {
                                        range: Range {
                                            start: Position {
                                                line: 3,
                                                character: 4,
                                            },
                                            end: Position {
                                                line: 3,
                                                character: 5,
                                            },
                                        },
                                        new_text: "(0..10).collect()",
                                    },
                                ],
                            },
                        ),
                        document_changes: None,
                    },
                ),
                command: None,
                is_preferred: None,
            },
        ],
    },
]