Recent

Author Topic: Suggestion:Code Insight  (Read 12233 times)

lpa

  • Guest
Suggestion:Code Insight
« on: April 15, 2004, 05:49:22 am »
It is nice if Lazarus has the feature of "Code Insight" like that in delphi.For example,When I type: myobject.
then a hint window appears,with a list of methods/properties
myobject has.
Hope you can understand me despite of my bad English.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2512
Suggestion:Code Insight
« Reply #1 on: April 15, 2004, 12:23:55 pm »
Try pressing CTRL+Space in the IDE
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Anonymous

  • Guest
Suggestion:Code Insight
« Reply #2 on: June 16, 2004, 12:43:35 pm »
ok, but after i lose the focus to my editor window. Do you know if there  is a option to not press CTRL+space so when i press "." it is automatic ?

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Suggestion:Code Insight
« Reply #3 on: June 16, 2004, 01:52:27 pm »
There was a bug in lazarus (win32), that lost the editor focus after code completion.  This has been fixed and  after choosing the identifier, the focus is returned to the editor.

An option to make it automatic is not (yet) implemented.

caitken

  • New member
  • *
  • Posts: 5
Suggestion:Code Insight
« Reply #4 on: April 10, 2005, 03:46:52 am »
I'd just like to add my vote to the code completion feature.  The current implementation within lazarus is ok - but could be better.  Although it choaks me to say it - something like the way this functionality is implemented in MS Visual Basic is good from a user perspective.  It might seem like a luxuary feature - but I think it is a very necessary one in the RAD IDE environment.  It cuts down on the time spent constantly flipping between help files or class implementation files etc looking for the correct name of class methods, proterties, or function and procedure arguements.  It greatly increases the likelihood of a sucessful first time compile.

I'm a recent convert from C++ to Delphi - and I think what you've acheived in lazarus is awesome.  I'd be happy to have a go at cutting / contributing some code if someone could give me a few pointers as to which units within the lazarus code I'd need to look at.

matthijs

  • Hero Member
  • *****
  • Posts: 537
Suggestion:Code Insight
« Reply #5 on: April 10, 2005, 09:09:53 am »
I guess the question of caitken, is for a hint showing the parameters to use when a procedure, function or method is called. This feature is invoked by <ctrl><shift><space> in delphi.
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

wes12

  • New Member
  • *
  • Posts: 21
Suggestion:Code Insight
« Reply #6 on: April 12, 2005, 03:23:46 pm »
Quote from: "caitken"
.. I think it is a very necessary one in the RAD IDE environment.  It cuts down on the time spent constantly flipping between help files or class implementation files etc looking for the correct name of class methods, proterties, or function and procedure arguements.  

There is a similar function in Lazarus already, but it works slightly differently. Type the name of the function, so for example:
 ts:=IntToStr
now move the mouse cursor back over the IntToStr and a yellow box hint will pop up showing you the parameter list for IntToStr and also which file (including line number) the declaration appears in.

If you are using a procedure/function where there is more than one possible version of the parameter list, you can usually find the one you want by right clicking on the name and selecting 'Find Declaration'. This will open up the relevant code file in the Editor.

So there is no need to be constantly flipping between help files or class implementation files  :D

Anonymous

  • Guest
Suggestion:Code Insight
« Reply #7 on: April 12, 2005, 11:11:32 pm »
However, what Caitken wrote ist right.

It would be much easier, in the first instance for beginners, to start develop with lazarus.
Also for professional developers this features make RAD real. To use the mouse instead of the automatic appeareance of the parameter window is a bad alternative.

In any case, Lazarus is a great work.

regards

namrud

matthijs

  • Hero Member
  • *****
  • Posts: 537
Suggestion:Code Insight
« Reply #8 on: April 13, 2005, 12:09:13 pm »
Quote from: "wes12"

There is a similar function in Lazarus already, but it works slightly differently.


But you have to set an option in the Editor options. "Tooltip symbol tools." This is on the Code Tools tab.
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

caitken

  • New member
  • *
  • Posts: 5
Suggestion:Code Insight
« Reply #9 on: April 14, 2005, 12:51:11 pm »
From the comments so far it would seem to me that most of the functionality is in lazarus already - just not in the most user friendly implementation.  Also the options discussed still mean that the user has to refer between references etc - whereas the MS VB implementation means that the parameters in a function or procedure call are listed - parameter by parameter (eg. if a parameter is a constant - you are provided with a dropdown listing of all the relevant constants) at the moment is lazarus if you select a procedure you get the procedure name followed by empty brackets - and yet lazarus is obviously aware of what the parameters are - judging from the previous comments.  The impression I have is that lazarus could offer something very similar to MS VB without too much more effort... my original offer still stands.

wes12

  • New Member
  • *
  • Posts: 21
Suggestion:Code Insight
« Reply #10 on: April 14, 2005, 08:44:49 pm »
Yes, most of the functionality is there already. But I can't understand why you object to pressing CTRL-Space to get a parameter list. Old timers (like me) often dislike automatic features, since they sometimes insert code where you don't want it, and your typing speed drops considerably. Please make sure they can be turned off!

As for the 'MS VB implementation' you could hit a problem with overloaded routines. I don't think VB has them to any great degree.

I'm too new to Lazarus to be able to offer much help, but it looks like you'll probably need to start in uniteditor.pp . Good luck!

Lightning

  • Sr. Member
  • ****
  • Posts: 422
Suggestion:Code Insight
« Reply #11 on: April 15, 2005, 09:46:20 am »
Well in the latest snapshots all parameters are shown in tooltips, as for overloaded functions ... Delphi lists them on more rows in the hint. And of course automatic features can be disabled.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

caitken

  • New member
  • *
  • Posts: 5
Suggestion:Code Insight
« Reply #12 on: April 15, 2005, 01:43:57 pm »
I don't object to using ctrl-space - it just doesn't do what I want it to... and you'd be surprised at what some of us old timers dislike.  I think you've missed the point.  MS VB doesn't have much in the way of overloading or inheritance for that matter (that is in part the attraction of delphi).  I'll will have a look at uniteditor.pp.

caitken

  • New member
  • *
  • Posts: 5
Suggestion:Code Insight
« Reply #13 on: April 23, 2005, 11:02:36 am »
Well I've had a bit of a look and first impressions are that I'm up against the fundemental design of the Syn Edit component.  I'm not sure I want to take on recoding Syn Edit.

Lightning

  • Sr. Member
  • ****
  • Posts: 422
Suggestion:Code Insight
« Reply #14 on: April 29, 2005, 06:02:59 pm »
SynEdit was not made by the Lazarus team, it was ported from the synedit project, i also don't like certain design ideas in SynEdit but it does the job and using it just to highlight code is extremly easy, however for complicated things it can be quite hard ...
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

 

TinyPortal © 2005-2018