Commit Graph

3 Commits

Author SHA1 Message Date
Sergej Jaskiewicz 0008e832d8 [PowerAssert] Improve the accuracy of locating infix operator tokens
Use KotlinLexer to determine the correct offset of an infix operator
token instead of skipping whitespaces after the operator's LHS.

This fixes cases like this:

```
assert("Name"/*in*/in/*in*/listOf("Hello", "World"))
              |            |
              |            [Hello, World]
              false
```
2024-03-05 18:54:06 +00:00
Sergej Jaskiewicz 54c58671fb [PowerAssert] Correctly align infix calls for built-in operators
Instead of searching for the operator in the string representation of
the whole expression, consider the operator's start to be the
first non-whitespace non-dot character _after_ the LHS of the infix
expression.

This fixes cases like this:
```
assert("Name in " in listOf("Hello", "World"))
             |       |
             |       [Hello, World]
             false
```

^KT-66208 Fixed
2024-03-05 18:54:06 +00:00
Sergej Jaskiewicz 7d22825176 [PowerAssert] Reproduce KT-66208 2024-03-05 18:54:06 +00:00