Rust-Intellij rust: Rust plugin for the IntelliJ Platform

Rust plugin for the IntelliJ Platform

official JetBrains project Join the chat at https://gitter.im/intellij-rust/intellij-rust JetBrains plugins JetBrains plugins

Build Status
Travis Travis Build Status
AppVeyor AppVeyor Build Status
Stable Stable Build Status
Beta Beta Build Status
Nightly Nightly Build Status

Installation & Usage

Available installation options and features are described on intellij-rust.github.io. All new features are announced in the changelog.

If you want to jump straight in, open Settings > Plugins > Marketplace in your IDE, search for Rust and install the plugin. To open an existing project, use File | Open and point to the directory containing Cargo.toml. For creating projects, use the Rust template. You can find more details in the Quick Start Guide.

Compatible IDEs

The plugin is compatible with all IntelliJ-based IDEs starting from the version 2020.1, with the following differences in the sets of the available features:

Open-source and Educational IDEs* CLion (commercial) IntelliJ IDEA Ultimate (commercial) PyCharm Professional, GoLand, other commercial IDEs
Language support + + + +
Cargo support + + + +
Code coverage + + + +
Debugger - + +** -
Profiler - + - -
Valgrind Memcheck - + - -
Detecting duplicates - + + +

* IntelliJ IDEA Community Edition, PyCharm Community Edition, PyCharm Edu and IntelliJ IDEA Edu.

** Requires the Native Debugging Support plugin. Available on macOS and Linux, LLDB only.

TOML

If you are looking for the TOML plugin, see intellij-toml directory.

Contributing

You're encouraged to contribute to the plugin if you've found any issues or missing functionality that you would want to see. Check out CONTRIBUTING.md to learn how to set up the project and ARCHITECTURE.md to understand the high-level structure of the codebase. If you are not sure where to start, consider the issues tagged with help wanted.

