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

IDEA Intellij & Rust plugin do not work after latest Intellij & Rust plugin updates #5237

Closed
zenria opened this issue Apr 13, 2020 · 16 comments
Labels
bug subsystem::IDE Issues related to general IDE functionality (tool windows, actions, etc.)

Comments

@zenria
Copy link

zenria commented Apr 13, 2020

Environment

  • IntelliJ Rust plugin version: 0.2.119.2201-201
  • Rust toolchain version: stable-x86_64-apple-darwin rustc 1.42.0 (b8cedc004 2020-03-09)
  • IDE name and version: Intellij IDEA 2020.1 built on April 8, 2020
  • Operating system: MacOS Catalina 10.15.4

Problem description

After upgrading Intellij IDEA to April 8 version and rust plugin to the 0.2.119.2201-201, Rust projects do not built anymore, Rust sources are not analyzed.

  • Build Project does nothing
  • syntax is not analysed (no hints, very basic hightling)
  • no "Run main" in context menu when right clicking on the main() function

Steps to reproduce

Start IDEA Intellij, with Rust plugin. Try to create a project from existing sources. Then it won't work
or
Open an existing project: it won't work

In intellij logs I can find an error each time I try to build a project:

2020-04-13 17:32:26,885 [16812414]   INFO - rust.openapiext.CommandLineExt - Executing `/Users/philou/.cargo/bin/cargo help check` 
2020-04-13 17:32:26,906 [16812435]  ERROR - plication.impl.ApplicationImpl - EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@236e3726
Current thread: Thread[ApplicationImpl pooled thread 134,4,Idea Thread Group] 687499043
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 396031716 
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@236e3726
Current thread: Thread[ApplicationImpl pooled thread 134,4,Idea Thread Group] 687499043
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 396031716
	at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1057)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1039)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.doRegisterToolWindow(ToolWindowManagerImpl.kt:938)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow(ToolWindowManagerImpl.kt:923)
	at com.intellij.execution.ui.RunContentManagerImpl.registerToolWindow(RunContentManagerImpl.kt:117)
	at com.intellij.execution.ui.RunContentManagerImpl.getOrCreateContentManagerForToolWindow(RunContentManagerImpl.kt:362)
	at com.intellij.execution.ui.RunContentManagerImpl.getContentManagerForRunner(RunContentManagerImpl.kt:347)
	at com.intellij.execution.ui.RunContentManagerImpl.getReuseContent(RunContentManagerImpl.kt:322)
	at com.intellij.execution.impl.ExecutionManagerImpl.doStartRunProfile(ExecutionManagerImpl.kt:182)
	at com.intellij.execution.impl.ExecutionManagerImpl.startRunProfile(ExecutionManagerImpl.kt:145)
	at org.rust.cargo.runconfig.RsDefaultProgramRunnerBase.execute(RsDefaultProgramRunnerBase.kt:38)
	at org.rust.cargo.runconfig.RsDefaultProgramRunnerBase.execute(RsDefaultProgramRunnerBase.kt:23)
	at com.intellij.execution.impl.ExecutionManagerImpl.executeConfiguration(ExecutionManagerImpl.kt:612)
	at com.intellij.execution.ProgramRunnerUtil.executeConfigurationAsync(ProgramRunnerUtil.java:60)
	at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:43)
	at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:134)
	at org.rust.cargo.toolchain.CargoCommandLineKt.run(CargoCommandLine.kt:148)
	at org.rust.cargo.toolchain.CargoCommandLineKt.run$default(CargoCommandLine.kt:138)
	at org.rust.cargo.runconfig.UtilsKt.buildProject(Utils.kt:69)
	at org.rust.cargo.runconfig.buildtool.CargoBuildTaskRunner.run(CargoBuildTaskRunner.kt:52)
	at com.intellij.task.ProjectTaskRunner.run(ProjectTaskRunner.java:143)
	at com.intellij.task.ProjectTaskRunner.run(ProjectTaskRunner.java:70)
	at com.intellij.task.impl.ProjectTaskManagerImpl.lambda$run$13(ProjectTaskManagerImpl.java:222)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:255)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
