summaryrefslogtreecommitdiff
path: root/test/lspfixture/dotcomplete.zig
blob: 484f6b866cb492d928b0a99f9953e75074d79faa (plain) (blame)
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
//! A file caught MID-KEYSTROKE, for the lspbench completion probe. Like
//! broken.zig it is NOT built and NOT imported by anything, and like broken.zig
//! its defect is the point.
//!
//! `Tab` after a `.` is the one language query whose normal input does not
//! parse: the user has typed the dot and nothing else, so `switch (s) { . }`
//! loses the entire switch to the parser's error recovery and every ancestor
//! an expected-type resolution needs goes with it. A probe pointed at a
//! FINISHED `.member` would exercise the resolution and none of the repair,
//! and would pass on a backend that cannot answer a real keypress at all.
//!
//! Nothing here comes from std, so what the probe checks does not encode this
//! machine's stdlib. The member names are nonsense words on purpose: they
//! appear on their DECLARATION lines and nowhere else, so a row containing one
//! can only have come from the enum's definition and never from the switch the
//! cursor is sitting in.
pub const Shade = enum {
    verdigris,
    cinnabar,
    orpiment,
};

pub fn pick(s: Shade) u8 {
    return switch (s) {
        .
    };
}