What′s New in GoLand

GoLand 2018.3 delivers the Change Signature refactoring, supports Testify, and unlocks many tools in the debugger, such as Google App Engine, Go core dumps, and Mozilla rr.

You will also, find new code inspections and intention actions, improved code completion, support for diagrams, updates for VCS, Docker, and Kubernetes, and much more.

2018.3 Nov 21

New Change Signature refactoring

Change Signature refactoring in action

The new Change Signature refactoring gives you many ways to modify a function, method, or method specification signature in just a few clicks!

You can easily change their names and add, remove, reorder, and rename parameters. When you refactor a method specification, GoLand will even ask you if you want implementations to be updated as well.

To learn more, see the detailed blog post on how to use Change Signature efficiently.

Improved refactorings

Problems Detected dialog

Rename refactoring

The Rename refactoring gives you an insight into the potential conflicts that might be introduced by the renaming, if any.

Inline refactoring highlights code after applying

Inline refactoring

GoLand now highlights inlined code after applying the Inline refactoring, to help you catch what has actually happened.

Debugging GAE apps

Debugging Google App Engine application

GoLand now lets you easily run and debug Google App Engine applications locally.

We’ve also added a new App Engine project template.

To learn more, see debugging Google App Engine applications.

Core dumps support

Exploring core dumps in the Debugger pane

Sometimes standard debugging instruments fail to help you understand what’s wrong with the code. This is where core dumps come to the rescue!

GoLand makes exploring core dumps easier without any third-party tools, because all you need to do is to select Run | Open Core Dump.

To create crash dumps automatically, just enter GOTRACEBACK=crash in the Environment field in the Run configuration settings.

Note that core dumps are available only on Linux machines by default. However, you can analyze memory dumps on any flavor of macOS, Windows, or Linux.

Testify support

Run suites from the editor

Now you can run suites and methods as regular test functions, directly from the editor.

The Comparison Failure window helps explore diffs between expected and actual values for failed assertions.

In a related change, Empty test file, Test for function, Tests for file, and Tests for package are available via the Generate popup menu.

Code inspections

Unhandled Error warning in the editor

Unhandled Error

The Unhandled Error code inspection alerts you about functions or methods that return an error whenever the error isn’t being checked.

Unreachable Code warning in the editor

Unreachable Code

The Unreachable Code inspection detects parts of code that can never be executed.

Add format string argument

Add format string generates a placeholder via popup

The Add format string argument intention action generates a placeholder for any provided expression via a popup. It inserts the placeholder into a format string and passes the expression as an argument for the placeholder.

Also, you can enable code folding for format strings that will replace placeholders with the corresponding arguments.

Generate intention actions

Generate Constructor adds functions

Generate Constructor

The Generate Constructor intention action generates functions for creating values of the struct type.

Generate Constructor, as well as Generate getter/setter and Generate getter and setter are available via the Generate popup menu.

Generate getter and setter adds template

Generate getter and setter

The intention actions Generate getter/setter and Generate getter and setter now create boilerplate code and let you customize the pointer/non-pointer receiver type and its name.

Code completion

Code completion provides a set of functions which accept value of type as the first argument

GoLand 2018.3 adds method-like completion for functions. When you have value t of type T and write t.Foo, you can look through functions that accept value of type T as the first argument.

Invoke the Basic completion (Ctrl + Space + Space) twice to see all of the available completion options.

Code editor

Complete Current Statement inserts trailing comma

Complete Current Statement

Complete Current Statement now inserts the required trailing comma automatically in any composite literals (such as struct, slice, etc.) and puts the caret on the position of the next statement. Just press Cmd + Shift + Enter on macOS or Ctrl + Shift + Enter on Windows/Linux.

Navigation between shadowed and shadowing methods

Spot shadowed/shadowing methods

New gutter icons let you better spot shadowed/shadowing methods of embedded types. You can also navigate back and forth in one click, or by pressing Cmd+U on macOS or Ctrl+U on Windows/Linux.

Excluding a specific set of files from the formatting actions

Don't format this set of files

In GoLand 2018.3 and further versions, you can exclude a specific set of files from the code actions Reformat code, Optimize imports, and Rearrange.

Go templates (html/template)

Code completion and Rename refactoring in html/template

As you work with Go templates (html/template), enjoy code completion, find usages, the Rename refactoring, and improved code formatting.

Debugger updates

Evaluate Expression warns about invalid array index and provides code completion

The debugger provides code completion, inspections, and quick-fixes for the Evaluate Expression dialog and the Watchers panel.

Support for Mozilla rr

Debugging with Mozilla rr

We’ve added support for Mozilla rr in the debugger on Linux. It records program executions until you see a failure, so that you can then replay the failing execution as many times as you need under a debugger.

As soon as you install Mozilla rr, everything works in a click. Put a breakpoint and choose the Record and Debug option from the Run/Debug gutter icon in the editor. This action opens the Debugger tab in the Run window with a dedicated Rewind button, which allows you to run the program backwards until the previous breakpoint is reached.

Diagrams support

Go module dependencies diagram

Diagrams allow you to visualize and explore:

  • Go module dependencies (available only in the context menu of a go.mod file).
  • Imports and exports in-context in JavaScript and TypeScript projects.
  • Tables and their relationships in Databases and SQL.

To learn more, see thisblog post about diagrams support.

Search & navigation

Search Everywhere popup shows search results

Improved Search Everywhere popup

The Search Everywhere popup (Double Shift) has a new UI and works faster thanks to an asynchronous approach.

It also provides quick access to Go to type, Go to file, Go to symbol, and Find. Use the TAB key to switch between them.

Searching multiline code snippet via Find in Path dialog

Find and Replace in Path dialogs

The Find in Path and Replace in Path dialogs are better at supporting multiline code snippets.

Multiline TODO comments

Multiline TODO in Go project.

GoLand 2018.3 supports multiline TODO comments for Go, JavaScript, TypeScript, CSS, and SCSS.

GitHub Pull Requests

GitHub Pull Requests shows searching results by state:close and RP description

The new GitHub Pull Requests tool window shows all pull requests from GitHub with their descriptions, current labels, changed files, and assignees. There, you can search by state, assignee, author, after, before, or use sorting. The IDE also helps you create a new local branch or open a pull request on GitHub. To open a new tool window, select View Pull Requests in the menu VCS | Git.

Tools

--pull in Build options field in the Dockerfiles run configuration

Docker plugin

You can now use CLI options for the build part: in the Dockerfiles run configuration, you will find the new Build options field. For now, the following CLI options are supported: cache-from, cpu-shares, cpuset-cpus, force-rm, label, memory, memory-swap, shm-size, no-cache, pull, quiet, and rm.

Code completion in Helm template

Kubernetes plugin update

As you work with Helm resource template files, enjoy code completion, the Rename refactoring, code inspections, and quick-fixes.

For more details, please read this blog post.

Accessibility

High-contrast theme

We strive to make our IDEs accessible to everyone, and this update takes a big step in that direction.

We’ve added new a High-contrast theme, which can be accessed using the drop-down list from the theme options under Settings | Appearance & Behavior or just press Ctrl +  `.

Also, the IDE gets better support for screen readers. GoLand now allows line numbers, VCS annotations, breakpoints, and other gutter icons to be read by a screen reader.

JavaScript and TypeScript

Autoimports in JavaScript

Autoimports in JavaScript

GoLand now automatically adds imports not only for symbols defined in your project, but also for symbols from the project’s dependencies.

Parameter hints in JavaScrip

Parameter hints in JavaScript

As you may know, we have parameter hints in Go, TypeScript, and SQL, so they've come to JavaScript as well.

The inspection notifies that method if null or undefined

Better 'null' and 'undefined' check

The inspection Object is null or undefined notifies you when you get a TypeError because a method is invoked on a value that is undefined or null, or it is passed to a function, or its property is used.

Code completion in package.json

Completion in package.json

GoLand provides suggestions for the latest version, as well as previous ones for the dependencies in package.json.

Cassandra database support

Cassandra database support

Thanks to our wonderful colleagues on the DataGrip team, GoLand now supports Cassandra databases.

Even more changes

Reworked Plugins page
  • The Attach action is available via the Open Project popup. It lets you attach a directory to already opened projects. Click File | Open, and choose the project you want to attach.
  • Drag files and projects to the Welcome screen to open them.
  • The Activity Monitor shows how much CPU the various subsystems and plugins are consuming: Help | Activity Monitor.
  • The Plugins page in Settings | Plugins has been completely reworked, including all the functionality and UI.
  • Indexing is now significantly faster.
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 improvements

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.