Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
DelphiIDENews

New for Delphi Code Insight in 10.4.1

Show a code completion item where the typed text is in the middle of the symbol name ie might not be obvious at first glance why its included in the list

Delphi 10.4.1 is a quality-focused release, and this goes for code completion too! As well as helping you mimic classic code completion behaviour, we’ve fixed and tweaked many items.

When RAD Studio 10.4 was released, we redesigned Code Insight. While old (‘classic’) code insight is still available as a setting, by default Delphi now uses an asynchronous, non-blocking technology for code completion and related features. It means the IDE should not pause while typing, and you can use code completion while debugging, as well as many other benefits (searching completion results, for example.) You can read more about the tech here.

In 10.4.1 we’ve focused on polishing code insight. Because 10.4.1 is a quality release, there are very few new features – there are some new settings! – but the majority of the work is resolving bugs and tweaking behaviour. Here are some things you may want to know about: new settings, key fixes, and some special notes for very large projects.

New Code Completion Settings

Underlining Matches

10.4’s new code completion shows more results than old classic completion, by also listing items not just that start with what you typed (the ‘filter’ text), but that contain what you typed. (In 10.4.1, there is a setting to control including these extra items: see below.)

This is useful because it lets you explore and search the completion list by typing. Sometimes, it can be hard to see why a particular result is included in the list, and so in 10.4.1 the matching part of a symbol is now underlined.

Show a code completion item where the typed text is in the middle of the symbol name ie might not be obvious at first glance why it's included in the list
Invoking code completion in 1041 with the default settings shows the matching filter text underlined

In this screenshot, you can see that ‘ScaleFactor’ was included because it contains ‘act’.

You can turn underlining off in the Options dialog – see the very next section for info on new settings.

Getting Classic Code Completion Behaviour

By default, the new code completion does not completely copy the old classic code completion behaviour. It shows more results, and uses a different algorithm to auto-select the best item in the list.

In 10.4.1, we added four settings, which combined allow you to get exactly the same behaviour as classic completion. All four are on the new Insight Options tab of the UI > Editor > Source page in the Options dialog.

IDE Options dialog showing four new settings on the new'Insight Options' page
Four new code completion settings

‘Filter text is underlined’ controls the new feature to underline the match, noted above.

To mimic classic code completion you can change the settings like so:

  • ‘List all symbols that start with the filter first’: on
  • ‘Select shortest matching symbol’: off (instead it selects the closest in scope)
  • ‘Filter text is underlined’: off
  • ‘Show symbols that contain filter’: off (though we do recommend keeping this on; it adds more and useful results)

Key Quality Fixes

The 10.4.1 What’s New page lists many fixes, and I recommend you read the list. However, some that are particularly worth pointing out include:

  • Both memory usage and performance are improved. The language server should use less memory, and it should be faster
  • Some improvements targeted specifically at very large projects (and thankyou to our beta testers here)
  • Packages are very much improved – there are several points in the documentation
  • Error Insight (‘red squigglies’) sometimes had a delay updating when an error was resolved, and sometimes the length of the red squiggly line was wrong; both are fixed
  • Issues where Tooltip / Help Insight did not always show full information are fixed
  • Many other fixes – I truly do recommend you read the What’s New, it’s over a page-long list of changes to Code Insight alone.

Very Large Projects

Noted above are some changes for very large projects. Here is a quote from one of our customers about 10.4.1, which they have kindly allowed me to share:

Congratulations to the LSP team!

I have now managed to open&run our flagship app on 10.4.1. And – magic! – code completion finally works in our IFDEF-ridden main unit. I think last time code completion worked there was somewhere around D5 times …

It takes about 15 sec to work for the first time (it probably feeds enormous amount of units to the LSP) but after that it is a pure bliss to use!

Thank you!

This particular app is just under 3 million lines of code. And it’s the first time Code Insight has worked in that location since Delphi 5.

Every release, we continue to improve Delphi and C++Builder. 10.4.1 is notable because it’s a quality-focused release. We will continue to improve and change the IDE every time we ship a new version, and we hope that the code insight fixes alone, let alone the 800+ other fixed bugs, make 10.4.1 a very worthwhile version for you to install.

See What's New in 12.2 Athens See What's New in 12.2 Athens Dev Days of Summer 2-24

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

David is an Australian developer, currently living in far-north Europe. He is the senior product manager for C++ at Idera, looking after C++Builder and Visual Assist.

41 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Worth reading...
Promote the FREE Desktop First UX Summit

IN THE ARTICLES