2020-04-13 17:32:26,906 [16812435]  ERROR - plication.impl.ApplicationImpl - IntelliJ IDEA 2020.1  Build #IU-201.6668.121 
2020-04-13 17:32:26,906 [16812435]  ERROR - plication.impl.ApplicationImpl - JDK: 11.0.6; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 
2020-04-13 17:32:26,906 [16812435]  ERROR - plication.impl.ApplicationImpl - OS: Mac OS X 
2020-04-13 17:32:26,906 [16812435]  ERROR - plication.impl.ApplicationImpl - Plugin to blame: Rust version: 0.2.119.2201-201 
2020-04-13 17:32:26,906 [16812435]  ERROR - plication.impl.ApplicationImpl - Last Action: CompileDirty 

@zenria
Copy link
Author

zenria commented Apr 13, 2020

Updated rust plugin to 0.2.120.2202-201, same issue.

2020-04-13 21:12:02,739 [ 160763]   INFO - rust.openapiext.CommandLineExt - Executing `/Users/philou/.cargo/bin/cargo help check` 
2020-04-13 21:12:02,756 [ 160780]  ERROR - plication.impl.ApplicationImpl - EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@1d3ef1ac
Current thread: Thread[ApplicationImpl pooled thread 14,4,Idea Thread Group] 1167039392
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 280461833 
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@1d3ef1ac
Current thread: Thread[ApplicationImpl pooled thread 14,4,Idea Thread Group] 1167039392
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 280461833
	at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1057)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1039)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.doRegisterToolWindow(ToolWindowManagerImpl.kt:938)
	at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow(ToolWindowManagerImpl.kt:923)
	at com.intellij.execution.ui.RunContentManagerImpl.registerToolWindow(RunContentManagerImpl.kt:117)
	at com.intellij.execution.ui.RunContentManagerImpl.getOrCreateContentManagerForToolWindow(RunContentManagerImpl.kt:362)
	at com.intellij.execution.ui.RunContentManagerImpl.getContentManagerForRunner(RunContentManagerImpl.kt:347)
	at com.intellij.execution.ui.RunContentManagerImpl.getReuseContent(RunContentManagerImpl.kt:322)
	at com.intellij.execution.impl.ExecutionManagerImpl.doStartRunProfile(ExecutionManagerImpl.kt:182)
	at com.intellij.execution.impl.ExecutionManagerImpl.startRunProfile(ExecutionManagerImpl.kt:145)
	at org.rust.cargo.runconfig.RsDefaultProgramRunnerBase.execute(RsDefaultProgramRunnerBase.kt:38)
	at org.rust.cargo.runconfig.RsDefaultProgramRunnerBase.execute(RsDefaultProgramRunnerBase.kt:23)
	at com.intellij.execution.impl.ExecutionManagerImpl.executeConfiguration(ExecutionManagerImpl.kt:612)
	at com.intellij.execution.ProgramRunnerUtil.executeConfigurationAsync(ProgramRunnerUtil.java:60)
	at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:43)
	at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:134)
	at org.rust.cargo.toolchain.CargoCommandLineKt.run(CargoCommandLine.kt:148)
	at org.rust.cargo.toolchain.CargoCommandLineKt.run$default(CargoCommandLine.kt:138)
	at org.rust.cargo.runconfig.UtilsKt.buildProject(Utils.kt:69)
	at org.rust.cargo.runconfig.buildtool.CargoBuildTaskRunner.run(CargoBuildTaskRunner.kt:52)
	at com.intellij.task.ProjectTaskRunner.run(ProjectTaskRunner.java:143)
	at com.intellij.task.ProjectTaskRunner.run(ProjectTaskRunner.java:70)
	at com.intellij.task.impl.ProjectTaskManagerImpl.lambda$run$13(ProjectTaskManagerImpl.java:222)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:255)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
