editor: Fix adding extraneous closing tags within TSX (#38534)

This commit is contained in:
Smit Barmase
2025-09-20 04:40:22 +05:30
committed by GitHub
parent 8df616e28b
commit be77682a3f
13 changed files with 218 additions and 84 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
use crate::{CharClassifier, CharKind, LanguageScope};
use crate::{CharClassifier, CharKind, CharScopeContext, LanguageScope};
use anyhow::{Context, anyhow};
use imara_diff::{
Algorithm, UnifiedDiffBuilder, diff,
@@ -181,7 +181,8 @@ fn diff_internal(
}
fn tokenize(text: &str, language_scope: Option<LanguageScope>) -> impl Iterator<Item = &str> {
let classifier = CharClassifier::new(language_scope).for_completion(true);
let classifier =
CharClassifier::new(language_scope).scope_context(Some(CharScopeContext::Completion));
let mut chars = text.char_indices();
let mut prev = None;
let mut start_ix = 0;