About/Contact

Steve Trefethen

Steve Trefethen is a Director of Engineering at Reply. Contact me

View my LinkedIn profile


Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?
$720 in referrals so far!


Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

Disclaimer

The posts on this weblog are provided AS IS with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.



Using code browsing in the Delphi IDE

October 31 2006 3:18PM

Are you familiar with the code browsing features in the IDE? Code browsing was added several releases ago but I'm not sure if people are familiar with how it works. The idea is pretty simple, leverage standard web browser techniques to allow people to browse their code. The IDE supports both keyboard and mouse navigation for code browsing and from the code editor the options are as follows:

  • Using the mouse, hold down the Control key and click a symbol
  • Using the keyboard position the editor caret on the symbol and press Alt-Up arrow
To complete the browsing metaphor the IDE also supports the standard browse forward/backwards shortcuts of Alt-Left arrow and Alt-Right to navigate the code browsing history just like a web browser.

I'm guesing but probably a much less well known method of code browsing is supported is in the Code completion listbox. To see this, simply position the editor caret inside of a method body and invoke code completion. Once the list appears control click an identifier from the list to browse to that symbol. So, if you find something in the list and you're wondering "hey, where/what is that?" just control-click it to find out.

UPDATE: In response to a comment to this post I just wanted to mention that IMO code browsing works better in BDS 2006 than any previous release and I know there were a number of bugs fixed specifically related to code browsing.

FacebookDel.icio.usDigg It!

Tags:

Comments (15) -

10/31/2006 5:36:01 PM #

Hi Steve,

as far as I am concerned, you guessed correctly: I didn't know that ctrl-click also works in the completion listbox. Thanks for mentioning it.

Actually I have found lately that there are quite a few littles gems of the Delphi IDE that I didn't know about. Some of Nick's demos were quite an eye opener for that too.

twm

Thomas Mueller

10/31/2006 8:36:46 PM #

It doesn't work very well in Delphi 7 - may have been improved in later versions. It only works about half the time, but always takes a very long time (maybe 30 seconds) to complete on my project. When it works, it still helps, but half the time I end up wasting my time, and then have to find the symbol manually anyway.

JB

10/31/2006 8:48:16 PM #

Hi JB,
  It's been awhile since I've worked in D7 but I believe you're right and it undoubtedly works better in BDS 2006. In the 1000's of bugs that we fixed in BDS 2006 there were a number related directly to code browsing and I use it all the time now.

-Steve

Steve Trefethen

10/31/2006 11:12:14 PM #

AFAIK in D7 code browsing strictly depends on debug symbol being available or something alike. If the application was compiled without them it does not work well, or does not work at all.
Because Borland since Delphi 1 decided that saving/loading differen t compiler configuration was not needed because developers like to open the project options box every time and activate/deactivate all those little checkmarks, sometimes you get a non-working code browser.

Ideon

11/1/2006 10:42:45 AM #

Didn't know about the keyboard shorcut. Always bugged me that I had to use the mouse to navigate to some position (as opposed to VS where I just press F12)... good to know, thanks.

Fritz

11/1/2006 4:32:17 PM #

So Ctrl+Shift+Up/Down belongs to Code browsing technically? From the IDE shortcut listing on your homepage, I got the impression it would belong to Class Completion, since its in that category there.
Would actually be good to know to make sure QC report are in the correct area!

Sebastian

11/1/2006 5:23:28 PM #

Hi Sebastian,
  Code browsing is:

- Alt-Left Arrow: browse back
- Alt-Right Arrow: browse forward
- Alt-Up Arrow: browse to symbol
- Ctrl+Left mouse click: browse to symbol

There is no Ctrl+Shift up/down in code browsing.

If you look on this page:

homepages.borland.com/.../index.php

The code browsing keys listed are correct.

-Steve

Steve Trefethen

11/1/2006 8:03:13 PM #

Steve,

thanks for clarifying. I confused those. So I assume Ctrl+Shift+Up/Down (navigate between declaration and implementation) is part of Class Completion.

Oh and BTW: I tried Alt+Up in a Code Completion window and unfortunately it didn't browse to the symbol, so it seems this is not supported.
Even stranger if I then used Up+Down to select a different CC entry, the entry was getting blank. Should I QC the latter/former/both?

Thanks

Sebastian

Sebastian

11/1/2006 8:25:14 PM #

Hi Sebastian,
  You're welcome, and yes the Ctrl-Shift Up/down are part of class completion.

Alt+Up doesn't work in the code completion list only Ctrl-Clicking does to browse to that symbol. Alt+Up only works within the code editor while the cursor is on a symbol.

This last issue sounds like a bug and logging that to QC would be great.

-Steve

Steve Trefethen

11/1/2006 8:57:40 PM #

Steve,

here's the QC: http://qc.borland.com/wc/qcmain.aspx?d=36001

Sebastian

Sebastian

11/2/2006 9:06:30 AM #

Thank you! I didn't know about ALT+Up and Ctrl+Click in the completion list. Very usefull tip!

Igor Skomorokh

5/22/2007 8:35:13 PM #

There are detailer than out button million copies of his convalescences in print.

legitimate work from home jobs

5/22/2007 8:37:23 PM #

There's cockney criticism you can come up with that he hasn't put into a.

legitimate work from home jobs

6/27/2008 10:57:58 AM #

Oh..Thanks,  Today only i know can browse code using Ctrl+Click on code completion..Thanks.

Is there any way to browse the code file programmatically ?

..i mean, i have a form with a TButton,  i would like to browse the buttonclick event handler at runtime by just doubleclick on button..

Thanks
Basil

Basil

6/27/2008 2:41:03 PM #

Basil,
  Since Delphi is a compiled language there is no way to view source code for event handlers at runtime.

Steve Trefethen

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading