GNAT Studio 21 Release Notes ============================ We present here a few highlights of the new features in GNAT Studio 21. You can access the complete list `here `_. This GNAT Studio development cycle was focused on stability and performance enhancements, and to improving source navigation, transitioning more and more features to the new engine in the **Ada Language Server**. .. contents:: :local: Navigation ---------- GNAT Studio now implements a client for the **Microsoft Language Server Protocol** to provide source navigation for Ada, and now C/C++. This allows delegating the code intelligence engine to an external language server process - see https://github.com/AdaCore/ada_language_server, our implementation for Ada based on Libadalang. This engine no longer relies on the compiler, meaning that cross-references are available as you type, without requiring to compile the application. If you encounter some issues with the new cross-references engine, you can temporarily go back to the old one by disabling the *GPS.LSP.ADA_SUPPORT* trace in your :file:`$HOME/.gnatstudio/traces.cfg` file. When ctrl-clicking or executing any navigation request (e.g: *Goto declaration*) on a dispatching call, GNAT Studio now displays a popup menu that lists all the subprograms that can be called in the hierarchy, instead of jumping to the toplevel subprogram primitive. This menu also appears when navigating through an abstract subprogram declaration: it will list all the overridden and overriding implementations. The behavior can be customized through the :menuselection:`Editor --> Ada --> Display ancestry on navigation` preference. .. image:: images/hierarchy_navigation_menu.png :width: 400pt | The :menuselection:`Call Trees --> calls` menu has been re-introduced, as well as the :guilabel:`Dependency Browsers` which can be used to analyze unit dependencies. Both features have been rewritten in the Ada Language Server. .. image:: images/dependency_browsers.png :width: 400pt | The :guilabel:`Outline` view has been reworked: the list of symbols is now provided by the Ada Language Server, which allows to compute this list asynchronously. As a result, the :guilabel:`Outline` view no longer freezes the UI on large files. Filtering is also faster, and expanded nodes are now preserved after each refresh. New filters have been added for the *find references...* action, allowing to filter in/out type derivations and simple read references. C & C++ Support --------------- GNAT Studio has replaced its older libclang-based custom engine with it by a C and C++ language server developed as part of the LLVM project, called **clangd**. As a a result of this transition, dynamic completion is now supported for C and C++ and some new features have been introduced. One of the great features that clangd brings to GNAT Studio is the signature help, which pops up when opening a parenthesis for a function call: GNAT Studio will show the function's signature, showing the parameter expected at each point. .. image:: images/signature_help.png :width: 400pt Debugger & Emulator Integration ------------------------------- A new :guilabel:`Pending breakpoints` debugger preference has been added to allow pending breakpoints when using the debugger. When enabled, breakpoints that are not recognized when starting the debugger (i.e: breakpoints set on dynamic libraries) won't be rejected: the debugger will try to set them once the executable runs. This preference is enabled by default. A new button in the :guilabel:`Assembly` view local toolbar allows setting and deleting breakpoints at given instruction addresses. The :guilabel:`Start/Continue` button in the debugger toolbar now offers the option to stop at the beginning of the main, just like the :menuselection:`Debug -->Run...` menu. The integration between GNAT Studio and GNATemulator has been improved: the same GNATemulator console is now reused across debugging sessions, instead of spawning a new one each time a new debug session starts. A clean button has also been added to the console. Projects Support ---------------- An advanced preference has been added for the :guilabel:`Scenario` view to control the way scenario variables are expanded in command lines. By default, all the scenario variables are explicitly expanded. When the preference is deactivated, only variables with a value different from their default will be expanded. Version Control --------------- GNAT Studio now displays a warning message on any of the VCS views (e.g: *Commits* view) if it's not able to find a version control system repository for the loaded project. An hyperlink is also displayed to configure the VCS repository manually. .. image:: images/no_vcs_warning.png :width: 400pt | The *vcs commit* action has been improved: if there is no staged file, then all the modified files are automatically staged before committing. Search ------ GNAT Studio now highlights the searched area when opening the :guilabel:`Search` view while an editor has a multiline selection. This allows to better visualize the area being searched. .. image:: images/search_selected_area.png :width: 400pt | Pressing *Shift+Enter* while the :guilabel:`Search` view is active now searches backwards, like most editors and browsers. A new local :menuselection:`Reuse last pattern` preference in the search window controls whether the last search text will automatically be set in the *Find* field when the window is opened. Source Editor ------------- Code folding has been transitioned to the Ada Language Server, which allowed us to introduce a new set of preferences to perform automatic code folding: * *Fold_With_Use_Blocks*: automatically folds ''with'' and ''use'' blocks when a block has more lines than the setting (0 to disable). * *Fold_Comment_Blocks*: automatically folds comment blocks when a block has more lines than the setting (0 to disable). * *Fold_Comment_Reg[1,2,3]*: automatically folds comment blocks when a block's contents matches the regular expression.' A new *toggle comment* action to comment/uncomment the current line or selection has been added. You can associate a key shortcut to it via the :guilabel:`Preferences` dialog. Miscellaneous UI/UX improvements -------------------------------- For the :guilabel:`Locations` view, new *previous/next tag (same weight)* actions have been added to allow in the Locations view to move between messages of same importance. (i.e: if an error is selected the action will find the previous/next error).