Convert a byte range for a `$varName` token into an LSP [`Range`] that excludes the leading `$` sigil. The `$` is skipped by advancing `start` by one byte. This is safe because `$` is a single-byte ASCII character and all PHP source files are UTF-8 (or ASCII-compatible).
(content: &str, start: usize, end: usize)
| 260 | /// because `$` is a single-byte ASCII character and all PHP source |
| 261 | /// files are UTF-8 (or ASCII-compatible). |
| 262 | fn variable_range_without_sigil(content: &str, start: usize, end: usize) -> Range { |
| 263 | // Skip the `$` at the start of the token. |
| 264 | let name_start = start + 1; |
| 265 | debug_assert!( |
| 266 | name_start <= end, |
| 267 | "variable token too short to have a name after $" |
| 268 | ); |
| 269 | byte_range_to_lsp_range(content, name_start, end) |
| 270 | } |
| 271 | |
| 272 | /// Collect all LSP [`Range`]s for a variable within the definition |
| 273 | /// region that contains `cursor_offset`. |
no test coverage detected