You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like for my IDE to be able to recommend suggestions so that I can quickly access resources when I'm writing the tests, without having to refer to the resources directory.
I have two suggestions:
Implement the @Language tag that the Resources() class can inject languages, specifically the file-reference injection.
IntelliJ will then automatically suggest file paths
Unfortunately @Languageisn't a Kotlin annotation, so it isn't suitable for Kotlin Multiplatform out of the box. But it can be converted to work for Kotlin Multiplatform projects, as demonstrated in Kotlinx Serialization.
Generate code so that I can access the files via variables.
Thanks, that's a great suggestion! I favor the approach using @Language, similar to what kotlinx.serialization is doing. It's something I was unaware of before, but I'll explore it unless someone submits PR before I get to it.
I'd suggest the 2nd option, basically what android does with the R class.
In case there is a change/removal it's being caught right away during compile time.
I would like for my IDE to be able to recommend suggestions so that I can quickly access resources when I'm writing the tests, without having to refer to the resources directory.
I have two suggestions:
Implement the
@Language
tag that theResources()
class can inject languages, specifically thefile-reference
injection.IntelliJ will then automatically suggest file paths
Unfortunately
@Language
isn't a Kotlin annotation, so it isn't suitable for Kotlin Multiplatform out of the box. But it can be converted to work for Kotlin Multiplatform projects, as demonstrated in Kotlinx Serialization.Generate code so that I can access the files via variables.
For example, given that resources contains
Then the kotlinx-resources plugin could generate the following code:
I could then quickly access the file in my test:
The text was updated successfully, but these errors were encountered: