What′s New in GoLand

GoLand 2018.2 integrates Go modules out of the box (formerly known as vgo), takes the Move refactoring to the new level, adds new quick-fixes, expands Postfix Completion and Intention Actions families, and evolves the debugger. The release makes working with VCS better across the board, and incorporates many other features from the latest IntelliJ Platform release such as frontend-related updates and Touch Bar support.

2018.2 Jul 25

Go modules support (vgo)

This update provides integration with Go modules (a.k.a "vgo") out of the box.

To learn more, see vgo integration support in GoLand 2018.2 EAP.

Move refactoring

We’ve improved the Move refactoring:

  • The new Move dialog shows whether an identifier is needed, and lets you decide if each of the identifiers will be exported or moved.
  • You can now move symbols across packages. If such a move is not possible, the IDE will alert you accordingly.

New quick-fixes

Convert to expected type

A new quick-fix called Convert to expected type converts a value to the desired type whenever the language permits.

Implement missing methods

This new quick-fix lets you quickly add missing methods if the expected type is an interface. For example, sometimes you may implement a method with a similar name but with a different set of parameters. In this case, the IDE will explain what needs to be changed to the method to make it compliant with the interface you are trying to implement. Knowing why an interface is not implemented by a type is not enough, so the IDE now allows you to also implement the interface straight from where the usage occurs.

Implement Methods

Implement Methods action is now able to not only add methods from an interface to a chosen type, but also create this type right away.

New Intention Actions

  • Add dot import alias lets you quickly add the dot alias to an import which makes all exported symbols available without a qualifier. Conversely, Remove dot import alias helps switch back to using the package name.
  • Introduce local variable lets you add variables for function/method calls that return values.

New Postfix Completion

  • The .sort template transforms array or slice expressions and prepends them with an applicable sort method based on the element type. If the element type is a custom type, it will use the sort.Slice method.
  • The .rr template combines the power of two already available templates, .rre and .rrv, and сan be called on variables and expressions at the same time.

Code Style improvements

As you know, comments in Go are also used as annotations. In some libraries, spaces between comment markers and annotation instructions are not processed correctly.

In GoLand 2018.2, it is now possible to disable leading spaces for annotations that start with certain prefixes. If you go to Settings | Editor | Code Style | Go | Other, you will now see a custom exclusion list for the Add leading space to comments option. Use the Except for comments starting with field to add any prefix name that you want to add as an exception.

Debugger updates

Non-suspending breakpoints

The debugger supports non-suspending breakpoints. It allows you set a breakpoint and log it in the console, or even get the stacktrace of the breakpoint when it was reached and then resume the execution. You can also do these actions when a breakpoint is hit and it stops.

In a related change, this update comes with the latest version of Delve which resolves a number of issues. As usual, make sure that you are using the latest Go version available in order to get the most out of the debugging session.

Lazy-loading for arrays, maps, and slices

Also, the debugger now supports lazy-loading for arrays, maps, and slices; supports deep nesting in maps; and offers a better presentation of key-value pairs in maps and slices.

Tools

Global file watchers

In this release cycle, File Watchers gets a simple but very user-friendly feature to help reduce setup redundancy for developers working with many projects.

Previously, it was possible to set a File Watcher only per project. Now you can configure the level of impact to choose between the Project and Global option. You can also limit the scope to enable/disable the state of each Global Watcher per project. With File Watchers, you can track changes to your files and run third-party standalone applications.

Docker

The Docker plugin now recognizes several new runtime command line options in the run configuration: all the memory options, --security-opt, and the option to support GPU: --runtime=nvidia. Additionally, you can now use the --rm option in Docker Run/Debug сonfigurations to launch a temporary container which will be automatically cleaned up after termination.

Docker gets an option to specify the base directory for executing a Docker build command for a dockerfile in the Context folder field of the Docker run configuration.

Version Control

Merge Conflicts

A new Merge Conflicts node groups files with merge conflicts for each changelist, making it much easier to find them. The Resolve action link will open an improved Files Merged with Conflicts dialog. Now it displays the Git branch names when you perform a Pull, Merge, or Rebase, and allows you to group files by directory, which is especially useful when you have multiple files merged with conflicts.

Enhanced Log tab

The Log tab of the Version Control tool window adds these improvements:

  • Open as many Log tabs as you need.
  • Quickly filter commits by your favorite branches with the Branch filter.
  • Easily delete a Git tag from a commit right from the context menu.
  • Explore the Diff Preview Panel without switching the context.
  • Monitor the state of the repository using the new Browse Repository at Revision action via the context menu, available only for Git version control.

Skip the Push dialog for Git

In GoLand 2018.2 you will find an option to skip the Push dialog completely when using the Commit and Push action.

Alternatively, you can choose to only show this dialog when pushing to protected branches. Set this up in Settings | Version Control | Git | Show Push Dialog for Commit and Push.

Multiple GitHub accounts

Now you can easily manage as many GitHub accounts as you need without switching between them. Just configure all the accounts you use in Settings | Version Control | GitHub, and assign the default GitHub accounts for each of your projects.

User Interface

Touch Bar support

Good news for MacBook Pro owners! GoLand 2018.2 provides a completely new IDE experience: run, build, debug your project, commit changes and more – right from the Touch Bar. All the available Touch Bar contexts can be customized on the Touch Bar page in Settings | Appearance & Behavior | Menus and Toolbars.

Turn to the dark side

You can now enjoy GoLand with darker title bars. Go to Settings | Appearance & Behavior | Appearance and select Use dark window headers to try this out.

