Closed starsep closed 3 years ago
Interesting enough it only happens if the string is returned from a function 👀
val str: String = """
older today -$yearsAgo years
or ${LAST_CHECK_DATE_KEYS.joinToString(" or ") { "$it < today -$yearsAgo years" }}
""".trimIndent()
private fun hasAnyName(tags: Map<String, String>?): Boolean =
tags?.let { featureDictionaryFuture.get().byTags(it).find().isNotEmpty() } ?: false
Assignment or any other type of literals are detected as expected. PS: The single-double-quoted string does the same with function return.
Ok it seems like, after : String
return type there, equals is not highlighted. Indicating that single expression return type is not handled.
I was about to report a similar issue. We're on a self-hosted GitHub Enterprise, so I guess it didn't propagate there yet. Would it have been a duplicate then?
Looks good here:
private fun Exception.isNetworkError(): Boolean {
val message = this.message ?: return false
return message.startsWith("""Unable to resolve host "api.host.net"""") ||
message.startsWith("failed to connect to api.host.net")
}
This is what I see in our PR:
@TWiStErRob Which PR messed it? The upstream (master branch) grammar seems to work fine in the lightshow:
Oh sorry I didn't read the comment fully, your issue is dup of #26 the triple quotation mark ends as soon as possible, so next (4th quote) was getting considered as beginning of new string. This is strange that it have been merged back in December yet is not updated in gh enterprise 🤔 I guess you could raise a ticket there to pull and apply the changes.
I'll double-check, maybe it's just my company's updates that's lagging. Thanks for the confirm of dupe.
Another issue similar to #26 From highlighting it seems that content of a string after newline is interpreted as a Kotlin code.
Source: https://github.com/streetcomplete/StreetComplete/blob/07137c1f506530dc86a500faa4ee04bda91215e5/app/src/main/java/de/westnordost/streetcomplete/quests/existence/CheckExistence.kt#L101-L107