Code Monkey home page Code Monkey logo

zigbrains's Introduction

ZigBrains

Zig language support for IntelliJ IDEA, CLion, and other JetBrains IDEs.

Installing

You can either install this plugin from the JetBrains Marketplace, or from FalsePattern's website.

See the quick setup guide for how to set up language server integration.

Note: marketplace updates are usually delayed by a few days from the actual release, so if you want to always have the latest builds of ZigBrains, you can set up your IDE to download signed releases directly from FalsePattern's website through the built-in plugin browser:

  1. Go to Settings -> Plugins
  2. To the right of the Installed button at the top, click on the ... dropdown menu, then select Manage Plugin Repositories...
  3. Click the add button, and then enter the ZigBrains updater URL, based on your IDE version:
  4. Click OK, and your IDE should now automatically detect the latest version (both in the Installed tab and in the Marketplace tab), even if it's not yet verified on the official JetBrains marketplace yet.

Developer guide

All platforms

After importing the gradle project, you need to run the build setup -> generateSources tasks.

NixOS

In addition to the generated sources, you also need to run the build setup -> nixos_jbr task, otherwise java will complain about missing files

Special Thanks

  • The ZigTools team for developing the Zig Language Server.

  • HTGAzureX1212 for developing intellij-zig, which served as a fantastic reference for deep IDE integration features.

  • The members of the Zig Programming Language discord server's #tooling-dev channel for providing encouragement, feedback, and lots of bug reports.

  • The Ballerina Platform developers for lsp4intellij, the language server connector between the IntelliJ platform and the Eclipse LSP4J project.

  • The developers of the intellij-rust plugin for providing an excellent example on how to write debugger support that doesn't depend on CLion.

  • All the people who have generously funded the project

    • gree7
    • xceno
    • AnErrupTion
  • Every contributor who helped with bugfixes and extra features

  • And everyone who actively reported issues and helped ironing out all the remaining problems

Versioning scheme

To reduce confusion and to better utilize semver, the plugin uses the following versioning scheme:

X - Major version, incremented any time a relatively large features is added or removed Y - Minor version, incremented for smaller features or large refactors that don't change user-perceived behaviour Z - Patch version, incremented only when a fix is purely an internal change and doesn't exceed an arbitrary threshold of complexity (determined at the discretion of FalsePattern)

Note: before version 11, the version scheme used was 0.X.Y, without separate patch versions. As this plugin will constantly be evolving together with the zig language, it makes no sense to keep the 0 prefix, and might as well utilize the full semver string for extra information.

Description

Adds support for the Zig Language, utilizing the ZLS language server for advanced coding assistance.

Quick setup guide for Zig and ZLS

  1. Download the latest version of Zig from https://ziglang.org/download
  2. Download and compile the ZLS language server, available at https://github.com/zigtools/zls
  3. Go to Settings -> Languages & Frameworks -> Zig, and point the Toolchain Location and ZLS path to the correct places

Debugging

Debugger settings are available in the Settings | Build, Execution, Deployment | Debugger menu, under the Zig section.

IDE Compatibility

Debugging Zig code is supported in any native debugging capable IDE. The following have been verified to work so far:

  • CLion
  • IntelliJ IDEA Ultimate
  • RustRover (including the non-commercial free version too)
  • GoLand
  • PyCharm Professional

Additionally, in CLion, the plugin uses the C++ Toolchains for sourcing the debugger (this can be toggled off in the settings).

The open-source Community edition IDEs don't have the native debugging code as it's a proprietary module, so you cannot debug zig code with them. You can still use those IDEs to develop code and use everything else the plugin has to offer.

Windows

Supported debuggers: MSVC

Debugging on Windows requires you to set up the Microsoft debugger.

To do this, go to the following URL and install the MSVC compiler toolset according to step 3 in the prerequisites: https://code.visualstudio.com/docs/cpp/config-msvc

Linux

Supported debuggers: LLDB, GDB

MacOS

Supported debuggers: LLDB

zigbrains's People

Contributors

falsepattern avatar gatesn avatar jensvandewiel avatar marioariasc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zigbrains's Issues

Build error highlighting directly in the editor

First, thanks for this great plugin!


One little thing:

I notice how syntax errors are correctly annotated as an error in the right scroll bar.

CleanShot 2024-08-02 at 11 53 52@2x

Which sets the error count in the top right for the file analysis:

CleanShot 2024-08-02 at 11 56 16@2x


Is the same possible for build errors? It is great that the link in the build output is already clickable, but it would be even more convenient if it would be shown as a 'highlighted error'.

