Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort symbols #67

Closed
Sacules opened this issue Apr 25, 2019 · 5 comments
Closed

Sort symbols #67

Sacules opened this issue Apr 25, 2019 · 5 comments
Labels
enhancement ✨ New feature or request

Comments

@Sacules
Copy link

Sacules commented Apr 25, 2019

Hi, is it possible to sort the symbols alphabetically? Currently they appear according to the order they were declared, but it could be useful to be able to sort them.

@liuchengxu
Copy link
Owner

liuchengxu commented Apr 26, 2019

You mean sorting all the symbols under some category/struct or even the category should be displayed in some order? And I'm curious how that is useful, could you give an example?

@Sacules
Copy link
Author

Sacules commented Apr 26, 2019

Just the symbols under a same category, yes. I find it useful when going through a new codebase to read the functions and methods in alphabetical order - usually related code starts with similar wording. This way it looks very similar to generated documentation like Doxygen and Godoc, and makes navigation easier.

Imgur Imgur

Here's the original order on a Scala file vs a mockup I made - it certainly feels a lot cleaner. Plus, this could go in handy with a hierarchical tree for certain data in the future.

@liuchengxu
Copy link
Owner

liuchengxu commented Apr 26, 2019

vista.vim now supports renders ctags in a hierarchical way, which was introduced in #58.

For LSP, to my knowledge, the hierarchicalDocumentSymbolSupport needs both the LSP server and client support, it is not ubiquitous yet. But that's possible as long as the hierarchical info could be requested.

This feature is not hard to implement. I will take a look when I get some time.

@liuchengxu liuchengxu added the enhancement ✨ New feature or request label Apr 26, 2019
liuchengxu added a commit that referenced this issue Apr 26, 2019
Also copy the content when sorting

Ref #67
@liuchengxu
Copy link
Owner

@Sacules You can use s in the vista window to sort the symbols back and forth.

@Sacules
Copy link
Author

Sacules commented Apr 26, 2019

Works great! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants