/lsp-treemacs

lsp-mode :heart: treemacs

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

Table of Contents

Summary

Integration between lsp-mode and treemacs and implementation of treeview controls using treemacs as a tree renderer.

Synchronization

To enable bidirectional synchronization of lsp workspace folders and treemacs projects.

(lsp-treemacs-sync-mode 1)

Views

lsp-treemacs-errors-list

Displays tree like error list structure.

Commands

Screenshot

screenshots/error-list.png

  • lsp-treemacs-quick-fix or press x when you are in Error List view - offer quickfixes for the error at point.

lsp-treemacs-symbols-list

Displays symbols information.

Screenshot

screenshots/symbols-list.gif

lsp-treemacs-references/lsp-treemacs-implementaions

Display references/implementations using tree view:

Screenshot

screenshots/references.gif

lsp-treemacs-deps-list

Browse java dependencies, namespaces, files, etc.

Commands

  • lsp-treemacs-java-deps-follow - select the current editor in the dependency
  • lsp-treemacs-java-deps-refresh - refresh the view. Bound to r.

Screenshot

screenshots/dependencies.gif

lsp-metals-treeview

Support for Scala Metals treeview. The treeview is disabled by default in order to enable the treeview use one of the following configuration approaches. If you are using use-package:

(use-package lsp-treemacs
  :config
  (lsp-metals-treeview-enable t)
  (setq lsp-metals-treeview-show-when-views-received t))

lsp-metals-treeview-show-when-views-received when true will automatically display the treeview when Metals has initialised the project and sent the initial top level treeview information. If you wish to keep the tree hidden and show it explicitly via a command or a bound key leave the variable false (default) and show the treeview using M-x lsp-metals-treeview.

Alternatively if you’re not using use-package:

(require 'lsp-metals-treeview)
(lsp-metals-treeview-enable t)
(setq lsp-metals-treeview-show-when-views-received t)

The metals can be displayed at anytime by using M-x lsp-metals-treeview.

To enable logging of metals treeview actions/responses use the variable lsp-metals-treeview-logging (boolean). All messages will be logged to the lsp logging buffer.

Commands

q - when the treeview has focus it can be hidden using the q key. To show the tree use M-x lsp-metals-treeview or bind this function to a key.

lsp-shutdown-workspace will automatically close the treeview associated with the current file buffer.

When switching files the treeview will switch to the treeview associated with the new workspace.

Screenshot

screenshots/metals-treeview.gif