GoLand 2023.3

Released: Dec 6, 2023

2023.3 での更新項目

機能

AI Assistant [General Availability]

  • The latest updates include enhanced code generation directly within the editor, context-aware AI chat that answers project-related queries without requiring you to copy code, and project-aware AI actions that use extended context to provide more comprehensive results. A new diff viewer makes it easier to identify changes the AI actions have made to your code.
  • AI Assistant for GoLand: Rename - AI Assistant in GoLand will suggest some name ideas for functions to improve readability.
  • AI Assistant for GoLand: Write documentation - The Write documentation action facilitates well-commented code in just a couple of clicks.
  • AI Assistant for GoLand: Generate Unit Test - AI Assistant can help you to create a test for a specific function or method and will suggest adding more test cases after the initial test class has been created.
  • You can use AI Assistant in GoLand as a supplemental feature with a JetBrains AI Service subscription.

Refactorings

  • Create function in another package quick-fix - This quick-fix allows you to type a non-existing function name and then generate implementation in a package of your choice.
  • Extract Parameter refactoring - This release comes with the first part of the Extract Parameter refactoring. The Create Parameter quick-fix for unresolved references allows you to select an unresolved reference and use the quick-fix option to create a parameter. It also allows changing its type if it's not precise enough, providing a default value, and changing the calls with the default value.

Dev Containers [Beta]

  • Support for Dev Containers - GoLand now supports Dev Containers, allowing you to use containers as a full-featured development environment to edit, build, and run your projects. Dev Containers can be run remotely via an SSH connection or locally using Docker.
  • Support for Dev Container Features - This release provides support for Dev Container Features, providing a convenient and fast way to integrate additional tools, runtimes, and libraries essential for development.
  • Support for Docker Compose within Dev Containers - Introduced support for Docker Compose within Dev Containers, enabling the seamless launch of both the main container with the IDE and any dependent containers, such as those with databases or message queues, which are useful during the development process.

Improved code folding

  • One-line returns and panics - For one-line returns and panics, there will now be an option to use the new concise code folding style, which will look much closer to the original code. The new folding syntax is enabled by default. A similar approach is used for case clauses: the upward arrow is removed, and only the double colon is folded.
  • Functions with single returns - Folding for functions with a single return statement has also been enabled.
  • Error handling - To improve the readability of error-handling code, GoLand automatically folds error-handling if blocks. For if blocks with error-handling code, GoLand also folds all single statements, for example, with calls to logging.
  • Disabled code folding for string formatting - Code folding for string formatting has been disabled to make the relevant syntax more visible. What's more, the new approach to code folding allows you to edit code blocks without having to expand them.

Code Completion

  • Switch generation for enums - GoLand can now assist in writing switch statements for enums. It suggests generating cases for all the values in completion.
  • Warning about missing branches when cases contain constant declared using iota - The inspection helps you keep track of switch expressions for iota constants. The inspection warns you about cases not covered by switch and provides two solutions: to add the missing clauses or to add a default clause.

Run and Build

  • Code Coverage profiles for programs - This feature allows you to see exactly what code has been reached in single or multiple runs. It also helps detect dead code. Previously it worked only for test runs, now you can run the main function with Coverage too.

Other Go-related features

  • Parameter hints for slice expressions - Slice expressions can be confusing, especially those with three indices. GoLand will now show you hints while you're building slices.
  • Code insight for custom printf-like functions - GoLand provides a lot of useful features for standard printf-like functions: highlighting of placeholders, error detection, code foldings, etc. Now, all these features are available for user-defined printf-like functions.
  • Data Flow Analysis - Introduced a refined data flow analyzer based on the engine used in CLion. This feature more broadly detects code problems such as potential nil dereference, incorrect or missing error handling, and always true/false conditions.
    • Please note that this feature is currently in early access and is disabled by default.
  • Support local Go installations with asdf - asdf is a CLI tool that lets you manage multiple language runtime versions. Support is now included in this release. GoLand will now check the Go version in the .tool-versions file and use the appropriate Go version for the selected project.
  • Forwards compatibility and toolchain management for Go 1.21 - Go 1.21 and later take better care not to miscompile code that requires an even newer version of Go. Specifically, the go line in go.mod now specifies a minimum required Go toolchain version, while in previous releases, it was a mostly unenforced suggestion. GoLand now fully supports this flow and automatically downloads the SDK version specified in a go.mod file using go or toolchain line. The specified version is also automatically set in Go project settings.
  • Vendoring support performance improvements - Migrated to the modern IntelliJ Platform API, so it does not run go list -m for a second time if the project contains vendor directories. More effective utilization of caches enhances the performance of projects containing many Go modules.

Debugger

  • Run to Cursor inlay option - Added a new Run to Cursor inlay option which offers a quick way to navigate to a specific line of code while debugging. Once your program is suspended, you can hover over the line of code to which you wish to continue execution. You can then utilize the Run to Cursor popup to execute your code until it reaches the line where your cursor is placed.

VCS

  • Support for GitLab snippets - Expanding on the GitLab integration, support for GitLab snippets has been added. You can now create public or private snippets directly within the IDE.

Kubernetes

  • Option to add cluster contexts from a file - You can now easily add kubeconfig contexts from clusters located in directories outside the required system. The project will include links to kubeconfig files, making these clusters available while you work on your project. The kubeconfig contents added in this way won't be copied to or modified in the system (~/.kube/config). This feature is especially useful when you frequently add and remove Kubernetes clusters from cloud or on-premises environments.
  • Auto-installation of Kubernetes tooling - When you start using the Kubernetes plugin, you may need to install kubectl and/or Helm. If you don't have them on your machine already, the IDE will now offer to automatically install them.
  • Improved debugging with Telepresence - Telepresence allows you to debug the microservices of a Kubernetes application locally, as if your workstation were a part of the cluster. In this release, the Telepresence workflow has been made more accessible by moving it to the cluster's context menu. Interception management has also been streamlined for a smoother debugging experience.
  • Support for import block in Terraform - GoLand supports top-level import blocks from version 1.5 of the Terraform configuration language. Import blocks allow you to bring the current infrastructure under Terraform's management. When import is used within a code block, it becomes part of the standard plan and apply cycle and ceases to be a state operation. Terraform performs automatic code generation for imported resources, saving you time when developing infrastructure as code.

Other updates

  • Improvements for TypeScript - GoLand 2023.3 solves some of the inconsistencies encountered when adding import type statements. The option to configure the usage of the TypeScript import type statement or type specifier when importing a type has been added. The behavior for the exports field of package.json for TypeScript files has also been improved.
  • HTTP Client improvements - Improved the Structure view for better navigation within large .http files. This update also introduces color-coded labels for request types and provides a clearer listing of their contents. Support has also been added for declaring variables using @ and authentication with OAuth 2.0 password and client credential grant types.
  • Cypress and Playwright support - GoLand will now automatically detect your Cypress and Playwright tests and let you run and debug them with a single mouse click. The support also includes the ability to explore the results and find issues by navigating the Test Tree.
  • All-in-one diff viewer - This is a revamped way to review code changes. Now, instead of going through each file one by one, you can see all of the modified files from a changeset in a single, scrollable frame.