refactor: share language IDs with indentation configuration
This commit is contained in:
+5
-3
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user