Skip to content

Commit fd6a9a3

Browse files
committed
Configure string literals correctly as atoms in Kotlin
Fixes #860
1 parent 6ad8bc9 commit fd6a9a3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
### Parsing
44

5-
Updated Clojure, Common Lisp and Zig parsers.
5+
Updated Clojure, Common Lisp and Zig parsers. Improved parsing of
6+
Kotlin.
67

78
Text encoding detection is now stricter, fixing more cases where
89
binary files were treated as text.

src/parse/tree_sitter_parser.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,14 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
648648
// structure of complex types within, but it beats
649649
// ignoring nullable changes.
650650
// https://github.com/Wilfred/difftastic/issues/411
651-
atom_nodes: ["line_string_literal", "character_literal", "nullable_type"]
652-
.into_iter()
653-
.collect(),
651+
atom_nodes: [
652+
"nullable_type",
653+
"string_literal",
654+
"line_string_literal",
655+
"character_literal",
656+
]
657+
.into_iter()
658+
.collect(),
654659
delimiter_tokens: vec![("(", ")"), ("{", "}"), ("[", "]"), ("<", ">")]
655660
.into_iter()
656661
.collect(),

0 commit comments

Comments
 (0)