Delphi 10.4: Code completion with new language features (e.g. inline var)

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,203
Credits
4,034
Delphi 10.4: Code completion with new language features (e.g. inline var)
Holger Flick, May 24, 2020

[SHOWTOGROUPS=4,20]
Delphi 10.4: Code completion with new language features (e.g. inline var)
Holger Flick, May 24, 2020

I have been given permission by Embarcadero to blog about the upcoming version of Delphi 10.4.


Here’s another post about code completion that a reader of my blog named Dennis brought to my attention. The technology used to generate the results for code completion is completely new. It is not an update for the old technology. There has been a huge improvement to a new technology called LSP which stands for Language Server Protocol. Delphi caught up with other modern IDEs using this feature to provide code-typing-enhancements.


Here’s an example for using inline vars that the old implementation could not understand:

ccvar1.png

We declare two variables without even specifying their type. i is obviously an Integer and name will be typed as String. Code completion does not get confused. All completions apply to the datatype Integer.


Looking at the variable name:

ccvar2.png

Same result. It just works. All completions are offered for the correct type. Typing split reveals all overloads for the Split method:

ccvar3.png

The new code completion will truly be an improvement to the current state of things!
[/SHOWTOGROUPS]