That way, the Next Highlighted Error action would also properly work.

CleanShot 2024-08-02 at 11 53 39@2x

Plugin doesn't recognize ranges in for loops

Consider this simple for loop with a range of numbers:

for (0..10) |_| {}

ZigBrains will throw an error over at the double dots:

'!', '(', ')', <addition op>, <bit shift op>, <bitwise op>, <compare op>, <multiply op>, <suffix op>, and, or or '{' expected, got '..'

But, of course, this compiles fine. Tested with ZigBrains 0.7.0.

`print` snippet does not auto-complete

When I type prin then press tab/enter key, snippet completion done well. but when I type total characters print, it does not doing complete automatically.

Zmpl integration

Hi, at the request of this reddit comment I am checking to see how feasible it would be to add Zmpl (templating language for Jetzig) to ZigBrains.

I have a feeling ZLS integration would be needed first so please feel free to close this issue if that's the only required step.

Thanks in advance !

ZigRun configurations not saving

0.7.0 has missing save logic for the zig run configurations.

Already fixed in a local branch, will be published in the next feature update (0.8)

What about using LSP4IJ ?

I noticed that you have implemented your own lsp support, but I would like to notify you that it exists now a free LSP support for IntelliJ https://github.com/redhat-developer/lsp4ij

Debugging on Windows Does Not Work with MSVC Installed

I recently installed ZigBrains and noticed that completion did not work for external libraries. When I looked around for answers, I saw the instructions for setting up the debugger, but I already had MSVC installed. There's no option to set a path to it and the download button does nothing and the "Download and update the debugger automatically" button just bricks the IDE when I open a Zig project. I am using IntelliJ IDEA Ultimate 2024.1.4 and ZigBrains 15.2.0-241.

Zig Run and Zig Test run actions should be able to utilize build.zig dependencies

Similar to #41, when there are build dependencies, the 'Green Arrows' in the margins to run code/tests will fail, as they rely on the run configuration.

