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

Add kotlin test cases for lint module #460

Merged
merged 1 commit into from
Apr 16, 2018
Merged

Add kotlin test cases for lint module #460

merged 1 commit into from
Apr 16, 2018

Conversation

hotchemi
Copy link
Member

Issue

resolves #373

Overview

  • Add kotlin test cases for lint module.
    • Tweak CallOnRequestPermissionsResultDetector to address onRequestPermissionsResult extension function.

Tweak CallOnRequestPermissionsResultDetector to address onRequestPermissionsResult extension function.
@hotchemi hotchemi requested a review from shiraji April 15, 2018 17:20
private OnRequestPermissionsResultChecker(JavaContext context, UClass klass) {
this.context = context;
this.className = klass.getName();
isKotlin = context.getPsiFile() != null && "kotlin".equals(context.getPsiFile().getLanguage().getID());
Copy link
Member Author

Choose a reason for hiding this comment

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

@shiraji I guess we can detect the file is kotlin or not as this!

Copy link
Member

Choose a reason for hiding this comment

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

That's good to know.

Copy link
Contributor

@mannodermaus mannodermaus Apr 16, 2018

Choose a reason for hiding this comment

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

Does getLanguage() return an enum that already contains a Kotlin member? If so, and we have access to that, might as well use that

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you! Actually Language is not an Enum but just an abstract class.. 😅A bit unsmart but we gotta check ID 🤔
https://github.com/JetBrains/intellij-community/blob/571fbe96754e6c762fe8f7f8532ae2665bfbae61/platform/core-api/src/com/intellij/lang/Language.java#L42

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, it's OK then!

@hotchemi
Copy link
Member Author

Can I merge?

@shiraji
Copy link
Member

shiraji commented Apr 16, 2018

Sure!

Copy link
Contributor

@mannodermaus mannodermaus left a comment

Choose a reason for hiding this comment

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

Yup

@hotchemi hotchemi merged commit c6219d6 into master Apr 16, 2018
@hotchemi hotchemi deleted the kotlin-lint branch April 16, 2018 06:36
@hotchemi
Copy link
Member Author

Thank you guys! I'll release next version tonight!

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.

Enable lint rules with Kotlin
3 participants