Extract a class name (possibly namespace-qualified) before `::`. `colon_pos` points to the first `:` of `::`.
(chars: &[char], colon_pos: usize)
| 351 | /// |
| 352 | /// `colon_pos` points to the first `:` of `::`. |
| 353 | pub fn extract_class_name_backward(chars: &[char], colon_pos: usize) -> String { |
| 354 | let mut i = colon_pos; |
| 355 | // Skip whitespace |
| 356 | while i > 0 && chars[i - 1] == ' ' { |
| 357 | i -= 1; |
| 358 | } |
| 359 | let end = i; |
| 360 | while i > 0 && (chars[i - 1].is_alphanumeric() || chars[i - 1] == '_' || chars[i - 1] == '\\') { |
| 361 | i -= 1; |
| 362 | } |
| 363 | chars[i..end].iter().collect() |
| 364 | } |
| 365 | |
| 366 | /// Parse the arguments text between `(` and the cursor to determine: |
| 367 | /// - Which parameter names have already been used as named arguments |
no test coverage detected