-
-
Notifications
You must be signed in to change notification settings - Fork 938
Improve breadcrumb #1899
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
Improve breadcrumb #1899
Conversation
lsp-mode.el
Outdated
"Find recursively the folders until the project ROOT-PATH. | ||
PATH is the current folder to be checked." | ||
(let ((cur-path (list (f-base path)))) | ||
(if (f-same? root-path (f-parent path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lsp-f-same?
, unless you want to follow the file symlink
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, will this function to be called frequently? Following the symlink is quite slow. So you may want to rewrite f-parent
so it's not using f-same?
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be called pretty much on post-command hook so we have to make it very fast/lightweight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, implemented lsp-f-parent
lsp-mode.el
Outdated
"Find recursively the folders until the project ROOT-PATH. | ||
PATH is the current folder to be checked." | ||
(let ((cur-path (list (f-base path)))) | ||
(if (f-same? root-path (f-parent path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be called pretty much on post-command hook so we have to make it very fast/lightweight.
Seems like the file name is missing on the screenshot? Is that the case? Can you add the filename icons as well? You may use helm-icons package as inspiration. |
@yyoncho it is displaying the file name but without the extension, I'll fix it |
I don't know for sure how to get the icon from the filename, I'll take a look into helm-icons |
e41d27d
to
79ea46d
Compare
Looks good! IMO we might also introduce an option to narrow deeply nested paths(e. g. use only first letters of the directories) when the path is longer. I am not 100% how jump should work - e. g. do we need to add a command to jump into directories, e. g. M-2 M-x lsp-breadcrump-jump-dir to jump in the root or we should have one command for jumping and threat files + symbols as one three. |
I see... it looks to be a good idea to implement on next, we can keep discussing on the linked issue |
I'll merge this and implement the icons on a next PR too. |
And one more thing - we should have a flag to turn off the path and keep only symbols. |
Improves on our current breadcrumb following some ideas from #1899:
C-3 M-x lsp-breadcrumb-go-to-symbol