3

Sometimes some class methods or fields marked erroneous(that red underline) by IDE, but the project successfully compiled and executed(no error or warning).

If I hold mouse pointer on this erroneous sections I got this tool tip : "'TSomeClass' does not contain a member named 'SomeMethod'" or "Undeclared identifier 'SampleIdentifier'".

Is that a kind of IDE bug or am I wrong somewhere?

SAMPro
  • 1,068
  • 1
  • 15
  • 39
  • 2
    Error Insight has been like this since it was introduced. Better in some Delphi versions and worse in some. You can turn it off. See also [`Delphi XE shows at least 200 errors but the program compiles just fine`](http://stackoverflow.com/q/6077190/576719). – LU RD Aug 27 '13 at 05:58
  • Actually it can start to produce more accurate readings after real compilation pass has been made. – OnTheFly Aug 27 '13 at 13:16
  • What is _real compilation_? What's its difference with normal compilation? I get these errors until I restart IDE – SAMPro Aug 28 '13 at 06:56
  • Thanks, @LURD, I incorporated your link in my answer. – Uli Gerhardt Aug 28 '13 at 11:41

2 Answers2

7

That feature is called Error Insight and is known not to work reliably. AFAIK you can't fix that. If it bothers you enough you'll have to disable it.

Community
  • 1
  • 1
Uli Gerhardt
  • 13,748
  • 1
  • 45
  • 83
  • 6
    +1 This "Horror Insight" broken feature is just to be disabled. It saves both CPU and brain cells. – Arnaud Bouchez Aug 27 '13 at 06:09
  • FWIW: I left it enabled for some months now (with D2007) and find it more helpful than annoying, despite some false positives. But I know I'm in the minority here. :-) – Uli Gerhardt Aug 27 '13 at 06:24
  • @Arnaud Bouchez I'm agree with you. It's just a disturb tool. You get those errors when you just typing them. And just restarting the IDE will fix it. I think IDE just forgot to run UpdateErrorInsightDB like function sometimes. – SAMPro Aug 27 '13 at 07:06
  • @UliGerhardt In latest versions, it reports broken code everywhere, even within the RTL untils... – Arnaud Bouchez Aug 27 '13 at 07:20
1

This is an old question, but I found it when searching for a similar issue. I have a large project group with over a dozen packages, and Error Insight was broken for only one of them. The issue appeared after upgrading to Delphi 10 Seattle.

In Project Options | Delphi Compiler, make sure "Use MSBuild externally to compile" is false. This fixed the Error Insight behavior in my project.

Alexei - check Codidact
  • 22,016
  • 16
  • 145
  • 164