GoLand 2018.2の新機能

Go modules サポート (vgo)

デフォルトでGo modules (別名”vgo”)をサポートします。

より詳しく

移動リファクタリング

移動リファクタリングを改善しました:

  • 新しいMoveダイアログで、どの識別子を移動するか、エクスポートするか、指定出来るようになりました
  • シンボルをパッケージをまたがって移動出来るようになりました。移動出来ないケースでは警告します

新しいクイックフィックス

期待するタイプにコンバート

Convert to expected type クイックフィックスでは言語的に許される限り値を望みのタイプにコンバートします。

欠けているメソッドを実装

新しいクイックフィックスで、期待するタイプがインターフェースである場合もメソッドを追加します。例えば似たメソッドを異なるパラメータセットで作りたい場合、GoLandはどのような変更を加えれば期待するインターフェースとなるのかを説明します。

メソッドの実装

Implement Methodsアクションはインターフェースからだけでなく、タイプから直接メソッドを作ることも出来ます。

新しいインテンションアクション

  • Add dot import aliasにより全てのエクスポートされたシンボルがクオリファイアなしに利用出来るようになりまます。パッケージ名を明示的に利用するよう、逆の変換も出来ます
  • 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 comment option. Use the Except for space to comments 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. In addition, 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.

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 Pushdialog 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サポート

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.

ダークサイドに寝返る

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

44 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.