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

Scan Kotlin constants for JavaPsiFacade #1138

Merged
merged 1 commit into from Oct 6, 2022
Merged

Conversation

ting-yuan
Copy link
Collaborator

so that constants in light classes can be resolved by JavaPsiFacade.

Fixes #997.

@ting-yuan ting-yuan force-pushed the issue-997 branch 2 times, most recently from 70f6be5 to cd3db69 Compare October 6, 2022 17:23
Copy link
Collaborator

@neetopia neetopia left a comment

Choose a reason for hiding this comment

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

Is the issue only relates to incremental? If so maybe we can put a check to see if incremental is enabled before proceeding to the pre-processing.

},
Unit
)
} catch (_: Exception) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the case for exception here and why it is simply ignored for the general Exception rather than more specific exception types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's similar to the initialization blocks protected by handleException in the above. Exceptions can arise from, e.g., broken inputs. This is the best effort to make constants in Kotlin available to JavaPsiFacade and try not to error out if possible. It's up to the processors to decide whether to error out or not.

@ting-yuan
Copy link
Collaborator Author

The issue only comes from clean files. The check would be redundant because only clean files are (needed to be) visited.

so that constants in light classes can be resolved by JavaPsiFacade.
@ting-yuan ting-yuan merged commit ee2a780 into google:main Oct 6, 2022
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.

Incremental KSP fails in Java/Kotlin mixed module
2 participants