snippets: Fix tabstop completion choices (#31955)

I'm not sure when snippet tabstop choices broke, I checked the parent of
#31872 and they also don't work before that.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-06-05 13:17:41 -06:00 committed by GitHub
parent ccc173ebb1
commit d15d85830a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 56 additions and 33 deletions

View file

@ -4182,6 +4182,20 @@ impl MultiBufferSnapshot {
(start..end, word_kind)
}
pub fn char_kind_before<T: ToOffset>(
&self,
start: T,
for_completion: bool,
) -> Option<CharKind> {
let start = start.to_offset(self);
let classifier = self
.char_classifier_at(start)
.for_completion(for_completion);
self.reversed_chars_at(start)
.next()
.map(|ch| classifier.kind(ch))
}
pub fn is_singleton(&self) -> bool {
self.singleton
}