oleg-shilo / codemap.vscode

Code map (syntax tree) of the active document
MIT License
84 stars 28 forks source link

Add sort button to the CodeMap display #72

Closed derekwallace closed 1 year ago

derekwallace commented 1 year ago

Hi love the plugin. depened on it.... Can you add a sort button(2) . sometimes i want to see the list sorted... somethimes i want to see the list in the order they were parsed from the file. I can change in the settings to by defualt sort... but i dont want it permanent i.e. would like a button to do it on the fly. I think 3 sorting needed

  1. as per the order in file
  2. sort alphabetical
  3. sort reverse alphabetical.

regards derek

oleg-shilo commented 1 year ago

Agree. Good idea. Will do

Though, it needs to be done carefully. IE, most likely the sorting needs to be done by class name and then within a class. Basically by nested levels.

Otherwise, you can end up with a complete mess of the methods and classes

Timhobson-source commented 1 year ago

Hiya, love the extension - really comes in handy!

Just a quick add-on to this issue. The solution that has been released automatically sorts the tree by ascending order when a new codemap window is opened. Most of the time I want to see the tree in "ByLocation" order, and then change it to A-Z/Z-A order when needed. I'm suggesting to add-in a setting for a default sorting direction when you open a new window.

If you think this is a good idea, I have already done a branch locally for this if you want to give me permission to push it.

oleg-shilo commented 1 year ago

Not a prob. Go for it. Just create a pull request and I will review and merge it

oleg-shilo commented 1 year ago

done Release v1.18.0