[Lazarus] "Figures" in code explorer

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Apr 21 01:20:05 CEST 2009


On Tue, 21 Apr 2009 09:25:13 +1100
Alexander Klenin <klenin at gmail.com> wrote:

> On Mon, Apr 20, 2009 at 20:50, Mattias Gaertner
> <nc-gaertnma at netcologne.de> wrote:
> > About (4d) - single line begin..end
> > Maybe you can give an example when this is not about code
> > formatting?
> >
> I just mean that removing non-whitespace characters is not formally
> 'formatting'.
> I agree it is gray area.

FYI: The jedi code formatter can add semicolons.


> > A good formatter is very flexible and has a lot of options to fine
> > tune indentation and line break. IMO complex expressions which can
> > not be automatically broken nicely, should be changed anyway. Maybe
> > the code explorer should show deeply nested expressions.
> Or simply expressions with too many tokens, regardless of nesting.

You can create a lot of tokens without getting complicated:

if (Node<>nil)
and (Node.TheType=something)
and (Node.Parent<>nil)
and (Node.Parent.TheType in [bla,bla,bla])
and (Node.Parent.NextBrother<>nil)
then

 
> > Long lines depends on right margin and this heavily depends on
> > programmers choice. For example if you set your right margin to 80
> > and you open a unit of other programmers the code explorer will
> > easily list thousands of long lines. A performance killer.
> Is not it O(total number of lines) anyway? I do not see how a
> performance could depend on that. 

Reading is far less expensive than creating a TTreeNode with an icon,
a text and data. And don't forget that the tree nodes must be sorted.

> If you are worried about the number
> of items found, then I suggest to implement a generic limit of, say,
> 100 items. 100'th item should contain 'too many items found' text.

Yes. But we have already more than ten categories and I guess we can
easily get twenty. 
I guess the only solution is to parse only til the first occurence and
read the rest only on demand.

Mattias



More information about the Lazarus mailing list