Re: GtkSourceView branched for 2.16



Johannes Schmid wrote:

Hi!

Usually this should be discussed on IRC but I currently don't have the
time...

Feature Request: It would be great to have some of the information that
is used for highlighting availible for a given iter. This would include
imformations like what kind of code we are currently in (Comment,
keyword, etc) and would make some things in IDEs much easier.
It is indeed needed. What's not clear is what to expose: syntax
highlighting is first of all *highlighting*, i.e. it doesn't really care
about real syntax structure of the document, it cares more about
fancy colors. So while some regions are marked sensibly with e.g.
"comment", some regions may have some funny senseless tags;
location of those regions may be strange too, and some text may not
be highlighted at the moment, etc. In other words, syntax highlighting
is no substitution for real syntax analysis (e.g. if IDE delegates C file
parsing to syntax highlighting engine, then it's plain stupid). Having that
said, the highlighting engine can and should provide some information
about what it knows the text, but it's not clear how much and how (you
don't want all the information it has).

I think it'd be enough to mark contexts in lang files in some way (e.g.
<context name="foo">), and have some
gtk_source_buffer_get_syntax_regions_at_iter()
which would return list of those names or something.

Ideas?

Best regards,
Yevgen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]