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
//! # Small shared pieces
//!
//! Each file here is one concept used from more than one layer, which is the only reason a `util` module earns
//! its place: `catch_unwind` is the panic boundary every handler call goes through, `uri` is the one place a URI
//! becomes a path, `position` is the one place a client's line and UTF-16 column becomes a byte offset (and back),
//! `kind` is the one place a declaration's kind becomes the protocol's icon, and `time_cancel_token` is the
//! timeout-plus-cancellation combinator the indexing progress uses.
//!
//! Two files the Lua skeleton had are **gone on purpose**: `desc.rs` (parsing `---@param` doc strings) and
//! `module_name_convert.rs` (`require` module paths) — both are Lua's language, not this server's. The C++
//! equivalents (doc comments, header/source pairing) get their own module when the hover and completion work
//! starts;
pub use catch_unwind;
pub use symbol_kind;
pub use set_locale;
pub use ;
// `position_in_file` is the one a handler wants for a file the VFS is holding; `position_in` is the piece it is
// built from, and what a handler with its own text and line index uses — a declaration in a header this session
// never read, which is why it is public.
pub use time_cancel_token;
pub use ;
/// Is `path` inside `root`, compared the way this server compares paths elsewhere?
///
/// Byte-for-byte only after normalising: Windows compares case-insensitively and spells separators both ways, and the
/// two sides of a comparison like this come from different places — an index's file list and a configuration's root — so
/// a raw `starts_with` answers "outside" for a file the user just wrote. That is the same rule the index's own path
/// keys follow, stated once here so a write boundary and a workspace boundary cannot disagree.