Smart Mobile Studio
  • News
  • Forums
  • Download
  • Store
  • Showcases
    • Featured demos
    • The Smart Contest 2013, Round 1 – Graphics
  • Documentation
    • Get the book
    • System requirements
    • Prerequisites
    • Getting started
      • Introduction
      • Application architecture
      • The application object
      • Forms and navigation
      • Message dialogs
      • Themes and styles
    • Project types
      • Visual project
      • Game project
      • Console project
    • Layout manager
    • Networking
      • TW3HttpRequest
      • TW3JSONP
      • Loading files
  • About

Global rename function

Posted on 17.02.2012 by Jon Lennart Posted in Developers log, News and articles 6 Comments
Global rename done

Global rename done

Being able to rename a unit via the project treeview is commonplace in mid to high range editors today. There are a lot of javascript editors out there, some more evolved than others – but the number of object pascal editors is sadly very limited. You have Delphi of-course which is great (and the most advanced object pascal editor on the marked), then there is Lazarus which is the free and open version written in freepascal – and while there are other alternatives, none of them even comes close to the original “Delphi” look and feel.

Believe it or not but this time Smart Mobile Studio actually got something Delphi doesn’t (Delphi 7 was our initial model): global renaming. When you rename a unit under Smart, it doesn’t just alter the source-code for the unit in question – it alters all references to that unit in the entire project. No need to backtrack and update the uses declaration elsewhere, they are all changed in a single sweep.

We can actually map the use of a class or method throughout a whole project, and it’s super quick as well!

Database mapped RTL

But we have more tricks up our sleeve. I took the time to make a recursive database indexer for our RTL files. So the first time you run Smart it will parse and extract every inch of information about the RTL and store it in a database table. This table is kept in memory and used to speedup extraction of data regarding classes, methods and properties.

It also has the benefit of giving me instant access to things like class ancestors, data types, fields, scope, interfaces and all those tiresome look-up chores that makes a mess of a codebase. So armed with a TClientDataset map (what did you expect? No self respecting Delphi app is complete without at least one instance of TClientDataset) of the RTL, it is now super easy to beef up and compliment the compiler. On top of my head here are a few things i’m gunning for:

  • Complete class at cursor
  • Rename class at cursor
  • Add interface to class
  • Merge classes
  • Support for documentation remarks above methods
  • Mouse-over information about symbols

I doubt we will be able to stuff all the goodies into version 1 of Smart Mobile Studio, but rest assured that I will do my best to get as much features into Smart as I can.

Globals

And now that the indexing and background compile is up to speed, the time has come to finish the globals feature. Globals allows you to edit a list of object (of any class) that should be created automatically by TApplication. Very handy if you have a database connection or some game logic you want to be created on startup.

These are exciting days!

Smart Mobile Studio Upcoming features
« Big blue, ancient of days
Bling up your apps »

6 thoughts on “Global rename function”

  1. michaelbunny says:
    17.02.2012 at 20:59

    Thank you. Valuable improvements.

    • Jon Lennart Aasenden says:
      18.02.2012 at 04:33

      Thanks Michael!

  2. Mason Wheeler says:
    18.02.2012 at 01:27

    That’s very nice… right up until you get a really big project. If your goal is to enable the development of complex applications, what safeguards do you have in place to keep the whole system from either breaking horribly (see: RAD Studio) or bogging down horribly (again, see: RAD Studio) once your project passes a certain level of complexity?

    • Jon Lennart Aasenden says:
      18.02.2012 at 04:28

      Im not sure what you mean here Mason?
      If you are refering to the rename function, this function get’s its information from the compiler. And by its very nature the compiler keeps track of symbols and tokens, so there is very little that can go wrong. We also issue a save call prior to renaming – which means your files are stored on disk (.bak files) in case something goes wrong.

      If you are refering to the proposed functions, like rename class etc. I hardly think you can compare any of this to the uber-bloat that was Rad Studio. Rad studio was an IDE that not only contained Delphi, it also added C++,C#, visual basic and object pascal # to the mix. Im actually blown away that it even got off the ground in the first place.

      Our goal with Smart is not to create a “be all” to all users type of product. We have a “inspired goal” of matching the functionality of Delphi 7, which in my view was the most producive and enjoyable version of Delphi. But the central aim is to make it easy to write HTML5 apps in object pascal. Nothing more, nothing less.

      • Mason Wheeler says:
        18.02.2012 at 18:01

        OK, so it’s not likely to break and get all corrupted. But when you’ve got a large project, how are you going to keep it from taking up tons of memory and/or taking forever to find something? (Bearing in mind that solving the one usually involves making the other worse.)

        • Jon Lennart Aasenden says:
          18.02.2012 at 18:15

          You have to elaborate here exactly. Are we talking editor memory or compiled JS memory? The IDE is memory hungry yes, but fairly modest compared to Delphi XE. It is a first generation tool after all.

          And im not sure i understand why it should take long to find something? I just described how we use a DB table to speed up finding stuff – even though the compiler actually compiles the whole RTL + our megademo example in less than 1 second.

Comments are closed.

Pages

  • About
  • Feature Matrix
  • Forums
  • News
  • Release History
  • Download
  • Showcases
    • The Smart Contest 2013, Round 1 – Graphics
  • Store
  • Documentation
    • Creating your own controls
    • Debugging, exceptions and error handling
    • Differences between Delphi and Smart
    • Get the book
    • Getting started
      • Introduction
      • Local storage, session storage and global storage
      • Application architecture
      • The application object
      • Forms and navigation
      • Message dialogs
      • pmSmart Box Model
      • Themes and styles
    • Layout manager
    • Networking
      • Loading files
      • TW3HttpRequest
      • TW3JSONP
    • Prerequisites
    • Real data, talking to sqLite
    • System requirements
    • Project types
      • Visual project
      • Game project
      • Console project

Archives

  • December 2019
  • December 2018
  • November 2018
  • July 2018
  • June 2018
  • February 2018
  • September 2017
  • April 2017
  • November 2016
  • October 2016
  • September 2016
  • April 2016
  • March 2016
  • January 2016
  • October 2015
  • September 2015
  • July 2015
  • April 2015
  • January 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • November 2011
  • October 2011
  • September 2011

Categories

  • Announcements (25)
  • Developers log (119)
  • Documentation (26)
  • News (104)
  • News and articles (16)

WordPress

  • Register
  • Log in
  • WordPress

Subscribe

  • Entries (RSS)
  • Comments (RSS)
© Optimale Systemer AS