No description
Find a file
2024-05-12 03:36:43 +02:00
.github chore: update funding.yml 2023-09-06 16:15:17 +02:00
.idea/codeStyles Initial Commit 2023-07-29 12:22:51 +02:00
gradle/wrapper chore(buildscript): Update gradle and gradle plugins 2024-02-28 22:39:41 +01:00
modules fix: Better parity with the vscode zig plugin in the lsp 2024-05-12 03:36:43 +02:00
plugin/src/main/resources feat: A bunch of zig build debugging QoL changes 2024-04-05 19:43:20 +02:00
src/art/zig chore: Move licenses into a subproject that actually gets pulled into the jar 2024-04-05 15:38:56 +02:00
.gitattributes chore: Enforce LF line endings 2023-08-02 22:08:36 +02:00
.gitignore chore: ignore signing script file 2024-02-21 14:27:05 +01:00
APACHE_2.0.LICENSE chore: Improved license wording 2024-03-23 12:26:07 +01:00
build.gradle.kts chore: The flattening 2024-03-12 13:57:51 +01:00
build.sh ci: autobuild script 2024-03-24 14:39:33 +01:00
CC_BY_SA_4.0.LICENSE chore: Improved license wording 2024-03-23 12:26:07 +01:00
CHANGELOG.md ci: 14.1.0 2024-05-11 15:20:08 +02:00
CONTRIBUTING.md docs: Extra information about module tree 2024-02-29 18:53:59 +01:00
gradle.properties ci: bump IDE versions 2024-05-11 15:17:41 +02:00
gradlew Filter run configuration to only Zig files 2023-09-28 09:34:15 +01:00
gradlew.bat Initial Commit 2023-07-29 12:22:51 +02:00
LICENSE chore: Improved license wording 2024-03-23 12:26:07 +01:00
MODULE_TREE.md docs: Update module tree 2024-03-12 11:24:32 +01:00
README.md docs: Update readme with install guide for github readers 2024-05-11 16:44:55 +02:00
settings.gradle.kts feat: Modularize whole project 2023-08-18 23:58:54 +02:00

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

  • 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 not 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
  4. Open a .zig file, and wait for the circle in the bottom status bar to turn Green (empty). See below (LSP status icon explanation) for an explanation on what the circle means.

LSP status icon explanation

Red (X symbol): LSP server is stopped. You either don't have a proper ZLS path set, or you don't have a .zig file open.

Yellow ("refresh arrow" symbol): LSP server is starting, please be patient.

Green (empty): LSP server is running.

Debugging

Note

Debugging on Linux/MacOS/Unix is only available in CLion, as ZigBrains depends on the C++ toolchains system.

On Windows, debugging is also available with the help of the Native Debugging Support, which is unfortunately only compatible with paid IDEs.

Windows

Due to technical limitations, the C++ toolchains cannot be used for debugging zig code on windows.

Go to Settings | Build, Execution, Deployment | Debugger | Zig (Windows) and follow the steps shown there to set up a zig-compatible debugger.

Linux / MacOS / Unix

ZigBrains uses the CLion C++ toolchains Settings | Build, Execution, Deployment | Toolchains for debugging purposes, and it is fully compatible with both GDB and LLDB debuggers.

Additionally, ZigBrains will prioritize a toolchain if it is called Zig, otherwise it will use the default toolchain.

If no toolchain is available, ZigBrains will attempt to use the bundled LLDB debugger, and if that is not available either, an error popup will be shown when you try to run with debugging.

Note: There is a small issue with the LLDB debugger which does not happen with GDB: The debugger will pause on the first instruction (usually, deep inside the zig standard library's startup code). Unfortunately, we have not found a fix for this yet, but fortunately it doesn't break anything, just a bit of inconvenience.