Lsp-mode: [Feature] make our breadcrumb better than vscode's one

Created on 19 Jun 2020  路  9Comments  路  Source: emacs-lsp/lsp-mode

Few ideas discussed offline with @ericdallo

  1. ~Include the project path (like vscode)~ https://github.com/emacs-lsp/lsp-mode/pull/1901
  2. Allow clicking on each node and browsing the current level (like vscode).
  3. ~Allow going to each segment with a prefix e. g. C-3 M-x lsp-breadcrumb-open will go to the third element in the breadcrumb (unique)~ https://github.com/emacs-lsp/lsp-mode/pull/1901
  4. Allow going to each element via avy (unique)
  5. We might also mark the elements with errors like vscode does. The same goes for folders as well. If we decide to implement that we should be careful with the performance.
  6. Implement some kind of strategy to make the paths shorter when it is more than a particular length. The priority should be symbol data, file name, project, path. (we start truncating from the path).
  7. Middle-click on file name should reset narrowing.
discussion enhancement good-first-issue help wanted

Most helpful comment

It's not deprecated, but it may be a bit coupled to Semantic. We can get ideas from it. For example, I like the idea of copying or narrowing to function. Narrowing from the breadcrumb may be more useful than what VSCode offers. You could focus on only one function, perform search and replace locally, or even undo only in that particular function.

All 9 comments

Maybe We could make use of header-lines

@wpchou we currently use header-line-format to build the LSP headerline already :)

Some additional ideas we could implement from old Emacs Semantic: https://www.gnu.org/software/emacs/manual/html_node/semantic/Sticky-Func-Mode.html

@danielmartin Yeah, this mode seems really nice for our use case, can we use it or is it deprecated?

It's not deprecated, but it may be a bit coupled to Semantic. We can get ideas from it. For example, I like the idea of copying or narrowing to function. Narrowing from the breadcrumb may be more useful than what VSCode offers. You could focus on only one function, perform search and replace locally, or even undo only in that particular function.

I think that middle-click on the file name should reset the narrowing.

I updated the issue description with the current status on master

  1. We might also mark the elements with errors like vscode does. The same goes for folders as well. If we decide to implement that we should be careful with the performance.
  1. Implement some kind of strategy to make the paths shorter when it is more than a particular length. The priority should be symbol data, file name, project, path. (we start truncating from the path).
Was this page helpful?
0 / 5 - 0 ratings

Related issues

cprussin picture cprussin  路  3Comments

alanz picture alanz  路  6Comments

mcraveiro picture mcraveiro  路  3Comments

dchneric picture dchneric  路  3Comments

sid-kap picture sid-kap  路  5Comments