How to remove errors (red underlines) in D2007 - delphi

I have a lot of errors in structure panel. The application compiles and run fine with Delphi 2007. But the code have much code that have red underlines. If I press Ctrl + leftclick on it it finds the original declaration. But it is still annoying to have all those errors.

These are well-known IDE bugs. Have you tried the IDE Fix Pack?

I have IDE Fix Pack installed, and still get incorrect error insight red lines regularly.
Some things which help (temporarily)
Close the project and delete *.local and *.identcache, then re-open the project.
When Loading a project, wait for the code-folding lines in the gutter to appear (before Delphi 2009, this indicates that the background compiler is finished)

I am assuming you just want all the red underlines to go away:
Tools | Options | Editor Options | Code Insight
Then uncheck Error insight
That is for Delphi 2010, but I think it is very similar in Delphi 2007, but I don't currently have it installed.

Related

Delphi IDE some panels are missing

I'm using Delphi 11 and many time when I click the "Run without debugging" button, my program starts to execute. When I close my program, some Delphi IDE panels are missing. It looks like this:
This is my Delphi IDE version.
Is this a bug or a configuration? I can't find an option that controls this behavior. I can't make the missing panels show up again, and I have to restart the IDE.
This is a known bug in Delphi 11. Fix for this issue will be released with 11.1 update.
Quality Portal Report RSP-35481

Ctr Space in delphi

In a Delphi Project CTRL + Space not working.
Before "uses" when I Press CTRL + Space the code completion is appeared but after "uses" does not appear.
I use Delphi 2009.
I install Fastreport and raize components and vcl Skin.
The most probable cause for your problem is that you have some smal syntactical error like missing semicolom, invalid name, etc. somewhere between the point where CTRL+Space works and where no longer works. This is due the way how Code Insight is checking the code structure.
So I recomend you go to menu Project and then chose Syntax Check.
Another cause for CTRL+Space not working is that your are still debuging your program. Do nte that while debugging sesion is in progress both Code Insight and Error Insight are disabled.
Something that in general wreaks havoc with Code Insight (Ctrl+Space) is conditional compilation.
So watch out for {$IFDEF ...} in your code.
I prefer to avoid conditional compilation in anything except library code that needs to support multiple Delphi versions. However, if you must use it, consider inverting the logic so you can use {$IFNDEF ...}.
Also, the feature doesn't always work if your code cannot compile. This depends on what dependencies are unable to compile at the point where you press Ctrl+Space.
However, in my experience the feature does sometimes just "break". If you're lucky closing and re-opening the project fixes it. But usually I have to close and re-open Delphi and do a full rebuild of the project.
I had the same problem I press Ctrl+Space to all units in uses section and I see one unit Delphi can't recognize. I delete it and type it again with Ctrl+Space; after that everything is ok.
another reason is if exists a special character like a tab character in your unit.
The "So watch out for {$IFDEF ...} in your code." had this. Temporarily did a Ctrl-X on it and then did Ctrl+Spacebar and pasted the code back in. Then... it worked again. Delphi XE10.1 Update 2. Other reasons why it sometimes doesn't work still remain a mystery. Can be very frustrating indeed.

IDE Insight quit working

At some point, my IDE Insight function stopped working. I have checked both the XE5 and XE6 versions that I have on my system and neither work, so it must be environmental.
When I click on the menu item, nothing pops up. There is no error given, just no IDE Insert screen. The same results happen when using the shortcut.
I am running Windows 7, Delphi Professional XE5 and XE6.
Anyone know how to fix this?
The IDE Insight window was removed in XE5. Instead, there's an edit box top right of the screen (Ctrl+. gives it the focus) that you type into and get a dropdown list of commands to pick from in response.
This is documented in What's New in Delphi and C++Builder XE5.

Is there a workaround for the error-insight bug in the IDE?

XE2 will mark an error in the editor, usually about missing member functions (as shown in the picture). However it wil compile OK and the code will run just fine.
If you ask for a list using CTRL + SPACE it will give the correct list.
Is there a workaround/solution for the above bug in the Delphi XE2 IDE?
In such a way that I don't get incorrect markings for errors in the editor?
Note that this question: Delphi XE2 background IDE compiler unable to find source path signifies why the error is there, but does not list a solution.
Solution, thats works for me in Delphi 2007, XE2 and 10.2.x Tokyo:
Compile/Build your project
Close your project (Files -> Close all)
Reopen your project
The wrong error marks should have gone away now, at least for a while... :-/

Why Delphi says 'cannot resolve unit name xxx'?

I'm working with Delphi2010 Enterprise Update 4.
When I'm opening my project in the IDE and displaying the mainform code, there are 2 unit names underline in red.
xxx http://img268.imageshack.us/img268/6475/unitnameunresolved.png.
I have verified that the path to the unit source is in the Library path and in the Browsing path.
Surprisingly, when I'm doing a right-clicking on the unit and selecting Open file at cursor, it works (ie. delphi opens the right unit).
Any idea about that ?
Error Insight which keeps all the error messages into the structure view is quite buggy.
It doesn't understand your code the way the compiler understands it.
There is an IDE Fix Pack developed by Andreas Hausladen which reduces the number of those "Cannot resolve unit xyz" problems.
It doesn't fix the bug, but it makes them less visible by addressing some of the Error Insight's threading problems.
Out of curiosity, is there any code in AdPort and/or AdStatLt that is subject to conditional compilation ?
The parser that underpins Error Insight is I think different (physically and contextually) from the compiler. The compiler may be able to make sense of those conditional compilation areas that Error Insight is not.
This is just speculation on my part, but Error Insight is much improved in Delphi 2010 and typically now only chokes when there are errors in my code that I have yet to resolve.
Just disable Error Insight (Tools -> Options -> Editor Options -> Code Insight, uncheck Error Insight). It works fine for me.
Source: http://codeverge.com/embarcadero.delphi.ide/cannot-resolve-unit-name-forms/1041789
This is a cosmetic issue only, and doesn't affect your application in
any way.
It's caused by a bug in the compiler used for Error Insight (the
functionality that gives you the wavy red lines), which is not the
same compiler used to build your application or to compile from the
command line. The bug has existed since Error Insight was first
introduced. (It has gotten less frequent, though; it used to be that
the first thing I would do when I installed Delphi was to disable
Error Insight, and I haven't had to do that with either D2007 or D2009
as the problem is very infrequent and do esn't seem to last long for
whatever reason.)
Since there really isn't a problem (other than the cosmetic issue),
you can either ignore it or get rid of it by disabling Error Insight (Tools -> Options -> Editor Options -> Code Insight, uncheck Error Insight).
I reset the library path under tools\options\environment options\delphi options\library.
Click the dropdown box, and reselect your os, and it will reset the path to the library. Worked for me.
Closing and reopening a project usually helps to get rid of most of these errors. Try it...
(That doesn't change the fact that nowadays, this is probably my number one annoyance in the IDE...)

Resources