Skip to content
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

fix imports for ksp plugin #2678

Merged
merged 7 commits into from Mar 8, 2022
Merged

fix imports for ksp plugin #2678

merged 7 commits into from Mar 8, 2022

Conversation

i-walker
Copy link
Member

@i-walker i-walker commented Mar 2, 2022

resolves #2618
Status:
In progres

@i-walker i-walker requested a review from nomisRev March 2, 2022 16:59
Comment on lines 8 to 11
val sourceClassName = el.qualifiedName?.asString() ?: el.simpleName
val sourceName = el.simpleName.asString().replaceFirstChar { it.lowercase(Locale.getDefault()) }
val simpleName = el.simpleName.asString()
val packageName = pckg.asString()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep these names the same? This is our own domain.
This introduces a lot of unnecessary changes in the PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@@ -38,7 +38,6 @@ class LensTests {
fun `Lenses which mentions imported elements`() {
"""
|$imports
|import kotlin.time.Duration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests were not running if this bug was not caught. Is it possible to make them run?
If this import is removed, then it should be using FQN on line 47.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was removed since I added a variable in the dslModel with a Duration type so the import is automatically added in $import

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me change those to FQNames instead ☺️

Copy link
Member

@nomisRev nomisRev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @i-walker! Thanks for the work on the fix ❤️

@nomisRev nomisRev merged commit ba979cf into main Mar 8, 2022
@nomisRev nomisRev deleted the is-ksp-fix branch March 8, 2022 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KSP Optics plugin does not consider imports
2 participants