Recent

Author Topic: Lazarus IDE refactoring  (Read 2178 times)

jlinux

  • New Member
  • *
  • Posts: 13
Lazarus IDE refactoring
« on: February 15, 2024, 11:57:14 pm »
Does this feature not exist?
This feature is very useful and is used in many IDE's and I am surprised that it is not available in Lazarus.
It's probably such a trivial situation that it isn't even mentioned and I'm the one who can't find it.
I Googled for this and found nothing but vague stuff.
For example, replacing something as simple as the name of a variable in all files that are part of the project.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10552
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus IDE refactoring
« Reply #1 on: February 16, 2024, 12:08:13 am »
Does this feature not exist?

Which of them? There are hundreds, maybe thousands of refactoring methods. E.g. "rename variable" is a refactoring https://refactoring.com/catalog/renameVariable.html

In Lazarus you can find some of them in the menu "Source", or in the context menu of the source editor. Both have a submenu called "Refactoring"

There are however many other feature of the IDE that also can be used for refactoring.

jlinux

  • New Member
  • *
  • Posts: 13
Re: Lazarus IDE refactoring
« Reply #2 on: February 16, 2024, 12:42:02 am »
Gosh... I can't believe it didn't occur to me to look there.
tvm

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4541
  • I like bugs.
Re: Lazarus IDE refactoring
« Reply #3 on: February 16, 2024, 05:31:05 pm »
For example, replacing something as simple as the name of a variable in all files that are part of the project.
That can be done with a shortcut F2 when your editor cursor is on the variable name.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Bart

  • Hero Member
  • *****
  • Posts: 5466
    • Bart en Mariska's Webstek
Re: Lazarus IDE refactoring
« Reply #4 on: February 16, 2024, 05:59:58 pm »
That can be done with a shortcut F2 when your editor cursor is on the variable name.

OK, didn't know that F2 also worked for that.
Have used Ctrl+Shigt+E for that feature ever since that feature existed (and I use Lazarus)......

Bart

dsiders

  • Hero Member
  • *****
  • Posts: 1282
Re: Lazarus IDE refactoring
« Reply #5 on: February 16, 2024, 07:38:24 pm »
That can be done with a shortcut F2 when your editor cursor is on the variable name.

OK, didn't know that F2 also worked for that.
Have used Ctrl+Shigt+E for that feature ever since that feature existed (and I use Lazarus)......

Bart

Interesting. I didn't know about Ctrl+Shift+E.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

Thaddy

  • Hero Member
  • *****
  • Posts: 16168
  • Censorship about opinions does not belong here.
Re: Lazarus IDE refactoring
« Reply #6 on: February 16, 2024, 08:24:03 pm »
That comes from Delphi. Since D2005.
If I smell bad code it usually is bad code and that includes my own code.

dsiders

  • Hero Member
  • *****
  • Posts: 1282
Re: Lazarus IDE refactoring
« Reply #7 on: February 16, 2024, 10:14:09 pm »
That comes from Delphi. Since D2005.

That's also about the last time I touched a copy of Delphi. Coincidence? ;)
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

 

TinyPortal © 2005-2018