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

Bazel plugin for Intellij sets wrong kotlin version #1274

Closed
CharlieCrisp opened this issue Oct 14, 2019 · 11 comments
Closed

Bazel plugin for Intellij sets wrong kotlin version #1274

CharlieCrisp opened this issue Oct 14, 2019 · 11 comments
Labels
lang: kotlin Kotlin rules integration product: IntelliJ IntelliJ plugin type: bug

Comments

@CharlieCrisp
Copy link

I have recently upgraded to the these rules (commit ab2f9f79912a35af3c1a07849d6fb457c2bfc54b) and when trying to use Kotlin 1.3 in IntelliJ, I noticed the kotlin "Language version"/"API Version", gets set by the Bazel plugin to be 1.2 on every 'sync'.

  • I'm definitely using 1.3. as bazel builds from the terminal compile 1.3 features.
  • IntelliJ gives a quick-fix using alt-enter that removes the red squiggly lines, however this error comes back upon bazel sync.
  • Setting the toolchain manually allows the "Language version"/"API Version" to remain at 1.3 but the error still comes upon syncs and the quick-fix works until the next sync.
@cgruber
Copy link
Contributor

cgruber commented Oct 16, 2019

This is a place where we'll need to chat with the folks from bazelbuild/intellij or folks who dabble in all the areas. It's not clear to me what metadata the kotlin rules need to expose in order for the plugin to pick this up.

@jin, do you have any insights here?

@cgruber cgruber self-assigned this Oct 16, 2019
@jin jin transferred this issue from bazelbuild/rules_kotlin Oct 16, 2019
@jin
Copy link
Member

jin commented Oct 16, 2019

This sounds like an IJwBazel issue. Transferred to bazelbuild/intellij.

@jin jin added product: IntelliJ IntelliJ plugin lang: kotlin Kotlin rules integration labels Oct 16, 2019
@jin
Copy link
Member

jin commented Oct 18, 2019

Please provide your version information (IntelliJ Menu -> Bazel -> File an Issue on GitHub, and copy the version information here)

@CharlieCrisp
Copy link
Author

Version information

IdeaUltimate: 2019.2.3
Platform: Mac OS X 10.14.6
Bazel plugin: 2019.10.01.1.1
Bazel: 0.28.1

Problem
Screenshot 2019-10-18 at 17 05 19

language setting
Screenshot 2019-10-18 at 17 05 07

Choosing the quick fix solves the problem until hitting the sync button when it reverts. Language version (as per the second screenshot) is always set to 1.3

@CharlieCrisp
Copy link
Author

So I may have fixed this by adding kotlin to the additional_languages in the .bazelproject. Not sure why it has the observed behaviour without this though

@cgruber cgruber removed their assignment Dec 6, 2019
@cgruber
Copy link
Contributor

cgruber commented Dec 6, 2019

What I'm wondering (@jin, @brendandouglas) is whether there's metadata that ought to be given to the aspect, that identifies the kotlin language version (we have that data in the rules_kotlin toolchain). I just don't know where you need to get that info into the plugin, and if it's just something we need to add to the aspect?

@brendandouglas
Copy link
Contributor

brendandouglas commented Dec 6, 2019 via email

@szinn
Copy link

szinn commented Dec 6, 2019

#1473

Submitted this PR to default the Kotlin version to be 1.3 which takes care of most issues. Getting the KotlinToolchainIdeInfo filled in is the long-term better way to go though if external rules can do it through aspects (I'll take a look)

@jasonwyatt
Copy link

This is an incredibly frustrating issue given 1.3 has been out for several months now, and 1.4 is coming up quickly.

It would be nice to have a field available in the project view file to specify which version to allow.

cgruber pushed a commit to bazelbuild/rules_kotlin that referenced this issue Jan 15, 2020
- supplies the language version in the kt provider
- allows the bazel-intellij aspect processing to correctly identify the version
  of Kotlin being used and update the source accordingly
- part of the fix for bazelbuild/intellij#1274
@szinn
Copy link

szinn commented Jan 15, 2020

Submitted PR #1566 to pull the version information from the rules_kotlin build

@DrewKiino
Copy link

bump - can we get this fixed please?

jongerrish added a commit to jongerrish/rules_kotlin that referenced this issue Apr 16, 2020
- supplies the language version in the kt provider
- allows the bazel-intellij aspect processing to correctly identify the version
  of Kotlin being used and update the source accordingly
- part of the fix for bazelbuild/intellij#1274
@mai93 mai93 closed this as completed Jan 12, 2022
richmowd411 added a commit to richmowd411/Rules-Kotlin that referenced this issue Apr 12, 2022
- supplies the language version in the kt provider
- allows the bazel-intellij aspect processing to correctly identify the version
  of Kotlin being used and update the source accordingly
- part of the fix for bazelbuild/intellij#1274
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: kotlin Kotlin rules integration product: IntelliJ IntelliJ plugin type: bug
Projects
None yet
Development

No branches or pull requests

8 participants