2020-04-13 21:12:02,757 [ 160781]  ERROR - plication.impl.ApplicationImpl - IntelliJ IDEA 2020.1  Build #IU-201.6668.121 
2020-04-13 21:12:02,757 [ 160781]  ERROR - plication.impl.ApplicationImpl - JDK: 11.0.6; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 
2020-04-13 21:12:02,757 [ 160781]  ERROR - plication.impl.ApplicationImpl - OS: Mac OS X 
2020-04-13 21:12:02,757 [ 160781]  ERROR - plication.impl.ApplicationImpl - Plugin to blame: Rust version: 0.2.120.2202-201 
2020-04-13 21:12:02,757 [ 160781]  ERROR - plication.impl.ApplicationImpl - Last Action: CompileDirty 

@zenria
Copy link
Author

zenria commented Apr 13, 2020

Humm, retried some minutes later, without changing anything: it now works...

Opened another project: building does not work - at first, same stack. But if I try to start an existing Run configuration, the program starts. Then building works.

@dbcfd
Copy link

dbcfd commented Apr 14, 2020

Similar behavior here. Not able to build until I add a run configuration. At that point the run config and build works. Happens on multiple projects even after deleting my .idea directory and reopening.

@yan-zaretskiy
Copy link

Can confirm. Had to Run a configuration first for the "Build Project" menu item to become responsive.

@mchernyavsky mchernyavsky self-assigned this Apr 15, 2020
@mchernyavsky
Copy link
Member

Try to enable the experimental build tool window by setting cargo.build.tool.window.enabled variable to true (see Actions > Registry...).

@damien-white
Copy link

I am still not getting any linting at all, no syntax highlighting or anything. The plugin is simply not working hardly at all.

Any chance that someone is working on this? At first I thought I had done something wrong but I did not change my configuration. I simply made the mistake of upgrading my Intellij IDE version to the 2020.1 and this broke the Rust plugin completely.

Any updates would be greatly appreciated as I'm pretty much just dead in the water until this issue is resolved.

Thank you, I appreciate it very much.

@zenria
Copy link
Author

zenria commented Apr 15, 2020

I am still not getting any linting at all, no syntax highlighting or anything. The plugin is simply not working hardly at all.

I noticed after the upgrade that *.rs files are associated to "Android RenderScript", I saw it in the event log:

14/04/2020
10:01	File type recognized: File extension *.rs was reassigned to Android RenderScript Revert

Then, the revert button destroyed the new association but did not restore the Rust -> *.rs association, A have to go in Preferences => File Types and associate *.rs to Rust manually...

@Undin Undin added the subsystem::IDE Issues related to general IDE functionality (tool windows, actions, etc.) label Apr 15, 2020
@zenria
Copy link
Author

zenria commented Apr 15, 2020

Try to enable the experimental build tool window by setting cargo.build.tool.window.enabled variable to true (see Actions > Registry...).

I do not have this variable in my "Registry", so I'm not able to change it.

@zenria
Copy link
Author

zenria commented Apr 15, 2020

Try to enable the experimental build tool window by setting cargo.build.tool.window.enabled variable to true (see Actions > Registry...).

I do not have this variable in my "Registry", so I'm not able to change it.

I have enabled org.rust.cargo.build.tool.window

And now it's working as expected. Building actually builds the project, even if no "Run tool window" is displayed

Thank you!

@Undin
Copy link
Member

Undin commented Apr 15, 2020

Root of the problem: after update from 2019.3 to 2020.1, IDEA remaps *.rs files association from Rust to Android RenderScript for some reason. Please vote to https://youtrack.jetbrains.com/issue/IDEA-237376 because proper solution should be done in the platform (not in the plugin).

