Uses clause mangler

Uses clause mangler

My team lead just pointed this out to me. In Delphi 2010. Position the cursor in the uses clause and type a left parenthesis. On my machine it causes several of the units after the parenthesis to be injected before the parenthesis.

I have a number of third party extensions installed so it's possible it may be one of them. Can anyone confirm this behavior in whatever version of Delphi you're using?

Comments

  1. This is "normal" behavior of the IDE for the units used by components placed on the form. It also happens if you are typing just normal within the uses clause.

    ReplyDelete
  2. Funny. Been working in Delphi for 10 years and never noticed it. I've seen it add unit entries when you add a component to a form or whenever you save a form but this is the first time I noticed it when I types a '('.

    ReplyDelete
  3. It does that whenever it fails to parse the rest of the uses to pick up the units its about to add.

    ReplyDelete
  4. yeah, it also drives me nuts sometimes when I'm trying to "properly" set the uses clause as:
    uses
       Windows
      ,SysUtils // anywhere you use code-completion, it will automagically add the rest of the units before the place you invoke code-completion
      ,etc.
      ;

    ReplyDelete

Post a Comment