New in Delphi 10.4: Redesigned Code Insight
[SHOWTOGROUPS=4,20]
Как увидеть ссылки? | How to see hidden links?
6 May 2020
What do we mean by Code Insight?
First, some background. If you’re familiar with Code Insight, skip ahead...
Code Insight is our name for a set of IDE productivity features in the editor. For the purposes of this blog post, those features are:
Classic Code Insight
As the language has grown and time has passed, these features have no longer always worked as well as we have wanted. The technology was cutting-edge when it was introduced, but there were definite improvements we could make today.
It’s been common to see bug reports about spurious errors (ie errors reported in the editor or in the Structure view when the source code is actually perfectly correct code.) Or that the IDE worked in the main thread, so would not respond to keystrokes while it was working to show the code completion list. (You could only press Escape to cancel.) Sometimes, for gigantic projects, calculating the data for code completion could use a lot of memory in the IDE. In addition, the features were implemented with multiple code parsers: code completion and error insight each had a different understanding of the code. And finally, code insight was disabled while debugging, so if you wrote code while debugging you had no productivity assistance.
We did not want this to continue. Our goals for 10.4 have been to:
Excited? We are. This is one of the biggest and best changes to the Delphi IDE in fifteen years.
(And don’t worry - if you need, classic code insight is still there, complete with a few new bug fixes, and can be turned on in 10.4 if you want.)
[/SHOWTOGROUPS]
Как увидеть ссылки? | How to see hidden links?
6 May 2020
What do we mean by Code Insight?
First, some background. If you’re familiar with Code Insight, skip ahead...
Code Insight is our name for a set of IDE productivity features in the editor. For the purposes of this blog post, those features are:
- Как увидеть ссылки? | How to see hidden links?: the dropdown list box that predicts what you want to type. Appears when you type a period (.) after an identifier, or when you Как увидеть ссылки? | How to see hidden links?.
- Как увидеть ссылки? | How to see hidden links?: the hint that appears showing the parameters for a method, including multiple variations for an overloaded method. Ctrl+Shift+Space inside method braces ().
- Find Declaration: right-click on an identifier and click Find Declaration, and it will take you to where that method, variable, type etc is defined. You can also hold Control down and move your mouse over the editor, and applicable identifiers will turn into hyperlinks you can click on to find their declaration, which is known as Как увидеть ссылки? | How to see hidden links?.
- Как увидеть ссылки? | How to see hidden links?: hover your mouse over a variable or type, and you will be shown information about it. Sometimes this includes XMLDoc, and is known as Как увидеть ссылки? | How to see hidden links?. (We need to clarify names in our doc.)
- Как увидеть ссылки? | How to see hidden links?: displays errors in your code before you compile. These are otherwise known as ‘red squigglies’, many people's preferred terminology - the red zigzag lines under your code. Errors are also shown in the Errors node in the Как увидеть ссылки? | How to see hidden links?.
Classic Code Insight
As the language has grown and time has passed, these features have no longer always worked as well as we have wanted. The technology was cutting-edge when it was introduced, but there were definite improvements we could make today.
It’s been common to see bug reports about spurious errors (ie errors reported in the editor or in the Structure view when the source code is actually perfectly correct code.) Or that the IDE worked in the main thread, so would not respond to keystrokes while it was working to show the code completion list. (You could only press Escape to cancel.) Sometimes, for gigantic projects, calculating the data for code completion could use a lot of memory in the IDE. In addition, the features were implemented with multiple code parsers: code completion and error insight each had a different understanding of the code. And finally, code insight was disabled while debugging, so if you wrote code while debugging you had no productivity assistance.
We did not want this to continue. Our goals for 10.4 have been to:
- Make Code Insight asynchronous - that is, run on another thread or in another process (or both) so that the IDE is always responsive when you type even if it’s doing work in the background
- Reduce or even completely remove (you can see where this is going) the potential memory usage for code completion from the IDE
- Ensure Error Insight always gives correct results - that is, it should give exactly the errors the compiler would, and correct code should show no errors
- Help us move closer to having a single parser for Delphi source in the IDE, so that there is a ‘single source of truth’ or single understanding of what Delphi code means within the IDE
- Modernize Delphi’s code tooling approach to use modern techniques
- And solve a number of bugs in code completion at the same time
- And add at least one code completion feature at the same time
- ...Wait! Add two new features at the same time!
Excited? We are. This is one of the biggest and best changes to the Delphi IDE in fifteen years.
(And don’t worry - if you need, classic code insight is still there, complete with a few new bug fixes, and can be turned on in 10.4 if you want.)
[/SHOWTOGROUPS]