Css Outline Quickopen

Milian Wolff mail at milianw.de
Mon Jan 25 13:15:09 UTC 2010


On Sunday, 24. January 2010 12:10:23 Niko Sams wrote:
> Hi,
> 
> In Css documents it would make sense to show Css selectors in the
> Outline Quickopen.
> Currently the Quickopen shows function declarations only.
> 
> How should I implement this?
> Create fake function declarations in Css?

Yes, I'd do that. Esp. once you parse the CSS file anyways for errors, you 
should create a TopDUContext to save the status of the file, i.e. to not have 
to reparse everytime. Then adding declarations where required and you have 
nice outline.

The question imo is more:
What is the declaration:

#someid .someclass sometag, #otherid .otherclass othertag {}

- the whole selector? I.e.: "#someid .someclass sometag, #otherid .otherclass 
othertag"
- only each whole selector, i.e.:
"#someid .someclass sometag" and then "#otherid .otherclass othertag"
- each use of a tag, class, this would be nice if you look for usages of a 
given ID / class...

> And what about XML/HTML documents that could want to show a tree
> structure in the Outline?

Would require changes in the quickopen dialog. Or we use the qualified 
identifier, e.g. similar to how:

namespace first { class second { void third(){} }; }

is displayed in the quickopen dialog as

first::second::third

Of course this way one cannot expand / hide contexts, but one can filter them 
quickly if required. Though only for "third". Would maybe make sense to 
support search input like "first::third". And of course in XML it would be 
nicer to have something like xpath's, e.g. first/second/third (/ instead of :: 
) but this is just "nice-to-have")

-- 
Milian Wolff
mail at milianw.de
http://milianw.de




More information about the KDevelop-devel mailing list