The upcoming GoLand 2019.2 has reached the Beta milestone today! This means that we’ve stopped adding new features for this release cycle, and are now focusing on polishing everything that’s destined for the release build. The Beta is quite stable in comparison to our Early Access Program builds, but it may still contain some clumsiness.
There’s enough time to smooth out any rough edges though, so if anything rubs you the wrong way, do speak up! We want to hear about your experience. Even if you don’t come across any bugs or difficulties, we’re happy to chat about whatever or just say hello. Write something in our YouTrack, tweet us, or ping us right here in the comments. Your opinion matters to all of us at GoLand.
Click on a topic below to learn more about a specific area you’re interested in, or read through the whole blog post to get yourself up to speed with all the latest enhancements.
- Debugger Improvements
- Improved Default & Darcula color schemes
- Support for Go 1.13 features
- Custom Postfix Completion and .aappend templates
- Quick-fixes based on Change Signature
- Extract Method with returns
- Code Completion
- Cleverer Go Modules and dep integration
- Code Inspections
- Code Editing
- UI Enhancements
- Other handy updates
- Version Control
- Shell Script support
From release to release, the debugger is becoming more powerful by expanding its feature set. This release is no exception.
Function calls support
We’ve added support for function calls during debugging. It can help you examine in detail what is going on inside your expression at any specific point in your program’s execution. This feature relies on the experimental function call support feature from Delve and the Go Runtime. Please note, there might be bugs that you encounter and if you do, please report them to us.
Better presentation for time.Time, time.Duration, and net.IP types
The upcoming GoLand 2019.2 displays the value of struct derived from
net.IP types in a human-readable format in the Variables pane of the Debugger.
Int as binary, decimal, or hexadecimal by default
Earlier in GoLand 2019.1, we added options for how to display integer variables in the debugger. You can go with binary, decimal, or hex, by right-clicking on the variable and selecting the preferred option under View as. In GoLand 2019.2, you can now choose and set appropriate default display type format; this can be adjusted in Settings/Preferences | Build, Execution, Deployment | Debugger | Data Views | Go.
Result of String(), Error(), and DebugString() method implementations in the Debugger
The debugger now shows the results of simple
DebugString() method implementations in the Variables pane. It supports methods with a single return statement without any logic. A returned value from the method can be:
- a string literal.
- a receiver field expression.
- a call to
fmt.Sprintf()with a constant format containing only supported verbs and either string literals or receiver field expressions as format arguments.
The supported verbs are
%p, without a width, precision, and argument index.
Improved Default & Darcula color schemes
The Default and Darcula color schemes available under Settings/Preferences | Editor | Color Scheme has added variety to the semantical colors of code elements. We think it now looks a little neater visually as we’ve got rid of bold formatting.
On top of that, methods’ receivers, function declarations and calls now have their own colors, too. Hooray!
Support for Go 1.13 features
GoLand 2019.2 supports number literals and signed integers as shift counts. These changes are related to the step towards to Go 2. Please read the official Go blog post to learn more.
GoLand’s code highlighting will alert you to any mistakes, and it will correctly show you the output in the Console.
Read this article to learn more about the new Go 1.13 features and how GoLand 2019.2 supports them.
Custom Postfix Completion and .aappend templates
First, GoLand 2019.2 will let you create your own custom Postfix Completion templates.
To start creating a new postfix template, navigate to Settings/Preferences | Editor | General | Postfix Completion, click +, select Go, define your template, and choose the scopes where the template will be applicable.
Second, the .aappend Postfix Template, which we all have awaited for so long, can now be found under Settings/Preferences | Editor | General | Postfix Completion. Use it to prepend an expression with a built-in append function call and assign its result to that expression.
Quick-fixes based on Change Signature
We have added a bunch of quick-fixes based on the Change Signature refactoring. For example, with the simple press of Alt+Enter, you can automatically infer and add a parameter to the function call, or add missing return parameters in a signature.
Extract Method with returns
The Extract Method refactoring now handles code with return statements. If the code always exits via returns, it will be extracted as is. However, if it contains execution paths without returns, the extracted method will have an additional boolean flag as a return value. The flag will be used to perform an early return on the call side.
Code completion now provides suggestions for receiver members even if there’s no receiver. Receiver names like this or self are discouraged. As a result methods have different receiver names. This code completion feature allows you to ignore the difference.
Cleverer Go Modules and dep integration
GoLand 2019.2 will enable Go Modules/dep integration automatically when it detects that a project uses Go Modules or dep. Previously, it disabled GOPATH indexing and showed only a notification about enabling Go Modules/dep integration. We noticed that was not enough though, because it was easy to miss or ignore the notification and thus get a project in a semi-configured state.
If this doesn’t work for you, you can disable the integration manually in Settings/Preferences | Go | Go Modules (vgo) at any time.
A code inspection called Redundant type conversions helps you keep your project more readable and neat. It warns you about redundant type conversions that can be omitted.
GoLand 2019.2 adds specific features designed to help you read and write code faster.
Support for escape sequences
Support for escape sequences in string literals is fully equipped with:
- An inspection that will warn you about potential problems.
- Smart editing that understands the location of escape sequences.
- More precise spell-checking.
Moreover, formatting placeholders are now highlighted in a different color so you can more easily spot them in long strings. You can customize the color via Settings/Preferences | Editor | Color Scheme | Language Defaults | String | Escape Sequence | Valid. Or, for Go only, go to Settings/Preferences | Editor | Color Scheme | Go | String | Valid escape.
Validation of slice indices in composite literals
We’ve added validation of slice indices in composite literals! This means that the editor will warn you that your index must be a non-negative integer constant before you compile your project.
Filling fields of structs is now easier. First, you can choose which fields you want to fill in a dedicated window. Second, generated values can now be edited. Finally, this action is now available via Code Completion
Open implementations/implemented types searches in Find tool window
Now it’s possible to explore implementations/implemented types searches in a dedicated tab of the Find tool window. It allows you to navigate to the source code, group results in many different ways, and much more.
Also, Go to Implementations, in the case of one interface and one implementation reference, navigates directly to this implementation. Call it up with Alt+Ctrl+B on Windows/Linux or Alt+Cmd+B on macOS.
Fresh look for New | File dialog
The New | File dialog has been turned into a popup with a list of all the possible options for a particular file type to create. Previously, you had to expand the list to choose an alternative, but now all the available options are immediately visible.
GoLand 2019.2, as well as our other IntelliJ IDEA-based IDEs, has also added a modern new borderless look on Windows.
Tidy Find tool window
In the Find tool window, we have grouped together some rarely used icons and removed some altogether.
Improved Plugins page
Now GoLand shows the plugin details right away, without any need to open the plugin’s detail pages one by one. We’ve added more options under the gear icon, to let you disable or enable all the downloaded plugins all at once. The Update button is now placed near the plugin name in the Installed tab. The Updates tab is gone as it isn’t necessary anymore.
Other handy updates
More Scope chooser options
New scopes such as Recently Changed and Recently Viewed Files, Files in Previous Search Result, and Selection are all now added to the Scope chooser. You will also be able to select the Data Sources scopes. In addition to this, we’ve added an ability to select a scope for Rename refactoring. Double press Shift-F6 to invoke the Rename refactoring window, and choose the scopes where the renaming will be performed.
New option to control caret movement
The default behavior of the Move Caret to Next Word action in GoLand 2019.2 has changed: the IDE will move the caret to the end of the current word. However, you can adjust it as needed. Go to Settings/Preferences/Settings | Editor | General and select where the IDE should place the caret: at the end of the word, at the beginning of the next word, or even between both boundaries.
More info in the Project View
Toggle In-place Descriptions under the View menu to get a preview of the file size, and date and time modifications in the Project View.
Improved Extend Selection
Extend Selection now extends the code in a semantically correct way, from line to a block of code separated by empty lines, instead of selecting the whole method body.
Commit from the Local Changes
The upcoming GoLand 2019.2 provides a way to commit directly from the Local Changes.
Now while working on a commit, you will be able to browse through the source code, view the history for a specific file, view the diff for the file in the same area as the commit, or use the other features of the IDE. Previously, all these actions were impossible because the modal commit dialog blocked all the other IDE functionality.
The Amend Commit action will be available from the Commit toolbar. Alternatively, you will be able to amend a commit using the new shortcut Alt+M on Windows and Linux, or Ctrl+Alt+M for macOS. More commit options will be available under the settings icon on the Commit toolbar and can be invoked on demand.
When there is a history of commit messages, as before you will be able to use the Ctrl+M shortcut (Windows, Linux, macOS) to view it, or you can click the Commit Message History icon in the bottom left corner.
To enable this functionality and commit from the Local Changes without a dialog, turn on the checkbox Commit from the Local Changes without showing a dialog in Settings/Preferences | Version Control | Commit Dialog.
Abort Merge option
We added an Abort Merge option that will be available in the Branches popup when there is an ongoing merge. This is the future many of us have dreamed of, where you don’t need to switch to the terminal anymore to abort things.
Forgotten files prediction
GoLand 2019.2 will remind you to include into a commit the files you commonly modify, together with the files you’re currently committing.
Prompt to add files that were copied into a project externally
GoLand will prompt you to automatically add to the version control any files that have been copied into the project from outside the IDE, or files that were created in the console or during code execution. Previously, GoLand marked such files in red to indicate that they were not under version control.
Customizable VCS Log columns
Click on the eye icon to choose the columns to display in the Log tab, select the Show Columns item from the context menu and choose the columns you want to see: Author, Date, or Hash.
Improvements in ignore files handling
All IntelliJ IDEA-based IDEs are switching to native ignore files handling. Not only will GoLand correctly highlight all the ignored files, but you will also be able to add a file to .gitignore using the context menu from the Local Changes tab of the VCS tool window, so you don’t need to do it manually anymore. Also, code completion is supported in .gitignore files.
Show history for directory works through Git Log
GoLand 2019.2 will allow you to view the directory’s history in the Log tab. Select the History Up to Here action from the context menu, and the IDE will show the Log filtered by the respective path.
View Git history for multiple folders
Also, it will be possible to select several folders in Project View and see all changes in any of these folders. Select the folders you want to check the changes in and choose Git | Show History from the context menu.
Browser for Docker container file system
In the upcoming GoLand 2019.2, you can view the file system of the running Docker container. The file system will be displayed in the File tab of the Docker node in the Services tool window.
With the Kubernetes plugin, GoLand 2019.2 provides editing support, code completion for keys and paths, many inspections, and the Rename refactoring. It will also let you navigate from a declared path to the associated packages or files in the project view for Kustomize resource files.
Shell Script support
GoLand 2019.2 will provide support for shell scripts, including word and path completion, Quick documentation preview, and even text-based rename.
On top of that, we’ve added integrations with:
- Shellcheck, a tool that detects code issues and provides quick-fixes for them.
- Shfmt, an external formatter engine. To start working with it, you just need to invoke the Reformat Code action and GoLand will suggest installing it for you.
- The Explainshell website, which gives you a detailed explanation for the selected command if you simply press Alt-Enter on it.