Is there any way to repurpose these to use the build pipeline instead, or is it a limitation of the IDE that means we cannot use the margin-based runners ? (Basically is it possible to optionally replace all usages of 'run' configurations with 'build' configurations ?

A confusing error message when zig is configured without ZLS

It took me a while to decipher what this means:
Screenshot 2024-04-14 at 12 33 09โ€ฏPM

I would suggest one of possible resolutions:

  1. Merge zig and ZLS settings pages together to avoid confusion
  2. Or make messaging more clear: add a note to zig settings that it doesn't setup ZLS and change the error message to point users to a specific settings page and a field where they provide a path to their zls binary.

Clion 2023.2.1 - Startup crash

Thank you for creating this plugin.
New update works on IntelliJ however, Clion crashes during start-up. I've already opened a support request with Jetbrains, because I can't remove the plugin and revert back to original state. This is the stack-trace that I'm getting:

Your JRE: 17.0.8+7-b1000.8 aarch64 (JetBrains s.r.o.)
Apple M1
Clion 2023.2.1

Internal error. Please refer to https://jb.gg/ide/critical-startup-errors

java.lang.ExceptionInInitializerError
    at com.falsepattern.zigbrains.zig.ZigFileType.<init>(ZigFileType.java:30)
    at com.falsepattern.zigbrains.zig.ZigFileType.<clinit>(ZigFileType.java:27)
    at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
    at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1155)
    at java.base/jdk.internal.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:42)
    at java.base/jdk.internal.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:185)
    at java.base/java.lang.reflect.Field.acquireFieldAccessor(Field.java:1132)
    at java.base/java.lang.reflect.Field.getFieldAccessor(Field.java:1113)
    at java.base/java.lang.reflect.Field.get(Field.java:425)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.instantiateFileTypeBean(FileTypeManagerImpl.java:495)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.mergeOrInstantiateFileTypeBean(FileTypeManagerImpl.java:464)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.instantiatePendingFileTypes(FileTypeManagerImpl.java:457)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.initializeComponent(FileTypeManagerImpl.java:588)
    at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:133)
    at com.intellij.configurationStore.ComponentStoreWithExtraComponents.initComponent(ComponentStoreWithExtraComponents.kt:48)
    at com.intellij.serviceContainer.ComponentManagerImpl.initializeComponent$intellij_platform_serviceContainer(ComponentManagerImpl.kt:577)
    at com.intellij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:51)
    at com.intellij.serviceContainer.ServiceComponentAdapter.doCreateInstance(ServiceComponentAdapter.kt:43)
    at com.intellij.serviceContainer.BaseComponentAdapter.doCreateInstance(BaseComponentAdapter.kt:158)
    at com.intellij.serviceContainer.BaseComponentAdapter.createInstance(BaseComponentAdapter.kt:137)
    at com.intellij.serviceContainer.BaseComponentAdapter.access$createInstance(BaseComponentAdapter.kt:21)
    at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invokeSuspend(BaseComponentAdapter.kt:185)
    at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invoke(BaseComponentAdapter.kt)
    at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invoke(BaseComponentAdapter.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceAsync(BaseComponentAdapter.kt:180)
    at com.intellij.serviceContainer.ComponentManagerImpl.getServiceAsyncIfDefined(ComponentManagerImpl.kt:646)
    at com.intellij.serviceContainer.ComponentManagerImpl.getServiceAsync(ComponentManagerImpl.kt:637)
    at com.intellij.ide.bootstrap.AppServicePreloadingKt$postAppRegistered$1$1$1.invokeSuspend(appServicePreloading.kt:179)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: com.intellij.diagnostic.ImplementationConflictException: Language with ID 'Zig' is already registered: class org.ziglang.jb.ZigLang. Conflicting plugins: [com.falsepattern.zigbrains, org.ziglang.jb]
    at com.intellij.lang.Language.<init>(Language.java:89)
    at com.intellij.lang.Language.<init>(Language.java:65)
    at com.intellij.lang.Language.<init>(Language.java:61)
    at com.falsepattern.zigbrains.zig.ZigLanguage.<init>(ZigLanguage.java:25)
    at com.falsepattern.zigbrains.zig.ZigLanguage.<clinit>(ZigLanguage.java:22)
    ... 37 more

-----
Your JRE: 17.0.8+7-b1000.8 aarch64 (JetBrains s.r.o.)
/Users/jalal/Applications/CLion.app/Contents/jbr/Contents/Home

java.lang.IllegalArgumentException: Invalid offsets: start=664; end=681; document length=666 CLion 2023.2.2

CLion 2023.2.2

java.lang.IllegalArgumentException: Invalid offsets: start=664; end=681; document length=666
	at com.intellij.openapi.editor.impl.RangeMarkerImpl.<init>(RangeMarkerImpl.java:53)
	at com.intellij.openapi.editor.impl.RangeMarkerImpl.<init>(RangeMarkerImpl.java:35)
	at com.intellij.openapi.editor.impl.DocumentImpl.createRangeMarker(DocumentImpl.java:507)
	at com.intellij.openapi.editor.Document.createRangeMarker(Document.java:229)
	at com.intellij.codeInsight.template.impl.TemplateState.start(TemplateState.java:327)
	at com.intellij.codeInsight.template.impl.TemplateState.start(TemplateState.java:301)
	at com.intellij.codeInsight.template.impl.TemplateManagerImpl.lambda$startTemplate$1(TemplateManagerImpl.java:163)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:210)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
	at com.intellij.codeInsight.template.impl.TemplateManagerImpl.startTemplate(TemplateManagerImpl.java:166)
	at com.intellij.codeInsight.template.impl.TemplateManagerImpl.startTemplate(TemplateManagerImpl.java:184)
	at com.intellij.codeInsight.template.impl.TemplateManagerImpl.startTemplate(TemplateManagerImpl.java:123)
	at com.falsepattern.zigbrains.lsp.editor.EditorEventManager.prepareAndRunSnippet(EditorEventManager.java:1093)
	at com.falsepattern.zigbrains.lsp.editor.EditorEventManager.lambda$addCompletionInsertHandlers$21(EditorEventManager.java:992)
	at com.intellij.codeInsight.lookup.LookupElementBuilder.handleInsert(LookupElementBuilder.java:336)
	at com.intellij.codeInsight.lookup.LookupElementDecorator.handleInsert(LookupElementDecorator.java:72)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$insertItem$15(CodeCompletionHandlerBase.java:714)
	at com.intellij.util.indexing.FileBasedIndex.lambda$ignoreDumbMode$0(FileBasedIndex.java:213)
	at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:110)
	at com.intellij.util.indexing.FileBasedIndexEx.ignoreDumbMode(FileBasedIndexEx.java:721)
	at com.intellij.util.indexing.FileBasedIndex.ignoreDumbMode(FileBasedIndex.java:212)
	at com.intellij.util.indexing.DumbModeAccessType.ignoreDumbMode(DumbModeAccessType.java:43)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$insertItem$16(CodeCompletionHandlerBase.java:713)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:992)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.insertItem(CodeCompletionHandlerBase.java:697)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.doInsertItemForSingleCaret(CodeCompletionHandlerBase.java:641)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$doInsertItem$13(CodeCompletionHandlerBase.java:613)
	at com.intellij.openapi.editor.impl.CaretModelImpl.lambda$runForEachCaret$3(CaretModelImpl.java:310)
	at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:419)
	at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:319)
	at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:296)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.doInsertItem(CodeCompletionHandlerBase.java:605)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.insertItemHonorBlockSelection(CodeCompletionHandlerBase.java:564)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lookupItemSelected(CodeCompletionHandlerBase.java:510)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.itemSelected(CompletionProgressIndicator.java:180)
	at com.intellij.codeInsight.completion.BaseCompletionLookupArranger.itemSelected(BaseCompletionLookupArranger.java:229)
	at com.intellij.codeInsight.lookup.impl.LookupImpl.fireItemSelected(LookupImpl.java:959)
	at com.intellij.codeInsight.lookup.impl.LookupImpl.finishLookupInWritableFile(LookupImpl.java:588)
	at com.intellij.codeInsight.lookup.impl.LookupImpl.lambda$finishLookup$8(LookupImpl.java:546)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:210)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:164)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:150)
	at com.intellij.codeInsight.lookup.impl.LookupImpl.finishLookup(LookupImpl.java:546)
	at com.intellij.codeInsight.lookup.impl.LookupImpl.finishLookup(LookupImpl.java:531)
	at com.intellij.codeInsight.lookup.impl.actions.ChooseItemAction$Handler.doExecute(ChooseItemAction.java:57)
	at com.intellij.openapi.editor.actionSystem.DynamicEditorActionHandler.doExecute(DynamicEditorActionHandler.java:63)
	at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$4(EditorActionHandler.java:199)
	at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:89)
	at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:198)
	at com.intellij.openapi.editor.actionSystem.EditorAction.lambda$actionPerformed$0(EditorAction.java:93)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
	at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:102)
	at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:77)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:339)
	at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:47)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$myActionProcessor$1.performAction(IdeKeyEventDispatcher.kt:502)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$5$lambda$4(IdeKeyEventDispatcher.kt:865)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$5(IdeKeyEventDispatcher.kt:865)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:362)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner(IdeKeyEventDispatcher.kt:863)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.access$doPerformActionInner(IdeKeyEventDispatcher.kt:1)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction$intellij_platform_ide_impl(IdeKeyEventDispatcher.kt:587)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:513)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.kt:454)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.kt:447)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.kt:309)
	at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:617)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:587)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