To avoid this problem, we added a hack to the latest (v120) release (see #5229) that associates rs files as Rust files after Cargo refresh. It should be called automatically at least on project opening, but you can try to invoke the corresponding action manually.
Screen Shot 2020-04-15 at 10 04 47

If it doesn't help (it's weird but anyway), you can try to disable android plugin and reinstall Rust plugin.

have to go in Preferences => File Types and associate *.rs to Rust manually..

I don't recommend to do it manually because it may have negative effects in combination with hack introduced in #5229

@Undin Undin pinned this issue Apr 15, 2020
@dbcfd
Copy link

dbcfd commented Apr 15, 2020

I do not have the android plugin, so my *.rs association was still there. Will try enabling build tool window on a new project and see what that does.

@damien-white
Copy link

I am on MacOS 10.15.4. I don't think this should make a difference but I'm just throwing that out there.

Temporarily downgrading to the most recent version before 2020.1 seems to be the best option until the plugin is fixed. It's extremely simple and the issue(s) are all immediately resolved.

I understand this isn't a "fix" but it is a temporary solution. It took me a total of about 10 minutes or less to downgrade and then perform the "Update All" action for my plugins (the plugins will all downgrade/rollback to their previous versions).

@dbcfd
Copy link

dbcfd commented Apr 15, 2020

Enabling org.rust.cargo.build.tool.window works on projects without a run configuration.

Issue #1: Intellisense not working
LIkely due to missing *.rs mapping with android renderscript plugin. Disable rust and android renderscript plugin, reinstall rust plugin.

Issue #2: Build not working
No root cause. Two workarounds exist. Creating any run configuration (e.g. from a test or main) will allow builds to work. Second workaround is to enable org.rust.cargo.build.tool.window in the Registry (shift-ctrl-alt-/ or shift-meta-alt-/ to bring up maintenance window)

@damien-white
Copy link

Issue #1: Intellisense not working
LIkely due to missing *.rs mapping with android renderscript plugin. Disable rust and android renderscript plugin, reinstall rust plugin.

This does not fix IntelliSense for me. I do not even have Android enabled and *.rs files are being mapped to Rust files. Not sure if that provides and insight or helps at all, but I figured I should include that for the sake of completeness.

The Clippy syntax analyzer does not work with the latest IntelliJ IDEA build (nor does Cargo check). No errors show until I go to actually compile my project. I'm not sure what this means, exactly.

To anyone as frustrated as I am: the only solution that sort of works is downgrading back to the latest 2019.x version and reverting the plugin, etc. to the earlier version. This still does not entirely solve the issues, but it mostly does.

Any time-line or updates about if/when this will be fixed? IntelliJ's Rust plugin is near-useless at this moment in time. Is there any idea about what caused everything to break so badly (I'm also referring to the build issues people are having, etc.)?

My apologies for harping on you guys about this issue; I love Jetbrains products and use them exclusively for my developing and I do not plan on changing to any other products. I would just really love to have Rust working as I cannot benefit from the IDE while developing. I would have pretty much the same experience if coding in a vanilla vim environment (no plugins, etc.) -- aka a simple text-editor.

Thank you very much for all of your hard work and your dedication. It really means a lot. I hope I did not come across as too abrasive. The issues are frustrating but I want you to know how much I do appreciate everything your team does -- it's incredible.

Thanks again!

@tworec
Copy link

tworec commented May 11, 2020

My workaround to revive building project was to manually invoke cargo build via cargo toolbar.
I've also needed to use this trick: #2220 (comment)

@Undin
Copy link
Member

Undin commented Sep 9, 2020

The original issue with file type conflict between Android RenderScript and Rust was fixed in the platform. The fix will be landed in the first 2020.3 EAPs (I hope this month).
In such cases, future versions of platform will notify users about it
Screen Shot 2020-09-09 at 13 53 10

So I think this issue can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug subsystem::IDE Issues related to general IDE functionality (tool windows, actions, etc.)
Projects
None yet
Development

No branches or pull requests

7 participants