-
Notifications
You must be signed in to change notification settings - Fork 660
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
[IJ Plugin] Inspection: missing directive import #5494
Conversation
✅ Deploy Preview for apollo-android-docs canceled.
|
...tlin/com/apollographql/ijplugin/inspection/ApolloMissingGraphQLDefinitionImportInspection.kt
Outdated
Show resolved
Hide resolved
...tlin/com/apollographql/ijplugin/inspection/ApolloMissingGraphQLDefinitionImportInspection.kt
Outdated
Show resolved
Hide resolved
...tlin/com/apollographql/ijplugin/inspection/ApolloMissingGraphQLDefinitionImportInspection.kt
Outdated
Show resolved
Hide resolved
...j-plugin/src/main/resources/inspectionDescriptions/ApolloMissingGraphQLDefinitionImport.html
Outdated
Show resolved
Hide resolved
intellij-plugin/src/main/resources/messages/ApolloBundle.properties
Outdated
Show resolved
Hide resolved
…loMissingGraphQLDefinitionImport.html Co-authored-by: Martin Bonnin <[email protected]>
const val CATCH = "catch" | ||
const val CATCH_TO = "CatchTo" |
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.
For the record, we just discussed this and it would be better to not hardcode any definition names in AKIJP. Instead, AKIJP can read from the nullability
and kotlin_labs
definitions.
- unresolved
nullability
imports are an error. - unresolved
kotlin_labs
imports arean error too (TBC). 4.0 is lenient and imports them automatically but we should enforce this so might just be easier to have the same handling there.Edit: we finally decided on warning with a different warning to keep the IJ plugin contract matching the compiler contract
Aliased imports ({ name: "@catch", to:
"mycatch" }`) cannot have a quick fix, which is expected, same as in Kotlin.
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.
kotlin_labs
warning in latest commit:
Screen.Recording.2023-12-22.at.11.15.07.mov
intellij-plugin/src/main/resources/messages/ApolloBundle.properties
Outdated
Show resolved
Hide resolved
...j-plugin/src/main/resources/inspectionDescriptions/ApolloMissingGraphQLDefinitionImport.html
Outdated
Show resolved
Hide resolved
…rties Co-authored-by: Martin Bonnin <[email protected]>
…loMissingGraphQLDefinitionImport.html Co-authored-by: Martin Bonnin <[email protected]>
...tlin/com/apollographql/ijplugin/inspection/ApolloMissingGraphQLDefinitionImportInspection.kt
Outdated
Show resolved
Hide resolved
extraSchemaFile.add(GraphQLElementFactory.createWhiteSpace(project, "\n\n")) | ||
extraSchemaFile.add(it) |
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.
Can this be added at the top of the file instead, like other imports
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.
...tlin/com/apollographql/ijplugin/inspection/ApolloMissingGraphQLDefinitionImportInspection.kt
Show resolved
Hide resolved
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.
🚀
Resolves #5413
Screen.Recording.2023-12-20.at.10.59.28.mov