-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added FormatLanguage annotation to JSON #2234
Conversation
formats/json/commonMain/src/kotlinx/serialization/json/JsonFunctions.kt
Outdated
Show resolved
Hide resolved
formats/json/jsMain/src/kotlinx/serialization/json/internal/FormatLanguage.kt
Show resolved
Hide resolved
AnnotationTarget.LOCAL_VARIABLE, | ||
AnnotationTarget.ANNOTATION_CLASS | ||
) | ||
public expect annotation class FormatLanguage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @OptionalExpectation
may help here with avoiding re-declaring annotation on JS and Native
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would work if the class had a name org.intellij.lang.annotations.Language
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? I think it's available for any annotation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because in this case, I'm not sure that JSON syntax highlighting will work correctly for non-JVM projects, because it works specifically for annotations with the name org.intellij.lang.annotations.Language
but this is kotlinx.serialization.json.internal.FormatLanguage
.
formats/json/jsMain/src/kotlinx/serialization/json/internal/IntelliJAnnotation.kt
Outdated
Show resolved
Hide resolved
/** | ||
* Multiplatform analogue of `org.intellij.lang.annotations.Language` annotation. | ||
* | ||
* An alias is used instead of classes, because the actual class in the JVM will overload the classes from the stdlib - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean 'classes' or a single 'class'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single class in this case
Did this go out with 1.5.1? I'm seeing the following failure on gradle task
|
@Kantis Yes, it did. Make sure that all serialization dependencies use the same 1.5.1 version. If that doesn't help, please create separate issue. |
Resolves #2166