Last but not least, like other IDEs based on IntelliJ Platform, icons in GoLand have got a new look aimed to eliminate visual clutter and improve readability, findability, and clarity.

To learn more, see New icons in IntelliJ Platform 2018.2.

JavaScript and TypeScript

TypeScript improvements

Support for TypeScript 2.9 and the upcoming TypeScript 3.0 releases.

Besides that, GoLand offers more quick-fixes provided by the TypeScript language service itself, such as Annotate with type from JSDoc.

New intentions

This update brings a lot of new intentions available via Alt+Enter. Here are just some of them: Implement interface, Create derived class, Implement members of an interface or abstract class, Generate cases for 'switch', and Iterate with 'for..of'.

Find unused code

With the new Code Coverage feature, you can find any unused code in your project. Start a JavaScript Debug configuration with coverage in GoLand, interact with your app in Chrome, and then stop the configuration. The report will show you what and how much code was used in each file and folder.

2018.1 Mar 27

New Move refactoring

In the update, we’ve added the Move refactoring. This refactoring allows you quickly move any top-level member to another file of the same package. A cross-package move is not yet allowed.

Code Completion

Default value completion

If the caret stays on the right-hand side of a return statement inside a function, the code completion will now suggest a default value corresponding to the return type of the function.

Negate completion

A bool expression suggested by code completion can now be selected and negated at the same time by pressing !.

New Postfix Completion

  • The .if template transforms a bool expression into an if statement
  • The .p template prepends an expression with a pointer operator

More Intention Actions

    There’s a number of new intentions added to the update, e.g. Flip for binary expressions, Negate, Negate recursively, and Invert for boolean expressions.

Better inspections

Some of the inspections that correspond to go vet and which are supposed to run before a go test in Go 1.10 were improved. The IDE will give a warning with type mismatches for the calls of fmt.Printf and with invalid build tags.

Auto-format on Enter

If you now click Enter when the caret is on a chain call or a string literal, the IDE auto-formats the resulting code.

Optimize imports on the fly

The editor is now able to remove import statements for unused packages on-the-fly as you type. This is convenient as you don’t have to remove those import statements by yourself anymore. This option is called Optimize imports on the fly. You can enable it in Settings | Go | Imports.

Dep integration

Now, when you work with a dep project and open a file that has an unresolved import statement, the IDE offers a quick-fix that runs dep ensure.

To create a new dep project, open the Project Wizard and switch to the Dep tab on the left-hand side of the dialog.

New documentation popup

The Quick Documentation pop-up is now aware of example functions and includes them as part of the documentation. If you click the example function’s name, the IDE will open a Scratch File with the function’s code.

Scratch File improvements

A Scratch File, created from a Go code selection, now automatically gets all the proper import statements. Also, Scratch Files are now created from predefined templates, which can be customized in Settings | Editor | File and Code Templates.

Debugger enhancements

The update allows you to now attach the Debugger to locally running processes. To do that, the only thing you have to do is click Run in the main menu and choose Attach to Local Process and select a process to debug.

Also, when debugging, the IDE can distinguish the shadowed variables in the Watches and Variables tabs of the Debugger tool window.

Better Run capabilities

Test runner updates

The update supports the hierarchy of tests and correctly attributes the output and compilation errors to individual tests and packages.

Running multiple files

The updated Go Build run configuration now lets you select and run multiple files.

Other coding assistance improvements

Here’s a list of some other improvements that will make your life much easier:

  • The coding assistance provided by the IDE has been updated to fully support all the Go 1.10 features.
  • The name suggestion algorithm used by Extract Variable, is now aware of the context and avoids name collisions.
  • The auto-import mechanism has been made smarter and now applies only if the resulting code compiles with no errors.



  • The Rename refactoring and Find Usages for global symbols are now much faster.
  • To improve the IDE performance, the update allows you to limit the indexing scope in your project, e.g. to avoid indexing an entire GOPATH. The new option is available in both File | Settings | Go | GOPATH | Index entire GOPATH and the Project Wizard.

Git

Partial commits

With the update you can now associate individual changes within a file with different changelists, commit and push them separately; similar to git add -p.

To include a change to a commit, use the checkboxes in the gutter in the Diff pane of the Commit Changes dialog. To move an individual change across changelists, use the change marker on the left-hand side of the editor.

More rebase actions

When you’re doing a rebase, there are now new Abort Rebase, Continue Rebase, and Skip Commit actions available in the Git Branches pop-up.

JavaScript and TypeScript

TypeScript improvements

The update supports the new TypeScript 2.7 features, and also has a new Surround with type guard quick-fix for unresolved properties.

Smarter Rename refactoring

The Rename refactoring for classes now offers to rename the files as well. The refactoring is now available as an intention action on classes.

Reformat with Prettier

The update integrates Prettier, an opinionated code formatter. After you have the prettier package installed, the new Reformat with Prettier action becomes available.

Extract a Vue component

The update allows you to select an arbitrary fragment of a Vue template, and ask the IDE to extract it as a separate Vue component via Refactor | Extract or via Alt+Enter.

Deployment

Docker

The Docker Compose run configuration dialog has been improved with support now for multiple compose files, and the ability to choose which services to run.

The Docker tool window can show all the Docker Compose projects that are configured within the project files and not only those that are configured with run configurations.

Kubernetes

The update introduces initial support for Kubernetes through a plugin. The support includes code completion, inspections, quick-fixes for resource files, icons in the gutter for easier navigation, pop-up documentation, and live templates.