[Geany] How to add symbols to the Symbol tab

Robert Fekete fekete77.robert at xxxxx
Fri Apr 13 19:04:05 UTC 2012


Hi,

Thank you very much for your help and thoughts, and sorry for the slow
reply. See my comments inline.

On Wed, Apr 11, 2012 at 2:50 AM, Lex Trotman <elextr at gmail.com> wrote:
> On 11 April 2012 02:23, Nick Treleaven <nick.treleaven at btinternet.com> wrote:
>> On 10/04/2012 09:57, Lex Trotman wrote:
>>>
>>> On 10 April 2012 18:14, Robert Fekete<fekete77.robert at gmail.com>  wrote:
>>>>
>>>> - Is it possible to list the symbols by appearance by default?
>>>>
>>>> Currently I have to manually change this setting for every file.
>>>
>>>
>>> Well, for most programming, having the symbols in alphabetical order
>>> is the right thing to do, so thats the default.  As you noted it is a
>>> per-file setting and there is no way to store it per file.  Making the
>>> default per filetype might be your solution, but that would take some
>>> work and well, somebodys got to do it.  But patches are welcome.
>>
>>
>> Already implemented per-filetype - see symbol_list_sort_mode under:
>> http://www.geany.org/manual/current/index.html#settings-section
>
> Thanks Nick, missed it.
>
>>
>> It's the default for e.g. reStructuredText and could be for DocBook if that
>> seems sensible.
>>
>
> Yes, Docbook users should decide, or Robert can just change his own
> Docbook filetype for now.

That is just what I was looking for, I'll change it locally, no problem.

>
> I notice that docbook isn't highlighted, should we make it use the
> Scintilla XML lexer? (since all the docbook I have is machine
> generated it has the extension xml any way so I had to set it to
> docbook)
>
Geany highlighted docbook files fine, but that got broken some time
last year, IIRC. Now with my current build (version 0.21, built from
source) it works fine again.

>>
>>>> - The symbol tab now shows the sections and chapters in a separate
>>>> list, and that way the hierarchy of the tags (the structure of the
>>>> file) is lost. It is possible to display the list in a tree?
>>>
>>>
>>> The current tagmanager code is not very good at hierarchy handling
>>> (although it does it, it isn't good) and there is work under way to
>>> replace it.  Until then I would say the answer is theoretically yes
>>
>>
>> Is there? By who? Surely it would still need to parse tags with the CTags
>> parsers even if it's managed differently than TagManager.
>
> Columban is doing some work on it as he gets time and yes his current
> intention is to re-use the current parsers (at least when I asked a
> couple of weeks ago).
>
>>
>> Also not sure what you mean by tagmanager not being good at hierarchies.
>>
>
> Well, to be explicit I guess its more to do with the problems with
> repeated names (although Colombans recent patch has greatly improved
> it).  At the moment the docbook parser uses the id as the unique key
> and only shows entities with an id, but not all entities must have an
> ID.  To show the entire hierarchy it would have repeated <chapter> and
> especially <section> <paragraph> etc it is going to need a better
> "uniquification" of the repeated name.  Colomban uses line number to
> uniquify the key, but with XML you often get multiple things on a line
> so something else is needed, eg character number.

ID is entirely optional in docbook. What would be useful in these
situations is the content of the <title> tag of the element, but that
would probably require Geany to parse the file with an XML parser,
because the title tag is not necessarily in the same line as its
parent tag (though usually it is the first child node).

On the other hand, I think it would not be necessary to show every
element in the sidebar hierarchy: for a start, "main" elements and
their titles/ids would be great. Under main elements I mean nodes like
chapter, section, procedure, and so on, that give the main structure
of the file.

Have a nice weekend!

Regards,

Robert

>
> Cheers
> Lex
>
>> Regards,
>> Nick
>>
>> _______________________________________________
>> Geany mailing list
>> Geany at uvena.de
>> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
> _______________________________________________
> Geany mailing list
> Geany at uvena.de
> https://lists.uvena.de/cgi-bin/mailman/listinfo/geany



More information about the Users mailing list