GoLand 2020.1 EAP 2 is Out with Profiler Labels for Goroutines, Code Completion for Comments and Pointers, and More
You can get this EAP build through the Toolbox App, by downloading it from the website, by using a snap package (for Ubuntu), or from right inside GoLand by selecting Automatically check updates for Early Access Program in Preferences / Settings | Appearance & Behavior | System Settings | Updates.
Don’t forget that you can also use nightly builds based on the latest development code almost every day, which means that you don’t have to wait for the official announcements to access the EAP builds. These nightly builds are only available via the Toolbox App, however.
To help easily distinguish between goroutines during the debug session and core dump analysis, we’ve added profiler labels to them. If you’d like to learn more about pprof labels, check out this article: https://rakyll.org/profiler-labels/.
Also, feel free to vote to add support for the labels in the built-in profiler: IDEA-231106.
Support of Go 1.14 automatic vendoring mode for Go Modules
Go 1.14 RC was released on February 1. In this version vendoring mode is enabled automatically if the module root contains a vendor directory. Read this blog post by the Go team to learn about this change in more detail.
For GoLand 2020.1, we’ve decided to implement similar behaviour for Go versions 1.13 and lower. The IDE will automatically resolve imports to the vendor/ folder if it is present in the module.
Simply put, if you add vendor/ to the module, the IDE will use it. If you remove it, the IDE will use the global Go Modules cache.
In Preferences/Settings | Go | Go Modules, we’ve changed the Vendoring mode checkbox to read Enable vendoring support automatically. This setting cannot be disabled by language rules for Go 1.14, but for versions 1.13 and lower we provide the option to disable it.
In addition, the IDE now correctly shows module dependencies in External Libraries, even when the module has vendor/.
We’ve added Basic Code Completion(⌃Space on macOS and Ctrl+Space on Windows/Linux) for comments, which makes writing documentation more convenient. It suggests names for the current package declarations, and if you make a comment on a package-level declaration, code completion gives it a higher priority level and will show it at the top of the list. In addition, code completion also includes parameter names for functions and methods.
Smart Code Completion provides a list of suggestions for possible pointers in the expression.
The new code inspection Checks for locks erroneously passed by value helps keep you from accidentally copying a value containing a lock (which is a type that implements sync/Locker, such as sync/Mutex or sync/WaitGroup), which can lead to both copies being damaged .
New Commit tool window
The new commit tool window now incorporates the Local Changes and Shelf tabs. This tool window covers all commit-related tasks, like checking diffs, selecting files and chunks to commit, and entering a commit message. Commit is a vertical tool window located on the left, which leaves room for the entire editor to show the diff.
We are very interested to get your feedback about these changes!
We’ve added the new Zen Mode to get rid of possible distractions and to help you focus completely on your code. In its essence, this new mode combines the Distraction Free Mode and the Full Screen Mode, so that you don’t have to enable or disable both of these modes every time you want to enter or exit them.
To enable this mode, go to View | Appearance | Enter Zen Mod, or choose it from the Quick Switch Scheme popup (Ctrl+` | View mode | Enter Zen Mode).