zls doesn't work (clion win10)

zls is in analyzing state, syntax highlighting and autocompletion do not work. win 10, CLion 2024.1.4, zls 0.13.0, zig-windows-x86_64-0.13.0

NPE when clicking LSP icon when zls is not set

Report copied from JB marketplace email:

Unfortunately, we had to unapprove the plugin due to the following exception:ย 
ย 

java.lang.NullPointerException: Cannot invoke "org.wso2.lsp4intellij.client.languageserver.wrapper.LanguageServerWrapper.getStatus()" because the return value of "org.wso2.lsp4intellij.client.languageserver.wrapper.LanguageServerWrapper.forProject(com.intellij.openapi.project.Project)" is null
at org.wso2.lsp4intellij.statusbar.LSPServerStatusWidget$IconPresentation.lambda$getClickConsumer$0(LSPServerStatusWidget.java:138)
at com.intellij.openapi.wm.impl.status.IconPresentationComponent$2$1.invoke(IdeStatusBarImpl.kt:878)
at com.intellij.openapi.wm.impl.status.IconPresentationComponent$2$1.invoke(IdeStatusBarImpl.kt:878)
at com.intellij.openapi.wm.impl.status.StatusBarWidgetClickListener.onClick(IdeStatusBarImpl.kt:944)
at com.intellij.ui.ClickListener$1.mouseReleased(ClickListener.java:58)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
at java.desktop/java.awt.Component.processEvent(Component.java:6422)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4954)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4581)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4522)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2808)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:763)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:633)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:588) at com.intellij.ide.IdeEventQueue.access$dispatchEvent(IdeEventQueue.kt:67)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)ย 

Please investigate the reported issue and upload an updated version.ย 

bug: plugin crashes on IDE startup

hi

