What's new in GoLand 2018.3
Hi, Habr! Last week a new version of GoLand 2018.3 was released.
In this update you will find many improvements for debugging and testing. These are debugging applications on the Google App Engine platform, Testify framework, memory dump analysis and Mozilla rr.
There is a new Change Signature refactoring, code inspection and autocompletion for functions.
In addition, we added support for charts, improved Rename and Inline refactorings, work with Go templates ( text / html ) and version control systems for Git, Docker and Kubernetes plugins, and much more.
Change Signature refactoring
Refactoring Change Signature changes the signature of functions and methods. It helps to set a new name or move, rename, add or delete parameters.
If you change the method signature, GoLand will offer to update the implementation.
Before you apply refactoring, see what happens in the preview pane.
A list of all files and objects to which refactoring is applied is displayed in the panel. If you need details, from the panel you can go to any changeable symbol in the project. If the result does not meet expectations, you can undo the changes.
Rename and Inline refactorings
Rename now warns of potential conflicts as a result of renaming. We added a dialog that reports a problem and offers to make a choice: ignore the conflict, consider or cancel the refactoring.
The result of applying inline refactoring is now immediately visible: GoLand highlights the modified code.
Debugging applications on the Google App Engine
In the new version, the debugger allows you to run and debug applications locally on the Google App Engine.
And we added a new project template - App Engine . It contains
app.yamlbasic configuration settings and a
main.gofile with a request handler.
Support for memory dump analysis
Sometimes standard debugging tools do not give a complete picture of what is happening with a program at certain points in its execution. In this case, memory dumps will help.
To start analyzing a memory dump in GoLand, select Open Core Dump in the Run menu.
To automatically create crash dumps, enter Run
GOTRACEBACK=crash in the Environment configuration field .
You can create memory dumps only on Linux, but you can analyze both on macOS and Windows.
GoLand 2018.3 supports Testify framework . Run test suites and methods directly from the editor, just like normal test functions.
In the Comparison Failure window, compare the actual and expected value if the test fell.
There are two new code inspections : Unhandled Error and Unreachable code.
Unhandled Error warns you about functions and methods that return an error, but there are no checks to handle this error.
Unreachable code identifies parts of the code that will never be executed.
In addition, the Function Call Inspection , which checks whether an expression needs to be converted into a function or a method call , can now automatically correct errors using the Finish Call Expression .
In GoLand 2018.3, a new kind of autocompletion has appeared for functions. Imagine that you are new to the golang world and you need to split a string. You know that for this to be a function, and most likely, it is called "
split". This function should take a string as the first argument, but you do not know the exact name of the function and its package. New type of autocompletion makes it easy to find such functions.
Call Basic completion twice (Ctrl + Space + Space) to view all available completion options.
The Add format string argument generates a format specifier for the specified expression, inserts a specifier into the format string, and passes the expression as a specifier argument.
Generate Constructor creates a special function for initializing structures.
Generate getter / setter now allows you to edit the parameters of the generated function.
Generate Constructor , Generate getter / setter , and Generate getter and setter are now available through the Generate menu.
The Evaluate Expression dialog and the Watchers panel now have auto-completion, inspections, and automatic error correction.
Go Templates ( html / template )
In the Go templates ( html / template ), code autocompletion and Rename refactoring work, it is possible to switch from any character to its places of use, and the formatting has improved.
We have added Mozilla rr support to the Linux debugger. Record and play back the progress of the program, using only two buttons. To start debugging, you need to install Mozilla rr .
Otherwise, everything works the same as in the standard debugger, except for the special Rewind button for Mozilla rr. It starts the program back to the previous breakpoint.
We have added support for charts for visualization:
- dependencies inside Go modules projects;
- relationships between tables in databases and SQL.
Search and navigation
The Find in Path and Replace in Path dialogs now work with multi-line code snippets.
The search window, Search Everywhere , is faster and combines Go to type , Go to file , Go to symbol , and Find actions . Use TAB to switch between tabs.
Improvements in the code editor
New icons in the editor will not only tell you which methods have been redefined, but also help in one click to move from one such method to another.
The Complete Current Statement automatically inserts a comma in the composite literals (structures, dictionaries, etc.) and places the cursor on the position of the next statement.
In GoLand 2018.3, you can define a set of files to which the Reformat code , Optimize imports , and Rearrange actions will not apply .
Version Control System
Integration with Git now displays change check requests for the repository in a new window - GitHub Pull Requests , and also supports Git submodules.
We added a new high-contrast theme, and improved support for screen readers.
The Docker plugin supports CLI arguments in the Run configuration. In the new Build field of the Dockerfiles launch configuration, you can use the following arguments:
cache-from, cpu-shares, cpuset-cpus, force-rm, label,
memory, memory-swap, shm-size, no-cache, pull, quiet,
Code completion, Rename refactoring, code inspections and quick fixes work in the Helm templates.
- Attach action is now available in the Open Project menu , which allows you to add a directory directly during the opening of a new project.
- Now you can open the project by dragging it to the welcome window.
- Activity Monitor shows how much processor resources various subsystems and plugins consume: Help | Activity Monitor.
- Finding and updating plugins in the IDE has become more convenient. The plugin page supports searching by tags and sorting results by download, name, rating, recommended or updated.
- Indexing projects is much faster.
Just in case, I remind you that if you already use IntelliJ IDEA Ultimate, then all the features of GoLand are available right there: just install this plugin .
Thanks for attention!