Configure string literals correctly as atoms in Kotlin

Fixes #860
pull/864/head
Wilfred Hughes 2025-07-11 09:14:43 +07:00
parent 6ad8bc99db
commit fd6a9a365b
2 changed files with 10 additions and 4 deletions

@ -2,7 +2,8 @@
### Parsing
Updated Clojure, Common Lisp and Zig parsers.
Updated Clojure, Common Lisp and Zig parsers. Improved parsing of
Kotlin.
Text encoding detection is now stricter, fixing more cases where
binary files were treated as text.

@ -648,9 +648,14 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
// structure of complex types within, but it beats
// ignoring nullable changes.
// https://github.com/Wilfred/difftastic/issues/411
atom_nodes: ["line_string_literal", "character_literal", "nullable_type"]
.into_iter()
.collect(),
atom_nodes: [
"nullable_type",
"string_literal",
"line_string_literal",
"character_literal",
]
.into_iter()
.collect(),
delimiter_tokens: vec![("(", ")"), ("{", "}"), ("[", "]"), ("<", ">")]
.into_iter()
.collect(),