I am having issues with ZigBrains when opening bun repo (https://github.com/oven-sh/bun). It throws and error on startup, and doesnt provide any highlights.

IDE version:
IntelliJ IDEA 2023.2.5 (Ultimate Edition)
Build #IU-232.10227.8, built on November 9, 2023

Error:

java.lang.NullPointerException: Parameter specified as non-null is null: method com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.getAllEditors, parameter file
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.getAllEditors(FileEditorManagerImpl.kt)
	at com.falsepattern.zigbrains.lsp.utils.FileUtils.lambda$getAllOpenedEditorsForVirtualFile$1(FileUtils.java:93)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:909)
	at com.falsepattern.zigbrains.lsp.utils.ApplicationUtils.computableReadAction(ApplicationUtils.java:55)
	at com.falsepattern.zigbrains.lsp.utils.FileUtils.getAllOpenedEditorsForVirtualFile(FileUtils.java:91)
	at com.falsepattern.zigbrains.lsp.utils.FileUtils.getAllOpenedEditorsForUri(FileUtils.java:87)
	at com.falsepattern.zigbrains.lsp.client.languageserver.wrapper.LanguageServerWrapper.connect(LanguageServerWrapper.java:778)
	at com.falsepattern.zigbrains.lsp.client.languageserver.wrapper.LanguageServerWrapper.reconnect(LanguageServerWrapper.java:681)
	at com.falsepattern.zigbrains.lsp.client.languageserver.wrapper.LanguageServerWrapper.crashed(LanguageServerWrapper.java:647)
	at com.falsepattern.zigbrains.lsp.editor.EditorEventManager.inlayHint(EditorEventManager.java:1396)
	at com.falsepattern.zigbrains.lsp.contributors.LSPInlayHintProvider$LSPInlayHintsCollector.collectHintsForFile(LSPInlayHintProvider.java:76)
	at com.intellij.codeInsight.hints.declarative.impl.DeclarativeInlayHintsPass.doCollectInformation(DeclarativeInlayHintsPass.kt:40)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:57)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:390)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.runWithSpanIgnoreThrows(trace.kt:77)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceUtil.runWithSpanThrows(TraceUtil.java:24)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:386)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1133)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$3(PassExecutorService.java:377)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:376)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:352)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:201)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:207)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:350)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:190)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

ZLS version: 0.11.0

Is it known issue? if so how to fix that?

ZigBrains breaks Rust plugin in CLion

When I load a rust project with the ZigBrains plugin loaded it breaks the rust lsp. I no longer get completions for rust and hover actions no longer work. If I unload the ZigBrains plugin and restart the rust plugin works as expected.

fresh install

Clion

zig version 0.12.0-dev.494+a8d2ed806

latest zls

lldb version 17.0.1

java.lang.NullPointerException: Cannot invoke "org.eclipse.lsp4j.jsonrpc.messages.Either.isLeft()" because "tt" is null
	at com.falsepattern.zigbrains.lsp.contributors.LSPInlayHintProvider$LSPInlayHintsCollector.collectHintsForFile(LSPInlayHintProvider.java:85)
	at com.intellij.codeInsight.hints.declarative.impl.DeclarativeInlayHintsPass.doCollectInformation(DeclarativeInlayHintsPass.kt:40)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:57)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:390)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.runWithSpanIgnoreThrows(trace.kt:77)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceUtil.runWithSpanThrows(TraceUtil.java:24)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:386)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1133)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$3(PassExecutorService.java:377)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:376)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:352)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:201)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:207)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:350)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:190)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)


This happens as it boots up the project. Language server light is green. Get arrows but nothing runs/debugs.

[POLL] Legacy IDEA and stable Zig version support

Zig 0.12.0 has released last week as the current stable release as of writing. For the time being, the 0.13.0 has not diverged too much from 0.12 to require any plugin changes.

When such a change eventually happens, there will be a couple choices available for how to continue the plugin development moving forward:

  1. ZigBrains will always follow the latest development builds of Zig all the way until 1.0, and then only update the plugin when stable builds come out
  2. Only publish latest-stable-zig builds of ZigBrains on the marketplace, and versions that support the current master branch release would only be available on github and my website. Unforunately, doing multi-version on the marketplace is not viable due to their versioning restrictions.

ZLS seems to be doing something similar to this second one, where they publish tagged releases for each tagged zig release, and then continue development on the master branch. This could be viable, however, ZigBrains itself also has its own set of bugs and features that evolve differently from Zig/ZLS that would need to be backported for feature parity.
This is made even worse by the fact that ZigBrains also needs to target multiple IntelliJ version, so just supporting the 4 latest versions of IDEs, plus 2 zig releases (stable and master) would already require 8 different concurrent branches:

master_dev
master_0.12.0
233_dev
233_0.12.0
232_dev
232_0.12.0
231_dev
231_0.12.0

  1. Do the exact same thing as 2., but the IDEA-Zig version pairs would be voted on by the community. If an IDEA-zig version pair doesn't receive any votes, then it will be dropped from maintenance. This will gradually push ZigBrains along with the IDE and Zig release schedules, while not cutting off support blindly. This would be my preferred approach, as i don't want to rely on purely the downloads statistics from the marketplace

Find Usages not working

Thanks for the plugin, it's working great in almost every aspect. One thing I couldn't get to work is "Find Usages" which is a very common workflow. My hotkey for this does nothing. My expected workflow is to hover over a variable, function, or whatever and hit the usage hotkey and have a popup window with all the usages of that across the project. Is this supported by this plugin? The README for this project does mention "find usages" as a feature so am I doing something wrong?

I'm using zigbrains 13.1.0-241 in CLion.

Null pointer on start up

The issue occurred since the last update.

java.lang.NullPointerException: Cannot invoke "String.isEmpty()" because the return value of "com.falsepattern.zigbrains.zig.environment.ZLSConfig.zig_exe_path()" is null
at com.falsepattern.zigbrains.zig.lsp.ZLSStartupActivity.lambda$initZLS$1(ZLSStartupActivity.java:77)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:249)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:840)

the zig commend zig env works fine and the binary path is working fine.

ZLS doesn't launch sometimes

Pycharm 2024.1.4
zls: 0.13
zig 0:13
Configuration:
image
ZLS not work:
image

Am I doing something wrong?
Maybe there is a lack of information in docs.

Autocomplete actions

The autocomplete actions, quick document (Ctrl Q) and quick definition (Ctrl Shift I) have no effect.

KNOWN ISSUES

Bugs in 12.0.0 that are fixed in dev:

  • Code completion freezes the IDE for a second or two
  • Syntax highlighting doesn't work on struct methods

Several bugs in LSP integration

๐Ÿ‘‹ first of all, thanks for the work on this plugin, not having Zig support was the only reason I had to switch to VSCode

However, there're some things that are not working ๐Ÿ˜“
Sadly, I don't have any Java and LSP experience to look at it, so best I can do is leave this here ๐Ÿ˜„
Let me know if you have any questions or I can provide you with some debug logs or anything ๐Ÿ™Œ

Versions

  • Zigbrains: 0.8.0
  • RubyMine: 2023.2.1
  • Zig: 0.11.0
  • ZLS: 0.11.0

Zig configuration:

Screenshot 2023-08-28 at 15 32 56

ZLS configuration:

Screenshot 2023-08-28 at 15 33 06

Problems:

Note: I'm using exact same Zig/ZLS versions in VSCode where I don't observe this issues, so it looks like something doesn't work in the integration with ZLS, not ZLS itself

Status icon

Icon stays red after opening Zig project, after clicking "Restart server" it turns green. It is never yellow so I'm not sure if this is some false positive or something. However, connected files look ok - all the open files are listed there.

Autocompletion

Autocompletion works only sometimes. It works for some struct fields, but not for others. It does not suggest functions from structs assigned to fields (eg. Allocator).

Go to Definition

Does not work at all. Within project or for std.

Syntax highlighting, argument hints etc.

They work upon opening a file, but right after making any change (eg. adding a newline anywhere in the source code) the highlighting is all around broken, argument hints move to random places in the source code like in screenshot below.

I tried it with multiple themes, so it's not a theme issue.

Screenshot 2023-08-28 at 18 11 46

Plugin prevents Python tests from running

I'd love so much to use Zig Brains, it's very neat. Unfortunately, I have a joint Zig/Python project and when the ZigBrains plugin is enabled, IntelliJ seems to want to use Zig for running Python tests.

Is the plugin missing a language filter somewhere perhaps?

Zig fmt parity [Report identation/formatting errors here!]

Expected Formatting:

pub fn logToFile(
    comptime level: std.log.Level,
    comptime scope: @TypeOf(.EnumLiteral),
    comptime format: []const u8,
    args: anytype,
) void {
    const scope_prefix = "(" ++ switch (scope) {
        std.log.default_log_scope => @tagName(scope),
        else => if (@intFromEnum(level) <= @intFromEnum(std.log.Level.err))
            @tagName(scope)
        else
            return,
    } ++ "): ";

    const prefix = "[" ++ comptime level.asText() ++ "] " ++ scope_prefix;

    // Print the message to stderr, silently ignoring any errors
    std.debug.getStderrMutex().lock();
    defer std.debug.getStderrMutex().unlock();
    const stderr = std.io.getStdErr().writer();
    nosuspend stderr.print(prefix ++ format ++ "\n", args) catch return;
}

