Recent

Author Topic: [SOLVED] Jumping through the source code defective  (Read 525 times)

rvk

  • Hero Member
  • *****
  • Posts: 4949
[SOLVED] Jumping through the source code defective
« on: May 31, 2022, 04:41:24 pm »
Wasn't it possible to jump through the source code of Lazarus before?

For example, create new form application.
Double click form and type some command (Close; for example).
If I set my cursor on Close and press Alt+Up I go to the Declaration.

But wasn't it possible before to jump to the implementation with a second Alt+Up.
(it is in Delphi and I'm sure I used it in Lazarus too, A LOT)

Is jumping around the source in the IDE gone defective?

It somehow feels like it doesn't search for the included file anymore and since most implementations are via includes it can't find those functions.
Anyone else have this experience?
« Last Edit: May 31, 2022, 04:51:35 pm by rvk »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10297
  • FPC developer.
Re: Jumping through the source code defective
« Reply #1 on: May 31, 2022, 04:45:16 pm »
jump between interface and implementation is ctrl-shift up/down.


rvk

  • Hero Member
  • *****
  • Posts: 4949
Re: Jumping through the source code defective
« Reply #2 on: May 31, 2022, 04:50:25 pm »
jump between interface and implementation is ctrl-shift up/down.
AAAARGH.  :-[

Thanks.
Maybe I spent too much time in Delphi (where Alt+Up does work) that I forgot this key-combo  :D

(I also couldn't find it in the menu-items)
« Last Edit: May 31, 2022, 04:52:53 pm by rvk »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10297
  • FPC developer.
Re: Jumping through the source code defective
« Reply #3 on: May 31, 2022, 05:05:51 pm »
jump between interface and implementation is ctrl-shift up/down.
AAAARGH.  :-[

Thanks.
Maybe I spent too much time in Delphi (where Alt+Up does work) that I forgot this key-combo  :D

(I also couldn't find it in the menu-items)

I actually tested it in Delphi Seattle, alt up on tstream.write brings me to the first line of implementation, and then I first have to move the cursor back to the "write" of TStream.Write, and only then alt-up brings me to interface.

ctrl-shift +/- directly jumps without first repositioning the cursor on the function name.
« Last Edit: May 31, 2022, 05:07:46 pm by marcov »

rvk

  • Hero Member
  • *****
  • Posts: 4949
Re: Jumping through the source code defective
« Reply #4 on: May 31, 2022, 05:11:26 pm »
I actually tested it in Delphi Seattle. I think you are confused with C/C++ (and Java?) IDEs that indeed often allow to jump with one key.  For certain MP Lab X (NetBeans) with its ctrl-B, and iirc also VS with F10 or so?
The Alt+Up also works in Delphi 10.2.
The Ctrl+Shift Up and Down work too but I never use those in Delphi.
I always jump through the source with just Alt+Up in Delphi.

Officially it is
Quote
Alt+Up Arrow / Ctrl+Right Click - Goes to declaration.
https://docwiki.embarcadero.com/RADStudio/Sydney/en/Default_Keyboard_Shortcuts
but like I said... when doing this on a function in the interface part it brings me to the implementation of that function.

I guess I need to adjust my habits  :D

Edit: Now that I've used CTRL+SHIFT Down a couple of times I remember this  ::)
Alt + Up to go to the interface part of that function and then Ctrl+Shift+Down to go straight to the implementation.
« Last Edit: May 31, 2022, 05:14:56 pm by rvk »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10297
  • FPC developer.
Re: [SOLVED] Jumping through the source code defective
« Reply #5 on: May 31, 2022, 05:26:06 pm »
I edited my post . I can jump to interface with alt-up, but only after moving cursor.

rvk

  • Hero Member
  • *****
  • Posts: 4949
Re: [SOLVED] Jumping through the source code defective
« Reply #6 on: May 31, 2022, 05:37:46 pm »
Yes, location of cursor is important.
Sometimes it does jump directly to the implementation and I'm right where I need to be.
Otherwise I move the cursor on the declaration and do a second Alt+up to get there.

But I'll try to change my habit to use Ctrl+Shift+Up/Down (which does land the cursor somewhat more accurate)  :)

wp

  • Hero Member
  • *****
  • Posts: 10060
Re: [SOLVED] Jumping through the source code defective
« Reply #7 on: May 31, 2022, 06:38:13 pm »
There is a setting in "Tools" > "Options" > "Code Tools" > "General": When I check "Jump directly to method body" a CTRL-Click (that's the way I do it) on a procedure in the code brings me to the implementation of that procedure, otherwise (unchecked) I go to the interface.

 

TinyPortal © 2005-2018