Comments

  • INSP: change RsVariableMutableInspection to a LintInspection
    INSP: change RsVariableMutableInspection to a LintInspection

    Jun 16, 2020

    This PR changes RsVariableMutableInspection, introduced in https://github.com/intellij-rust/intellij-rust/pull/1143, to a RsLintInspection and enables it by default.

    I think that this inspection is incredibly useful. I have been using the Rust plugin for more than two years and I had no clue about its existence, so I think that it would be good if we enable it by default, at least in nightly builds for now, to gather possible false positives.

    I'll try to find cases where false positives happen and try to fix them to make this inspection better. If you know about any one reason why this shouldn't be enabled by default except for false positives, let me know.

    Fixes: https://github.com/intellij-rust/intellij-rust/issues/1004

    Reply
  • Generic fn implementation ignores aliases
    Generic fn implementation ignores aliases

    Jun 16, 2020

    Environment

    • IntelliJ Rust plugin version: 0.2.124.3162-201
    • **Rust toolchain version:**1.45.0-nightly
    • IDE name and version: CLion 2020.1
    • Operating system: Windows 10

    Problem description

    Generated fn implementations for generic traits ignore generic argument aliases and use unalias names.

    Steps to reproduce

    use something::Type as AnotherType;
    
    struct Widget;
    
    impl From<AnotherType> for Widget {
        // generated impl uses Type istead of AnotherType
        fn from(_: Type) -> Self {
        }
    }
    
    Reply
  • Error highlighting does not work in some cases
    Error highlighting does not work in some cases

    Jun 16, 2020

    Environment

    • IntelliJ Rust plugin version: 0.2.123.3132-193
    • Rust toolchain version: 1.43.1
    • IDE name and version: IntelliJ 2019.3.3
    • Operating system: Mac OS

    Problem description

    IntelliJ does not highlight wrong struct name as an error, say I want to type Vec and I mistakenly type Vex, the IDE highlighting still looks corrects when it is not

    let c:  Vex<&str> = vec![];
    
    Screenshot 2020-06-16 at 6 01 28 PM
    Reply
  • Support for non-Cargo based projects
    Support for non-Cargo based projects

    Jun 17, 2020

    Feature description

    The Rust plugin currently only supports projects using Cargo.toml files. For large codebase using a centralized build system, such as Android or Fuchsia, this approach is not practical.

    The rust-analyzer project provides an alternative to declare the dependencies (https://rust-analyzer.github.io/manual.html#non-cargo-based-projects). This de facto standard is already generated by Fuchsia and Android.

    Would it be possible to add an option to parse this format and automatically generate the dependencies within CLion?

    Submitted in CLion tracker: https://youtrack.jetbrains.com/issue/CPP-20821

    Reply
  • Fix PsiInvalidElementAccessException in structure view
    Fix PsiInvalidElementAccessException in structure view

    Jun 17, 2020

    Exception stacktrace
    
    
    com.intellij.psi.PsiInvalidElementAccessException: Element class com.intellij.psi.impl.source.tree.CompositeElement of type STRUCT_ITEM (class org.rust.lang.core.stubs.RsStructItemStub$Type)
    	at com.intellij.psi.PsiInvalidElementAccessException.createByNode(PsiInvalidElementAccessException.java:96)
    	at com.intellij.psi.impl.source.SubstrateRef$2.getContainingFile(SubstrateRef.java:101)
    	at com.intellij.extapi.psi.StubBasedPsiElementBase.getContainingFile(StubBasedPsiElementBase.java:253)
    	at com.intellij.extapi.psi.StubBasedPsiElementBase.getProject(StubBasedPsiElementBase.java:291)
    	at org.rust.lang.core.macros.RsExpandedElementKt.getExpandedFrom(RsExpandedElement.kt:49)
    	at org.rust.lang.core.macros.RsExpandedElementKt$findMacroCallExpandedFromNonRecursive$1.invoke(RsExpandedElement.kt:72)
    	at org.rust.lang.core.macros.RsExpandedElementKt$findMacroCallExpandedFromNonRecursive$1.invoke(RsExpandedElement.kt)
    	at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:172)
    	at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:132)
    	at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:156)
    	at kotlin.sequences.SequencesKt___SequencesKt.firstOrNull(_Sequences.kt:129)
    	at org.rust.lang.core.macros.RsExpandedElementKt.findMacroCallExpandedFromNonRecursive(RsExpandedElement.kt:73)
    	at org.rust.lang.core.macros.RsExpandedElementKt.isExpandedFromMacro(RsExpandedElement.kt:77)
    	at org.rust.ide.presentation.UtilsKt.getPresentationForStructure(Utils.kt:60)
    	at org.rust.ide.structure.RsStructureViewElement.getPresentation(RsStructureViewModel.kt:50)
    	at com.intellij.ide.util.treeView.smartTree.TreeElementWrapper.update(TreeElementWrapper.java:42)
    	at com.intellij.ide.util.treeView.PresentableNodeDescriptor.getUpdatedPresentation(PresentableNodeDescriptor.java:74)
    	at com.intellij.ide.util.treeView.PresentableNodeDescriptor.update(PresentableNodeDescriptor.java:27)
    	at com.intellij.ui.tree.StructureTreeModel$Node.update(StructureTreeModel.java:453)
    	at com.intellij.ui.tree.StructureTreeModel$Node.access$200(StructureTreeModel.java:421)
    	at com.intellij.ui.tree.StructureTreeModel.lambda$getChildren$14(StructureTreeModel.java:315)
    	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
    	at com.intellij.ui.tree.StructureTreeModel.getChildren(StructureTreeModel.java:315)
    	at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.getNode(AsyncTreeModel.java:573)
    	at com.intellij.ui.tree.AsyncTreeModel$ObsolescentCommand.get(AsyncTreeModel.java:468)
    	at com.intellij.ui.tree.AsyncTreeModel$ObsolescentCommand.get(AsyncTreeModel.java:434)
    	at com.intellij.util.concurrency.Invoker$Task.run(Invoker.java:323)
    	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:977)
    	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:75)
    	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:129)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:162)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:600)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:546)
    	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:149)
    	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:118)
    	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:75)
    	at com.intellij.util.concurrency.Invoker.invokeSafely(Invoker.java:206)
    	at com.intellij.util.concurrency.Invoker.lambda$offerSafely$0(Invoker.java:184)
    	at com.intellij.util.concurrency.Invoker$Background.lambda$offer$0(Invoker.java:524)
    	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    	at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:220)
    	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:225)
    	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:32)
    	at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:204)
    	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:210)
    	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:193)
    	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)
    
    
    fix 
    Reply
  • Fix IndexNotReadyException in RustfmtListener
    Fix IndexNotReadyException in RustfmtListener

    Jun 17, 2020

    Exception stacktrace
    
    com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
    	at com.intellij.openapi.project.IndexNotReadyException.create(IndexNotReadyException.java:81)
    	at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:706)
    	at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:656)
    	at com.intellij.psi.stubs.StubIndexImpl.getContainingIds(StubIndexImpl.java:525)
    	at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:381)
    	at com.intellij.psi.stubs.StubIndex.processElements(StubIndex.java:51)
    	at org.rust.lang.core.stubs.index.RsModulesIndex$Companion.getDeclarationFor(RsModulesIndex.kt:39)
    	at org.rust.lang.core.psi.RsFile$declaration$1.compute(RsFile.kt:192)
    	at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
    	at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
    	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:235)
    	at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:117)
    	at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:75)
    	at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:236)
    	at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
    	at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:73)
    	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:154)
    	at org.rust.lang.core.psi.RsFile.getDeclaration(RsFile.kt:190)
    	at org.rust.lang.core.psi.RsFile.doGetCachedData(RsFile.kt:97)
    	at org.rust.lang.core.psi.RsFile.access$doGetCachedData(RsFile.kt:64)
    	at org.rust.lang.core.psi.RsFile$cachedData$1$value$1.compute(RsFile.kt:89)
    	at org.rust.lang.core.psi.RsFile$cachedData$1$value$1.compute(RsFile.kt:64)
    	at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:117)
    	at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:75)
    	at org.rust.openapiext.UtilsKt.recursionGuard(utils.kt:67)
    	at org.rust.openapiext.UtilsKt.recursionGuard$default(utils.kt:66)
    	at org.rust.lang.core.psi.RsFile$cachedData$1.compute(RsFile.kt:89)
    	at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
    	at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
    	at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:235)
    	at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:117)
    	at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:75)
    	at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:236)
    	at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
    	at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:73)
    	at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:154)
    	at org.rust.lang.core.psi.RsFile.getCachedData(RsFile.kt:88)
    	at org.rust.lang.core.psi.RsFile.getCargoTarget(RsFile.kt:72)
    	at org.rust.lang.core.psi.ext.RsElementKt.getContainingCargoTarget(RsElement.kt:55)
    	at org.rust.lang.core.psi.ext.RsElementKt.getEdition(RsElement.kt:130)
    	at org.rust.cargo.toolchain.Rustfmt$reformatDocumentText$$inlined$buildList$lambda$1.compute(actions.kt:80)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:880)
    	at org.rust.cargo.toolchain.Rustfmt.reformatDocumentText(Rustfmt.kt:129)
    	at org.rust.cargo.RustfmtWatcher$Companion.reformatDocument(RustfmtWatcher.kt:100)
    	at org.rust.cargo.RustfmtWatcher$Companion.reformatDocuments(RustfmtWatcher.kt:93)
    	at org.rust.cargo.RustfmtWatcher$Companion.access$reformatDocuments(RustfmtWatcher.kt:76)
    	at org.rust.cargo.RustfmtWatcher$RustfmtListener.beforeDocumentSaving(RustfmtWatcher.kt:67)
    	at jdk.internal.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:549)
    	at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:143)
    	at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:472)
    	at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:432)
    	at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:420)
    	at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:404)
    	at com.intellij.util.messages.impl.MessageBusImpl.lambda$createTopicHandler$3(MessageBusImpl.java:243)
    	at com.sun.proxy.$Proxy32.beforeDocumentSaving(Unknown Source)
    	at jdk.internal.reflect.GeneratedMethodAccessor171.invoke(Unknown Source)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.multiCast(FileDocumentManagerImpl.java:163)
    	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$new$0(FileDocumentManagerImpl.java:126)
    	at com.sun.proxy.$Proxy32.beforeDocumentSaving(Unknown Source)
    	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocumentInWriteAction$4(FileDocumentManagerImpl.java:443)
    	at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:379)
    	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocumentInWriteAction(FileDocumentManagerImpl.java:442)
    	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocument$2(FileDocumentManagerImpl.java:404)
    	at com.intellij.openapi.application.WriteAction.run(WriteAction.java:102)
    	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocument(FileDocumentManagerImpl.java:404)
    	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveDocument(FileDocumentManagerImpl.java:355)
    	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveDocument(FileDocumentManagerImpl.java:345)
    	at com.intellij.ide.actions.SaveDocumentAction.actionPerformed(SaveDocumentAction.java:19)
    	at com.maddyhome.idea.vim.KeyHandler.executeAction(KeyHandler.java:154)
    	at com.maddyhome.idea.vim.KeyHandler.executeAction(KeyHandler.java:767)
    	at com.maddyhome.idea.vim.group.FileGroup.saveFile(FileGroup.java:164)
    	at com.maddyhome.idea.vim.ex.handler.WriteHandler.execute(WriteHandler.kt:31)
    	at com.maddyhome.idea.vim.ex.CommandHandler.process(CommandHandler.kt:169)
    	at com.maddyhome.idea.vim.ex.CommandParser.lambda$processCommand$0(CommandParser.java:170)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)
    	at com.maddyhome.idea.vim.ex.CommandParser.processCommand(CommandParser.java:183)
    	at com.maddyhome.idea.vim.ex.CommandParser.processCommand(CommandParser.java:114)
    	at com.maddyhome.idea.vim.group.ProcessGroup.processExEntry(ProcessGroup.java:111)
    	at com.maddyhome.idea.vim.action.ex.ProcessExEntryAction.execute(ProcessExEntryAction.kt:43)
    	at com.maddyhome.idea.vim.handler.VimActionHandler.baseExecute(EditorActionHandlerBase.kt:79)
    	at com.maddyhome.idea.vim.handler.EditorActionHandlerBase.doExecute(EditorActionHandlerBase.kt:141)
    	at com.maddyhome.idea.vim.handler.EditorActionHandlerBase.access$doExecute(EditorActionHandlerBase.kt:84)
    	at com.maddyhome.idea.vim.handler.EditorActionHandlerBase$execute$action$1.invoke(EditorActionHandlerBase.kt:122)
    	at com.maddyhome.idea.vim.handler.EditorActionHandlerBase$execute$action$1.invoke(EditorActionHandlerBase.kt:84)
    	at com.maddyhome.idea.vim.handler.EditorActionHandlerBase.execute(EditorActionHandlerBase.kt:126)
    	at com.maddyhome.idea.vim.KeyHandler.lambda$executeVimAction$0(KeyHandler.java:117)
    	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:212)
    	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
    	at com.maddyhome.idea.vim.KeyHandler.executeVimAction(KeyHandler.java:117)
    	at com.maddyhome.idea.vim.KeyHandler$ActionRunner.run(KeyHandler.java:880)
    	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
    	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
    	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
    	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:154)
    	at com.maddyhome.idea.vim.KeyHandler.executeCommand(KeyHandler.java:669)
    	at com.maddyhome.idea.vim.KeyHandler.handleKey(KeyHandler.java:293)
    	at com.maddyhome.idea.vim.KeyHandler.handleKey(KeyHandler.java:170)
    	at com.maddyhome.idea.vim.ui.ExEditorKit$CompleteEntryAction.actionPerformed(ExEditorKit.java:279)
    	at java.desktop/javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1810)
    	at java.desktop/javax.swing.JComponent.processKeyBinding(JComponent.java:2903)
    	at java.desktop/javax.swing.JComponent.processKeyBindings(JComponent.java:2951)
    	at java.desktop/javax.swing.JComponent.processKeyEvent(JComponent.java:2865)
    	at com.maddyhome.idea.vim.ui.ExTextField.processKeyEvent(ExTextField.java:278)
    	at java.desktop/java.awt.Component.processEvent(Component.java:6428)
    	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
    	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
    	at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1950)
    	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:878)
    	at java.desktop/java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1148)
    	at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1017)
    	at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:843)
    	at com.intellij.ide.IdeKeyboardFocusManager.dispatchEvent(IdeKeyboardFocusManager.java:40)
    	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4907)
    	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
    	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
    	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974)
    	at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.java:900)
    	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:841)
    	at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449)
    	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:739)
    	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
    	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
    	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
    	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
    
    
    fix 
    Reply
  • INT?: Implement trait methods and type aliases
    INT?: Implement trait methods and type aliases

    Feb 17, 2017

    This PR extends Implement members functionality.

    1. Added automatic implementation of type aliases (with defaulting type ())
    2. Implement members quick fix now shows a chooser dialog to choose members to implement
    3. Ctrl+I (implement members code insight feature) is now available

    Example of chooser dialog: image

    Example (when all members were chosen):

    #![feature(associated_type_defaults)]
    
    trait Foo {
        type Type1 = i32;
        type Type2;
        type Type3;
        fn foo();
        fn bar();
        fn baz() {}
    }
    
    struct Bar;
    
    impl Foo for Bar {
        type Type2 = ();
        type Type3 = ();
    
        fn foo() {
            unimplemented!()
        }
    
        fn bar() {
            unimplemented!()
        }
    }
    

    Note: I commented out one test, because now quick fix does not automatically generate all members, only after dialog choosing. I don't know how to write a new version of test.

    Reply
  • CARGO: Annotate basic docs in cargo.toml
    CARGO: Annotate basic docs in cargo.toml

    Sep 28, 2017

    Fixes #1776 @matklad Any idea to fix the problem with the test?

    Reply
  • Support symlinks better
    Support symlinks better

    Oct 22, 2018

    Resolve all symlinks in packages and targets.

    Also, resolve symlinks before any call of LightDirectoryIndex to use the same virtual files as we use while index creation

    Should fix #2466, but I don't know how to create good tests for this case Fixes #2633

    Reply
  • `RustImplIndex` revisited
    `RustImplIndex` revisited

    Jul 30, 2016

    RTM

                                                                                                                                                                                                           
    Reply
  • Contributor License Agreement
    Contributor License Agreement

    Jun 28, 2017

    To everyone who has contributed code to IntelliJ Rust: we want to make this plugin officially supported by Jet Brains, but to do so, we need contributor license agreements signed by anyone who had added code to the plugin. If you do not wish to sign such a CLA form, let me know so that I can find a way to back out any changes you may have made.

    To sign the CLA, please follow instructions at https://www.jetbrains.com/agreements/cla/. The procedure consists of a couple clicks: no need to scan or print or snail-mail anything. Comment on this issue after signing the CLA so that I can track progress easily.

    The text of CLA can also be found here.

    It's quite possible that due to recent code rewrites, your change may not appear anymore. If that is the case, I only ask that you verify this, so I can take you off of the list of people we need CLAs from.

    Thank you all!

    Q&A:

    Q: Does this mean that IntelliJ Rust is becoming a closed source proprietary project of Jet Brains?

    A: No, IntelliJ Rust plugin will be free, open source and welcoming to contributors. However it is possible that in the future Jet Brains releases a paid product based on the IntelliJ Rust technology.

    Q: What is the purpose of CLA?

    A: This CLA is for your protection as a Contributor as well as the protection of JetBrains and its users; it does not change your rights to use your own Contributions for any other purpose.

    cc:

    • [x] @alexeykudinkin
    • [x] @alexpana
    • [x] @allengeorge
    • [x] @alobb
    • [x] @alygin
    • [x] @andruhon
    • [x] @ashleysommer
    • [x] @bgourlie
    • [x] @CGavrila
    • [x] @chriskrycho
    • [x] @contradictioned
    • [x] @d9n
    • [x] @daschl
    • [x] @Falkenfighter
    • [x] @farodin91
    • [x] @framlog
    • [x] @friedroman
    • [x] @greg-kargin
    • [x] @himikof
    • [x] @HybridEidolon
    • [x] @johnthagen
    • [x] @jonas-schievink
    • [x] @KalitaAlexey
    • [x] @Keats
    • [x] @kumbayo
    • [x] @la10736
    • [x] @LiamClark
    • [x] @Litarvan
    • [x] @madisp
    • [x] @mbStavola
    • [x] @mcarlin
    • [x] @mfarrugi
    • [x] @mitchhentges
    • [x] @mkaput
    • [x] @mrhota
    • [x] @netvl
    • [x] @ninjabear
    • [x] @oistein
    • [x] @pavel-v-chernykh
    • [x] @Shiroy
    • [x] @sirgl
    • [x] @slavam2605
    • [x] @ThoseGrapefruits
    • [x] @tigarmo
    • [x] @tov
    • [x] @Turbo87
    • [x] @Undin
    • [x] @vasily-kirichenko
    • [x] @winger
    • [x] @zjhmale

    Issue template take from https://github.com/jwiegley/use-package/issues/282 :)

    Reply
  • Implement debugger
    Implement debugger

    Jul 18, 2016

    The work has started: https://github.com/intellij-rust/intellij-rust/tree/fc2cfb8e0fc76984495a34ae6a83cbb37188c699/debugger

    State of the art

    The debugger is officially available in CLion since 2018.1. Note, CLion doesn't support debugging with msvc toolchains, so if you are using Windows, you need:

    • install gnu rust toolchain (rustup install stable-gnu)
    • setup gnu (Cygwin or MinGW) toolchains in CLion (Preferences > Build, Execution, Deployment > Toolchains).

    To debug you just need to:

    • Run debug command via gutter icon 2018-05-28 11 46 26
    • Or create Cargo Command run configurtion
    screen shot 2018-05-28 at 11 50 04 and run debugging via debug action

    2018-05-28 11 52 16

    Old content

    Old content

    If you use CLion and the nightly Cargo, you should be able to Debug Cargo configuration:

    https://zippy.gfycat.com/AcidicMediocreCoati.webm

    A major missing piece is that we don't pass command line arguments to the debuggee yet (this requires some work on the Cargo side of things first).

    Old content 2

    Currently for technical reasons (commit message) debugger is implemented as a separate plugin.

    The current build can be download from TeamCity: Download. It may work with CLion 2016.3.2 and intellij-rust 0.1.0.1611.

    Note that this is super unstable, debugger can invoke any kind of undefined behavior, including, but not limited to, summoning of nasal daemons. Most importantly, rust debugger may (though in theory it should not) break C++ debugging.

    Nonetheless, step into and local variables view more or less work :)

    debugger

    As you can see on the screenshot, at the moment you unfortunately have to create a separate Cargo debug run configuration type (as opposed to the usual Run cargo command). Also, you only can debug binaries now :(

    feature subsystem::debugger 
    Reply