Known constructs that crash the Delphi IDE

偶尔善良 提交于 2019-12-07 20:35:36

Googling for [ delphi turbo "class completion" crash ] located a bug report with what sounds like the same problem you are seeing. The bug report lists a workaround (»Change "TTest" to "TButton" and remove the "TButton = class(TTest)".«), at least for its given testcase, but I don't know if its applicable in your case.

I had some problems with a dynamic multidimensional array:

type
  Foo = array of array of Integer;

Code completion and refactoring didn't work, it gave an error about a ; expected somewhere in that declaration, but it compiled just fine.

I fixed it by modifiying the type declaration to this:

type
  Foo = array of TIntegerDynArray; //TIntegerDynArray is declared in Types unit

The Delphi IDE and (to a lesser extent) compiler are quite fragile. Many non-expected constructs will cause strange problems. So it's not easy to guess off-hand what's the trouble in your case. (The way you describe your unit, I suspect the IFDEF's may play a role though.)

Can't you comment-out parts on the code until the problem disappears, to see whay may causes it ? If your unit is A B C D, try with

(* A B *) C D

and if that causes no error, try

A B (* C D *)

then perhaps

(* A *) B (* C D *)

etc. until only a small unreducible part of your unit remains. Since you're testing the IDE not the compiler, you probably don't need your commented-out unit to compile without error.

{$ifdef something}
   type myclass = class
{$else]
   type myclass = class(existingclass);
{$endif}

Seems to confuse, but not crash.

Also ifdef in property declarations seems to upset the system.

In D2009,

type myrecord = record someting : set of 0..31; end;

seemed to inhibit completion (it mumbles about SET), but no crash.

update

It is the "set of" construct itself the completion can't handle (while the compiler can)

update 2 : IFDEFs in property declarations also confuse/crash the ide.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!