ZigBrains Formatting

pub fn logToFile(
comptime level: std.log.Level,
comptime scope: @TypeOf(.EnumLiteral),
comptime format: []const u8,
args: anytype,
) void {
    const scope_prefix = "(" ++ switch (scope) {
    std.log.default_log_scope => @tagName(scope),
    else => if (@intFromEnum(level) <= @intFromEnum(std.log.Level.err))
    @tagName(scope)
    else
    return,
    } ++ "): ";
 
    const prefix = "[" ++ comptime level.asText() ++ "] " ++ scope_prefix;

    // Print the message to stderr, silently ignoring any errors
    std.debug.getStderrMutex().lock();
    defer std.debug.getStderrMutex().unlock();
    const stderr = std.io.getStdErr().writer();
    nosuspend stderr.print(prefix ++ format ++ "\n", args) catch return;
}

No output in the Run window

I'm not getting any output when I use the run buttons in Intellij. All I'm running is the default hello world and all I get is the run command and an exit with code 0. I tried running the example fail test code and got an exit code1, but no other result.

When I go to run window and type in zig run main.zig it works fine though.

Any help is appreciated.

Support WSL binaries for zig/zls

The plugin works relatively well, but when working with wsl projects it continues to use windows zig binaries.
It would be ideal that the plugin detects when running a wsl project and uses zig and zls from the wsl path.

Publish to JetBrains Marketplace

Hello!

First of all: thank you for making this plugin! I actually wanted to make one using LSP4IntellIJ, however I had a few issues, and I noticed your PR on that project. That's when I checked your profile and found this plugin! :)

I'm using it with CLion and it's working great, however, I have a favor to ask: could you please publish this to the JetBrains Marketplace? This way, everyone could download it and it could become the ZLS plugin for IntellIJ-based IDEs!

Debugging once using Zig Build with dependencies defined in build.zig.zon

This may be a limitation of the zig tooling rather than this plugin.

Using a Zig-Run does not use the build.zig and build.zig.zon dependencies causing builds to fail where dependencies are required.

Using a Zig-Build will successfully build, and adding the run argument will allow a build to subsequently be run. However, the debugger gets stuck at Connecting. Have tested with both GDB and LLDB.

Plugin version: 13.1.1-233
CLion version: 2023.3.4
Zig: 0.12....nightly
ZLS: 0.12...nightly
OS: Ubuntu 22.04

Cannot create new project

