Delphi 6 is pretty old, I know. Unfortunately there are reasons why I can't upgrade which I don't want to get into here.
My problem is that it's hard to read code. I have the Castalia plugin which helps a bit (parenthesis matching, shows blocks of if, else, end) but it doesn't highlight the syntax like other IDEs do (variables, constants, procedures, etc.) in different colors. It also doesn't show the IFDEF blocks which can be very confusing at times.
For Delphi 6 what plugins can do some or all of these features?
CnPack will work on Delphi6, and it highlights {$whatever} symbols.
http://www.cnpack.org/index.php?lang=en
Related
A project I have been working on for several years apparently has gotten so large that the tooltip evaluation of symbols and expressions when in design mode is very sluggish. Despite having a quad core with 4GB of RAM (only 3 GB is relevant since it's Windows XP), when I hover the mouse over code items the tooltip look-ups can frequently take 3 to 7 seconds. Every now and then I hit some part of the code that causes a big hit on the hard drive and those can take up to 15 seconds to complete. I can only assume that the data structures that Delphi uses for symbol tables and other code items involved in tooltip driven look-ups has gotten unwieldy.
I don't want to turn off tooltip evaluation because it is invaluable to my work. Is there a technique or IDE plug-in that could help speed up the tooltip evaluation in the Delphi 6 IDE?
The first thing to try is Andreas Hausladen's DelphiSpeedUp. Frankly, if that doesn't do anything for you there's not much else left to try.
Oh, and for what it's worth, your Delphi IDE will only be able to see 2GB of address space since it is a 32 bit process which does not mark itself as LARGEADDRESSAWARE.
A code clean up of unused units could help. It can be done with the free / open source tools cnWizards (Uses Cleaner wizard) and Icarus. (Icarus also shows which units can be moved from interface to implementation).
It also helps to reduce project build and link time (in one project, it dropped from 30+ seconds to 5).
This happens to me too. A guy I work with has implemented his own custom code-completion system, which I am not at liberty to share, but which is pretty cool. The closest commercial thing that I have seen to what you're asking for is Castalia, although it focuses on speeding up code-completion, rather than code-insight and tooltips, I believe it does both.
Note that my experience is on much newer versions of Delphi. In my opinion, Delphi 6 and Delphi 7 code completion can't be much improved upon except by abandoning Delphi 6 and Delphi 7.
You might find that adding all your units to your project .dpr file and reducing and eliminating as many folders from your search path, and your library path as possible helps. Also, you might want to make your component folders all use a common DCU output folder, and keep only that one DCU-based folder in your library path. That always speeds up Delphi 6/Delphi 7 for me.
I'm pretty new to Delphi and I'm trying to use the DEHL Collections library. (see http://code.google.com/p/delphi-coll/ ) I'm have a little trouble with it from the IDE perspective. It compiles and runs correctly, but Delphi XE shows errors anywhere I use the HashSet library. The biggest grievance is that is prevents me from using code completion.
The first location I get the error is in an object declaration:
uses
SysUtils, Windows, Collections.Base, Collections.Sets, Collections.Lists,
adscnnct, adstable,
uOtherClass;
type
OneClass = class(OtherClass)
private
_bad: THashSet<string>; // THashSet underlined
_good: TList<string>; // No problems
end;
The error states: "Type arguments do not match constraints"
I don't think it's configuration as I can use TList just fine, but here is how I set it up: I've copied the library to Projects/Libs/DeHLCollections/Library and compiled the library to Projects/Libs/bin. I've included the bin directory in my global library path, which got it to compile and run. I have tried adding everything (/libs, /DeHLCollections, /Library) to it as well in hopes of getting the IDE to help me out, but it doesn't seem to be helping.
Anyway to fix this, or do I just have to deal with it?
Using DeHL Collections version 1.1.1.119
Welcome to the troubles with using Generics laden code. DeHL and generics work a lot better in Delphi XE than in any previous Delphi version, but that's not the same as it "not having any problems". The problems I experience are exactly like yours.
My opinion is that DeHL shows every sign of having been written by a master delphi programmer, and that it's a thing of beauty, in some ways. It's also a source of great pain, through no fault of its own.
Delphi contains not one or two, but at least three (maybe four?) separate parsers, including the full compiler parser, and a few IDE-parsers used for things like Error Insight (the errors you see even before you build) and the code completion data parser. Each has different language support limitations with regards to generics. It is possible perhaps that DeHL could be written to avoid parser problems with all the various Delphi parsers. I have not seen a guide ever written that shows the limitations, but I wouldn't be surprised if complex type declarations in the form TSomething<TSomething<ISomethingElse>,TBar<IFoo>> breaks more than a few of those parsers.
If you intend to use Generics very heavily, you may as well turn off Code Completion and Error Insight. You might also want to save often, and be prepared to experience a lot of compiler problems. And don't try to compile generics-heavy code and put it in packages either. I have experienced a lot of URW and AV (internal compiler faults) when I write generics based code. I find that the Delphi compiler team is great at fixing whatever gets reported, but that the Generics are really most stable for me when I restrict myself to using the Generics.Collections that come with Delphi, and not using other generics based code. It seems it is possible to write stuff using the generics features, that the IDE and two-way tools, and code-completion is not yet fully ready to handle. That means, phenomenal cosmic Generic powers come at a cost to the classic RAD IDE productivity features.
That being said, the latest DeHL sources from Subversion work fine for me and build and run with no errors, but the most recent source ZIP of the entire DeHL collection had problems for me.
I expect that over the next few releases of Delphi, whatever issues have been found (and DeHL seems to be a great place to push the boundaries, and that's one of the reasons i'm a big fan of it) will be fixed, and you won't be wondering why heavy-generics break your IDE features, because they'll all be working again.
I'm pretty frustrated. I'm using Delphi 2009 and was very happy about the inclusion of generics in this version of Delphi. Everything worked great at the beginning, but now that I use generics all over the place I run into problem after problem - most of the time some internal errors, where I don't even see where exactly they are caused. I tried restructuring the code multiple times to avoid the problems with generics but always run into new problems further down the line.
Now I decided to remove generics alltogether and use some dynamic casts to specialize my classes. Not very thrilled about it but i just don't see another option. I can't spend my day tracking down Delphi's internal compiler errors...
Is anybody using generics in a large project without running into such problems? Is it my fault perhaps? Or is it just not possible to use them in complex projects?
I hope D2010 fixes all this stuff.
I'm using generics extensively in Delphi 2009, and I can say it's not easy as you are often required to work around an ICE. Even worse, generics even mess up with the linker, i.e. you can't really use them in packages (except for C++Builder packages).
All this trouble seems to be gone in Delphi 2010; I hardly ever saw an ICE due to generics. I need my code to work with both 2009 and 2010 though :(
Generics support in D2009 was really bad at first. Update 3 fixes a lot of things, but not everything, and leaves at least one serious bug in Generics.Collections.pas. In some ways, it actually got worse, since now instead of giving you a syntax error when the compiler chokes on some generic construct, you'll often get an internal compiler error and you don't know what's causing it.
It's been improved quite a bit for 2010. There are still a few generics-related problems in rather obscure cases, but they're generally safe to use as long as you're not using packages or putting generics inside of class helpers or strange things like that.
Bottom line: if you want to use them, upgrade to 2010.
I used to work in Delphi 6, and got very used to having CodeRush's various helpful IDE additions. Many are now in the IDE itself, or I've managed to replace with something else, but the one feature I REGULARLY find myself wishing I had in Delphi 2007 still, is the ability CodeRush had that added little "connecting lines" between components that were linked to each other (lines showing the connections between TDataSets and TDataSources, for instance).
Does anyone make something that does that in the newer Delphi IDE?
=== * LATER NOTE / Clarification * ===
Andreas is correct in his comments below... "I don't think that he meant structural highlighting which works on the source code. He wants "connection lines" between components in the form designer."
He also says "as far as I know there is no such tool for Delphi 2005 or newer".. which is a bummer if true. (...and if that IS the case, what's the best place to make Delphi IDE feature requests?)
I don't think it exists. The best place to make form designer feature requests is here.
another freeware/opensource option would be to look at CNPack which supports structural highlighting and runs well in Delphi 2009. The library contains many other enhancements to the IDE also, some which are duplicated in other packages such as GExperts. I run both CNPack and GExperts in both 2009 and 2006 without any problems.
You want Castalia, which works fine here on my D2007 for structural highlighting.
Castalia from Twodesk
I need a complete Object Pascal syntax (preferably Delphi 2009). Some of the syntax is given by the help files, but not all information is provided. So I started collecting loose bits of information. Recently I added these to a more or less complete syntax description (EBNF like).
Although it looks extensive, there are still bugs and I'm sure parts are missing (specially in the .NET syntax). So I'm asking the SO Delphi community. Do you have any information or can you correct the errors? In return I provide the complete syntax to the community. It probably saves you some time ;-).
In the future, I like to do the same for other languages (Like C#/C++/Java).
The syntax description I already have is given: My Syntax sofar. Or if you like a Text version. (The XHTML is generated from the text version).
Please note that the syntax focusses on the syntactical part, because the lexical part is not really a problem.
Update
I have a new version of the Delphi Syntax. html version. It includes al versions including 2009. Prism extentions are still on the todo list. And I'm not sure if I'm going to keep them together.
For the real purists, it also contains the full assembler code (which does not support the full 100% of the intel set but only a few instructions are missed.).
Try this: DGrok - Delphi grammar
There is no complete, published syntax for Delphi. Bear in mind that .net and win32 delphi have different syntaxes.
This project has hand-build Delphi parser in it. And lots of test cases of code that compiles but pushes the limits of the syntax.
Delphi 7's grammar is in the back of the Object Pascal book.
You mean for a few thousand dollars they don't even send you that? Do they even send you a 6' x 6' poster?
This might be a good help. It is the parser used in TwoDesk's Castalia.
What exactly are the bugs and functionality you're missing?
From scanning over your document, it seems you mingle syntax and semantics. I do not understand why to distinguish between SimpleTypeFloat and SimpleTypeOrdinal on a syntactic level, or code operator precedence as syntactic feature in AddOp and MulOp. true, false, nil are identifiers just as any variable name you choose.
You could always read the source to the Free Pascal Compiler. It supports Object Pascal.