Our train of Early Access Program builds is quickly approaching its final destination. GoLand 2019.3 has reached the Beta milestone, so starting today we are focusing on polishing things up and getting the IDE ready for the release. Note that while the Beta is quite stable compared to our Early Access Program builds, it may still contain some kinks and glitches.
Since releasing GoLand 2019.2 this summer, we’ve been working hard to reduce the startup times, so that you don’t have to wait as long while IDE prepares everything under the hood, displays the welcome screen, and indexes a project.
We have significantly reworked the first three phases: bootstrap, app initialization preparation, and app initialization. To determine the outcomes of these changes, we’ve measured the startup times of GoLand 2019.3 on different operating systems and compared the numbers with those for previous versions. To get accurate results, we used the same project everywhere, took three measurements of startup times, and calculated the means.
We will keep working on this, so you can expect even faster startup times in future releases.
Go Modules improvements
Great news, we are continuing to extend our support for Go Modules projects. GoLand 2019.3 will provide syntax highlighting and navigation for go.mod files. Press ⌘+B on macOS or Ctrl+B on Windows/Linux on a specific dependency import path and GoLand will navigate you to its sources in the Project View.
Also, in the Project View, the Go Modules will be displayed with their full import path instead of just the last segment of it. The version of each Go Module will also be shown in a more muted font color than the import path to help you easily distinguish between them.
Call Method of an Embedded Field in the Debugger
The Evaluate Expression in the debugger now allows you to call a method of an embedded field directly.
Remote debugging with Mozilla rr
Now it’s possible to debug your applications remotely using Mozilla rr. Follow these steps:
- Collect an rr trace on the remote machine.
- Start the debugger on the remote machine like this:
dlv –headless –api-version 2 -l localhost:2345 replay /path/to/trace/dir /path/to/binary
- Connect to it from the IDE as usual.
Handling unused parameters
For unused parameters, GoLand now highlights its name and type if both can be removed, or only the name, if the type is used for implementing a method specification.
In the latter case, the IDE provides two quick-fixes for you to choose from: Delete parameter names or Rename to _. The same behavior is provided for functions that are used as a function type.
Also, now it’s possible to remove all the unused parameters in one go. Press Alt+Enter and use the Delete all unused parameters quick-fix.
Create method/function if there is no call
Also, the new version of GoLand will provide a quick-fix to create a missing function or method if there is no call. Just press Alt+Enter and choose Create method/function.
Change Signature always shows the type of parameters in the Parameters and Result parameters tabs. Tick the new Reuse types checkbox to collapse consequence types in the Signature Preview.
In addition, you will find the new intention actions, Reuse signature types – which merges parameter definitions in a single declaration, and Expand signature types –which adds types to each parameter via Alt+Enter.
The Move refactoring doesn’t rename package main files that contain a func main() declaration, so they remain runnable.
Extract Variable and Rename
Extract Variable and Rename are now better at suggesting names. For example, err is suggested for expressions of type error, ctx is suggested for context.Context, and so on.
Improved Code Inspections behavior
From the GoLand 2019.3 release, the code inspections will be more focused. We’ve reduced the highlighting range of the detected issues in the code editor. This will help to show the most relevant quick-fixes and intention actions for a particular piece of code when you invoke the context menu via Alt+Enter.
Also, the inspection Bool condition code (part of Declaration redundancy inspections), doesn’t warn you about using const booleans anymore.
Improved code folding for composite literals
GoLand 2019.3 will provide code folding for composite literals. Use the code folding toggles to fold or expand the code fragment, or press Ctrl+NumPad Minus/Ctrl+NumPad Plus on Windows or ⌘+NumPad Minus/⌘+NumPad Plus on macOS. To configure the default code folding behavior, go to Settings/Preferences | Editor | General | Code Folding.
Syntax highlighting for reassignments in short variable declarations
Go allows using existing variables on the left-hand side of short var declarations. Thus, two constructs that look the same can have a different meaning. To make this easier to spot, we’ve added syntax highlighting for such reassignments.
Improvements of the rune literal lexer
We’ve improved the rune literal lexer in several ways:
- GoLand doesn’t highlight a valid rune literal as an error after editing.
- Parsing of invalid rune literals is more stable now.
- GoLand provides a more concise and clearer error message of why this expression is incorrect.
Live templates enhancements
The live templates
forr now suggest relevant variable names. For example, names like
index are suggested for an
line are suggested for a value.
The live template meth now provides code suggestions for receiver names.
Search only in a selected area
Search only in a selected area when using the Find action (⌘+F on macOS and Ctrl+F on Windows/Linux). Simply select the piece of code you need in the editor and invoke the Find action – the IDE will then perform the search only in the selected area. To easily switch to searching within the whole file, press ⌘+F / Ctrl+F a second time, or alternatively toggle the In Selection option in the bar.
Find in Path displays file extensions when using a file mask option
Now when you search in the Find in Path dialog using a file mask, GoLand shows the file extensions in the search results accordingly. This makes it easier for you to distinguish between files with the same name but with different file extensions.
Enable Global File Watcher for every new project
In GoLand 2018.2, we’ve added an option to share a file watcher configuration among different projects using the Project and Global options – it’s called a Global File Watcher.
However, you would have still needed to enable this watcher in each new project. Now, it’s possible to enable this watcher by default in every new project you create or open.
In the menu File, select Other Settings | Settings for new projects, then go to Tools | File Watchers, add a new global watcher, and then select the checkbox next to it to enable it in all new projects.
Reworked Clone dialog
The Clone dialog is located under VCS | Get from Version control. Now you can log in from this dialog, or if you’re already logged in, the IDE will instantly preview the lists of all repositories grouped by accounts or organizations.
GoLand 2019.3 will provide basic support for MongoDB. Now you can:
- View collections and fields in the database explorer.
- Open any collection or observe the query result. It’s also possible to sort by columns or filter the values.
- Run queries and get the results. Select a statement and run it by pressing Ctrl/⌘+Enter or by using the Play button on the toolbar.
Search with Google for connection error
It’s now easier to explore connection errors. When a connection fails, you can just press the dedicated button in the IDE to move to the search results of your error in the Google search engine.
Updates for Hierarchy tool window
There is a new option to analyze the callees’ method hierarchy in the Hierarchy tool window. Previously, it was only possible to explore the callers of a selected method. Now, we’ve added two dedicated buttons to easily switch between the callers and callees of the selected method. Also, now you can sort the elements within a tree alphabetically, by clicking a special button in the menu. To see the Hierarchy tool window in the Tool Windows list, you need to build a hierarchy first, go to Navigate | Call Hierarchy or Navigate | Type Hierarchy.
Now you can make the scrollbars more visible. To do this, select the Use contrast scrollbars checkbox in Preferences/Settings | Appearance & Behavior | Appearance.
Set a custom shortcut for returning the focus to the editor
An ability to set your custom shortcut for the action that takes the focus back to the editor, instead of using ESC. Find the Focus Editor action in Preferences/Settings | Keymap, right-click it, and select Add Keyboard Shortcut from the drop-down.