When I create new zig project this error occurs:

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Write access is allowed inside write-action only (see Application.runWriteAction()); see https://jb.gg/ij-platform-threading for details
Current thread: Thread[AWT-EventQueue-0,6,main] 1934587290 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
	at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:149)
	at com.intellij.util.concurrency.ThreadingAssertions.throwThreadAccessException(ThreadingAssertions.java:143)
	at com.intellij.util.concurrency.ThreadingAssertions.assertWriteAccess(ThreadingAssertions.java:138)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertWriteAccessAllowed(ApplicationImpl.java:1262)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.processEvent(PersistentFSImpl.java:1006)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.createChildFile(PersistentFSImpl.java:676)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry.createChildData(VirtualFileSystemEntry.java:318)
	at com.falsepattern.zigbrains.project.ide.newproject.ZigNewProjectWizard$ZigNewProjectWizardStep.createGitIgnoreFile(ZigNewProjectWizard.java:108)
	at com.falsepattern.zigbrains.project.ide.newproject.ZigNewProjectWizard$ZigNewProjectWizardStep.lambda$setupProject$1(ZigNewProjectWizard.java:91)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.lambda$updateModel$9(ModuleRootModificationUtil.java:152)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.modifyModel(ModuleRootModificationUtil.java:160)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel(ModuleRootModificationUtil.java:151)
	at com.falsepattern.zigbrains.project.ide.newproject.ZigNewProjectWizard$ZigNewProjectWizardStep.setupProject(ZigNewProjectWizard.java:83)
	at com.intellij.ide.wizard.AbstractNewProjectWizardMultiStepBase.setupProject(AbstractNewProjectWizardMultiStepBase.kt:75)
	at com.intellij.ide.wizard.NewProjectWizardLanguageStep.setupProject(NewProjectWizardLanguageStep.kt:92)
	at com.intellij.ide.wizard.NewProjectWizardChainStep.setupProject(NewProjectWizardChainStep.kt:44)
	at com.intellij.ide.wizard.AbstractNewProjectWizardBuilder$commitModule$1.invoke(AbstractNewProjectWizardBuilder.kt:44)
	at com.intellij.ide.wizard.AbstractNewProjectWizardBuilder$commitModule$1.invoke(AbstractNewProjectWizardBuilder.kt:43)
	at com.intellij.ide.wizard.AbstractNewProjectWizardBuilder$Companion.detectCreatedModule(AbstractNewProjectWizardBuilder.kt:80)
	at com.intellij.ide.wizard.AbstractNewProjectWizardBuilder$Companion.detectCreatedModule(AbstractNewProjectWizardBuilder.kt:68)
	at com.intellij.ide.wizard.AbstractNewProjectWizardBuilder$Companion.access$detectCreatedModule(AbstractNewProjectWizardBuilder.kt:65)
	at com.intellij.ide.wizard.AbstractNewProjectWizardBuilder.commitModule(AbstractNewProjectWizardBuilder.kt:43)
	at com.intellij.ide.util.projectWizard.ModuleBuilder.commit(ModuleBuilder.java:342)
	at com.intellij.ide.impl.NewProjectUtil.doCreate(NewProjectUtil.kt:155)
	at com.intellij.ide.impl.NewProjectUtil.createFromWizard(NewProjectUtil.kt:84)
	at com.intellij.ide.impl.NewProjectUtil.createFromWizard$default(NewProjectUtil.kt:82)
	at com.intellij.ide.impl.NewProjectUtil.createNewProject(NewProjectUtil.kt:69)
	at com.intellij.ide.actions.NewProjectAction.actionPerformed(NewProjectAction.java:24)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:344)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:318)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:381)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:318)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.invokeAction(ActionUtil.java:553)
	at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:258)
	at com.intellij.ui.popup.ActionPopupStep.lambda$onChosen$3(ActionPopupStep.java:235)
	at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1733)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:169)
	at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:33)
	at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.kt:220)
	at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.kt:186)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:165)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:159)
	at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1731)
	at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:161)
	at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:407)
	at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:130)
	at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:162)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:250)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:238)
	at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:269)
	at com.intellij.ui.popup.list.ListPopupImpl.disposePopup(ListPopupImpl.java:518)
	at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:542)
	at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:505)
	at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:449)
	at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:745)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
	at com.intellij.ui.popup.list.ListPopupImpl$MyList.processMouseEvent(ListPopupImpl.java:810)
	at java.desktop/java.awt.Component.processEvent(Component.java:6422)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4969)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4583)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4524)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2809)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:763)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:635)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:580)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75)
	at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:580)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

zigbrains autocomplete arguments are generated as text rather than placeholders

thanks so much for this plugin, I can finally use clion for zig which is something I've wanted for a long time. however, when zigbrains generates autocomplete arguments they are regular text, rather than the typical argument placeholders. I made a screen cap to show the situation

zigbrainsautocomplete-2023-10-04_11.13.00.mp4

CLion 2023.2.2
Build #CL-232.9921.42, built on September 12, 2023
Licensed to Chris Pickard
Subscription is active until March 2, 2024.
Runtime version: 17.0.7+7-nixos amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.2.0-76060200-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 16
Registry:
suggest.all.run.configurations.from.context=true
debugger.new.tool.window.layout=true
run.processes.with.pty=TRUE
ide.experimental.ui=true
debugger.attach.dialog.enabled=true

Non-Bundled Plugins:
org.rust.lang (0.4.201.5424-232)
IdeaVIM (2.6.0-eap.2)
com.arcticicestudio.nord.jetbrains (0.13.0)
nl.rubensten.texifyidea (0.9.1)
com.falsepattern.zigbrains (0.8.0)
ru.adelf.idea.dotenv (2023.2)
mobi.hsz.idea.gitignore (4.5.1)
nix-idea (0.4.0.10)

Current Desktop: Undefined

Go to definition works only with Ctrl+click

Idea version: Build #IC-233.14015.106
Zig version: 0.12.0-dev.2835+256c5934b
zls version: 8cca7a1fa125494cd840569160c6373d41fce0b6

When I try to use Ctrl+B shortcut I see popup "Cannot find declaration to go to", however when I do Ctrl+click it works. I see that ZigBrains provide some shortcuts, would be nice to have keyboard shortcut for this action available too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.