fix: add `regex` to ignored layer configs

pull/12759/head
Nikita Revenco 2025-02-03 13:48:44 +00:00 committed by Nik Revenco
parent d451077978
commit 56dedd10a7
2 changed files with 4 additions and 6 deletions

View File

@ -1449,14 +1449,13 @@ impl Syntax {
if is_encompassing {
let this_gap = ts_range.end_byte - ts_range.start_byte;
if this_gap < min_gap
// ignore the "comment" language family
// as that would mean we can't uncomment anything, or
// the comments would be incorrect.
// ignore the language family for which it won't make
// sense to consider their comment.
//
// Since uncommenting would attempt to use the comment
// language's non-existing comment tokens
// TODO: add this as a language configuration key?
&& !matches!(self.layer_config(layer_id).language_name.as_ref(), "jsdoc" | "comment")
&& !matches!(self.layer_config(layer_id).language_name.as_ref(), "jsdoc" | "comment" | "regex")
{
best_fit = Some(layer_id);
min_gap = this_gap;

View File

@ -1355,8 +1355,7 @@ scope = "source.svelte"
injection-regex = "svelte"
file-types = ["svelte"]
indent = { tab-width = 2, unit = " " }
comment-token = "//"
block-comment-tokens = { start = "/*", end = "*/" }
block-comment-tokens = { start = "<!--", end = "-->" }
language-servers = [ "svelteserver" ]
[[grammar]]