refactor: share language IDs with indentation configuration

This commit is contained in:
Valdemar Lorenzen
2026-10-14 12:11:26 +02:00
parent 6a43fb9e0c
commit 5580d6fbd4
9 changed files with 41 additions and 16 deletions
+5 -3
View File
@@ -1006,7 +1006,7 @@ mod tests {
r#"
Vamp.configure do |c|
c.tab_spaces = 4
c.language_tab_spaces = { "Ruby" => 2, "Makefile" => nil, "JSON" => 1, "YAML" => 255 }
c.language_tab_spaces = { "ruby" => 2, "makefile" => nil, "json" => 1, "yaml" => 255, "cpp" => 3, "typescriptreact" => 5 }
end
"#,
);
@@ -1021,6 +1021,8 @@ end
("plain.txt", "", " "),
("buffer.json", "", " "),
("buffer.yaml", "", widest.as_str()),
("buffer.cpp", "", " "),
("buffer.tsx", "", " "),
] {
let source = format!("{prefix}αx\nβy");
let path = fixture.file(name, &source);
@@ -1066,7 +1068,7 @@ end
for value in ["0", "-1", "256", "1.5", "true", r#""4""#, "[]", "{}"] {
for assignment in [
format!("c.tab_spaces = {value}"),
format!(r#"c.language_tab_spaces = {{ "Ruby" => {value} }}"#),
format!(r#"c.language_tab_spaces = {{ "ruby" => {value} }}"#),
] {
let config = fixture.file(
"config.rb",
@@ -1079,7 +1081,7 @@ end
"nil",
"[]",
r#"{ "" => 2 }"#,
r#"{ :Ruby => 2 }"#,
r#"{ :ruby => 2 }"#,
r#"{ "\n" => 2 }"#,
] {
let config = fixture.file(