Skip to content

Conversation

ericdallo
Copy link
Member

@ericdallo ericdallo commented Jul 12, 2020

Improves on our current breadcrumb following some ideas from #1899:

  • Add project path on breadcrumb (like vscode), currently without any mouse support/action
  • Add mouse support for document symbols
  • Add function to go to symbol and function to narrow via prefix args: C-3 M-x lsp-breadcrumb-go-to-symbol

image

@ericdallo ericdallo self-assigned this Jul 12, 2020
@ericdallo ericdallo added this to the Next release milestone Jul 12, 2020
@ericdallo ericdallo requested a review from yyoncho July 12, 2020 00:50
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))
Copy link
Member

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

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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))
Copy link
Member

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.

@ericdallo ericdallo requested review from kiennq and yyoncho July 12, 2020 14:46
@yyoncho
Copy link
Member

yyoncho commented Jul 12, 2020

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.

@ericdallo
Copy link
Member Author

@yyoncho it is displaying the file name but without the extension, I'll fix it

@ericdallo
Copy link
Member Author

I don't know for sure how to get the icon from the filename, I'll take a look into helm-icons

@ericdallo ericdallo force-pushed the headerline-breadcrumb-2 branch from e41d27d to 79ea46d Compare July 12, 2020 19:10
@yyoncho
Copy link
Member

yyoncho commented Jul 12, 2020

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.

@ericdallo
Copy link
Member Author

I see... it looks to be a good idea to implement on next, we can keep discussing on the linked issue

@ericdallo
Copy link
Member Author

I'll merge this and implement the icons on a next PR too.

@ericdallo ericdallo merged commit 5ef8c1f into master Jul 12, 2020
@ericdallo ericdallo deleted the headerline-breadcrumb-2 branch July 12, 2020 19:33
@yyoncho
Copy link
Member

yyoncho commented Jul 12, 2020

And one more thing - we should have a flag to turn off the path and keep only symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants