📜 ⬆️ ⬇️

GoLand 2019.2: support for function calls during debugging, improved color schemes, custom Postfix Completion

Today we released GoLand 2019.2 and we are in a hurry to tell you about what has appeared in the new version.




Support for function calls during debugging


Now you can find out what happens to the expression at any time during program execution.




Please note that this functionality is based on experimental support for function calls in Delve and Go Runtime.


If you encounter errors or problems related to the support of function calls, report them in our tracker .


Improved default and Darcula color schemes


In version 2019.2, we diversified the semantic code highlighting in the default and Darcula color schemes.



')

The change helps you quickly understand the code and understand its logic. Now it’s easier to distinguish package names from variables, built-in code constructs from your own, and type conversions from function calls.


In addition, method receivers and function calls received distinct colors. As usual, you can customize the schemes to your taste in the menu Settings / Preferences | Editor | Color Scheme .


Debugger Updates


More information about variables with String (), Error (), and DebugString () method


Implementation results of String (), Error (), and DebugString () methods can be viewed in the Variables panel. Methods consisting of a single return statement are supported, without complex logic.




Convenient display format for special types


In GoLand 2019.2, expression values ​​like time.Time, time.Duration, and net.IP are displayed in a readable format in the Variables panel.




Default Integer Variable Format


You can choose the default display format for integer variables in the debugger: binary, decimal or hexadecimal. Set the desired format in the Settings / Preferences | Build, Execution, Deployment | Debugger | Data Views | Go




Functionality Support Go 1.13


GoLand 2019.2 supports binary integer literals and bit shifts by a signed integer, which will appear in version Go 1.13.




Read the official Go blog for details.


GoLand highlights errors in the code and correctly displays the output in the console.


Read about the new features of Go 1.13 and their support in GoLand 2019.2 in this article ( in English ).


Custom postfix auto-completion templates


GoLand 2019.2 allows you to create your own postfix auto-completion templates .


Go to Settings / Preferences | Editor | General | Postfix Completion , press " + ", select Go , create a template and specify its scope. Read more about creating templates in this article .




In addition, you can use the new predefined postfix auto-completion template - .aappend. With its help, a built-in call to the append function is added to the beginning of the expression and its result is assigned to the expression.




Quick fixes based on Change Signature refactoring


We've added quick fixes based on Change Signature refactoring. For example, to automatically output and add a parameter to a function call or add missing return parameters to the signature of functions and methods, just press Alt + Enter .




Support for return expressions in Extract Method


Refactoring Extract Method is now able to extract code with return-expressions.


If the code always ends with return, it will be retrieved unchanged. Otherwise, the extracted method will have an additional logical value as the return value. It will be used to exit the function on the call side prematurely.




Code completion improvements


Auto-completion offers options for fields and structure methods, even if the receiver is not explicitly specified.




Advanced Go Modules and dep Integrations


In GoLand 2019.2, the integration of Go Modules and dep are automatically enabled when a project of the appropriate type is detected. In previous versions, GoLand turned off GOPATH indexing and displayed a notification that Go Modules or dep integration could be enabled. We noticed that this was not enough, since the notification can be accidentally skipped or ignored and, as a result, you will receive a project that is only half configured.




If this behavior does not suit you, you can manually disable the integration in the Settings / Preferences | Go | Go Modules (vgo) .


Code Inspections


Redundant Type Conversions


Redundant type conversions code inspection warns of redundant type conversions that can be omitted.




Validation of slice indices in literals


We have added slice index validation in compound literals. Now the IDE will warn you that the index must be a non-negative integer constant before you compile the project.




Code editing


Escape Support


Support for escape sequences in string literals includes:





In addition, special characters in the format string (% s,% d, etc.) are now highlighted in a different color to make them easier to see in a long line. Color can be set in Settings / Preferences | Editor | Color Scheme | Language Defaults | String | Escape Sequence | Valid Separately for Go - in Settings / Preferences | Editor | Color Scheme | Go | String | Valid escape .


Fill Fields Action


GoLand makes it easier to populate structure fields. Firstly, in a special window you can choose which fields to fill out. Secondly, the generated values ​​can now be edited. Finally, this action is now available through auto-completion.




Enhanced Extend Selection Feature


The Extend Selection action now correctly expands the code selection area according to semantics - from a line to a block of code separated by empty lines (instead of selecting the entire method body).




Interface enhancements


Updated dialogue New | File


We updated the dialogue New | File : now this is a pop-up window with a list of all the possible parameters for creating a file of a certain type. Previously, you had to open the list to select an alternative option, but now all available options are visible immediately.




Improved plugins page


Now GoLand immediately shows all the information about the plugins - you no longer need to open pages with a description of each plugin individually. New commands in the drop-down menu allow you to enable or disable all downloaded plugins at once. The Update button is now located next to the plugin name in the Installed tab. We removed the Updates tab: it is no longer needed.




Updated Find Window


In the Find window, we grouped some rarely used icons, while others completely deleted them.




General changes


New areas for Scope


New access areas have appeared in the Scope drop-down list: Recently Changed Files , Recently Viewed Files , Files in Previous Search Result and Selection . You can also select data source areas: Data Sources . In addition, you can now specify the scope for refactoring Rename . Press Shift + F6 twice to open the Rename refactoring window and select where the renaming will be performed.




New option for moving the cursor


In GoLand 2019.2, the Move Caret to Next Word action mechanism has changed: now the IDE by default moves the cursor to the end of the current word. However, you can customize the behavior as you see fit. Go to Settings / Preferences / Settings | Editor | General and choose where to move the cursor: to the end of the current word, to the beginning of the next word or between words.




More information in the Project panel


Turn on the In-place Descriptions option in the View menu to display information on the file size, as well as the date and time it was changed in the Project panel.




VCS Support Enhancements


Commit from Local Changes tab


GoLand 2019.2 provides the ability to commit directly from the Local Changes tab.




Now, while working on the commit, you can view the source code, the change history of a single file and diff for the file in the same area as the commit, and also use other IDE functions.


To enable this function and make commits from the Local Changes tab, without using a separate dialog box, go to the Settings / Preferences | Version Control | Commit Dialog and select Commit from the Local Changes without showing a dialog .


Improved support for .gitignore files


GoLand correctly highlights all ignored files and offers autocompletion options for file and folder names. Also now you can quickly add a file to .gitignore from the context menu on the Local Changes tab: right-click the file in the Unversioned files group and select the Add to .gitignore action .




Ability to cancel merge operation


We have added the Abort Merge option, which will be available in the Branches pop-up window during the execution of the merge operation. This is what many of us dreamed about: you no longer need to switch to the terminal to cancel something.




Selecting the displayed columns in the Log tab


To select the displayed columns in the Log tab, click the Presentation Settings icon, select the Show Columns command from the context menu, and then the columns that you want to see: Author, Date or Hash.




Instruments


Shell Script Support


GoLand 2019.2 provides autocompletion, quick access to documentation and renaming identifiers in the text for shell script.




In addition, we have added integration with Shellcheck and shfmt .


Kustomize support for Kubernetes


Through the Kubernetes plugin, GoLand 2019.2 supports Rename auto-completion, code inspections, and refactoring. You can also follow the path declared in the Kustomize resource file to the packages or files associated with it in the Projects window.




View Docker Container File System


Now you can view the file system of the running Docker container. The file system is displayed on the File tab in the Services window.




We often take ideas for improvements from your feedback and suggestions. Write to us here in the comments, in our bug tracker or Twitter .

By tradition, I remind you that if you are already using IntelliJ IDEA Ultimate, then all the features of GoLand are available right there, you just need to install this plugin.

Thanks for attention!

Source: https://habr.com/ru/post/461373/


All Articles