All Projects → bizzyman → LSP-Symbol-Outline

bizzyman / LSP-Symbol-Outline

Licence: other
A tree like view for symbols in Emacs using the Language Server Protocol.

Programming Languages

emacs lisp
2029 projects

Labels

Projects that are alternatives of or similar to LSP-Symbol-Outline

LIPs
LUKSO Improvement Proposals. Repository for the LUKSO Blockchain Improvement Proposals (LIPs) and LUKSO Standards Process (LSP).
Stars: ✭ 39 (+5.41%)
Mutual labels:  lsp
lsp-origami
lsp-mode ❤️ origami.el
Stars: ✭ 33 (-10.81%)
Mutual labels:  lsp
LuaHelper
LuaHelper is a High-performance lua VSCode plugin, Language Server Protocol for lua.
Stars: ✭ 170 (+359.46%)
Mutual labels:  lsp
fzf-lsp.nvim
Enable the power of fzf fuzzy search for the neovim built in lsp
Stars: ✭ 143 (+286.49%)
Mutual labels:  lsp
lspactions
handlers for required lsp actions
Stars: ✭ 44 (+18.92%)
Mutual labels:  lsp
ltex-ls
LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others
Stars: ✭ 182 (+391.89%)
Mutual labels:  lsp
lua-analyzer
A language server for lua written in rust
Stars: ✭ 56 (+51.35%)
Mutual labels:  lsp
camel-language-server
The Apache Camel LSP server implementation
Stars: ✭ 31 (-16.22%)
Mutual labels:  lsp
ide-go
Go language support for Atom-IDE, powered by Sourcegraph's Go Language Server
Stars: ✭ 39 (+5.41%)
Mutual labels:  lsp
lsp-fastaction.nvim
lsp codeaction UI for neovim
Stars: ✭ 39 (+5.41%)
Mutual labels:  lsp
coc-ccls
CCLS (C/C++) extension for coc.nvim
Stars: ✭ 20 (-45.95%)
Mutual labels:  lsp
lsp signature.nvim
LSP signature hint as you type
Stars: ✭ 915 (+2372.97%)
Mutual labels:  lsp
aurora
24-bit dark theme for (Neo)vim. Optimized for treesitter, LSP.
Stars: ✭ 141 (+281.08%)
Mutual labels:  lsp
ansible-language-server
Ansible Language Server
Stars: ✭ 114 (+208.11%)
Mutual labels:  lsp
lsp-grammarly
lsp-mode ❤️ grammarly
Stars: ✭ 81 (+118.92%)
Mutual labels:  lsp
vscode-tenkawa-php
Visual Studio Code extension integrating Tenkawa PHP language server.
Stars: ✭ 28 (-24.32%)
Mutual labels:  lsp
coc-tailwind-intellisense
Coc.nvim extension for Tailwind CSS IntelliSense
Stars: ✭ 117 (+216.22%)
Mutual labels:  lsp
null-ls.nvim
Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
Stars: ✭ 965 (+2508.11%)
Mutual labels:  lsp
toy-language-server
Example language server (LSP) implementation for a toy language
Stars: ✭ 54 (+45.95%)
Mutual labels:  lsp
lsp-wl
A Wolfram Language Server
Stars: ✭ 157 (+324.32%)
Mutual labels:  lsp

LSP Symbol Outline

A tree like view for symbols in Emacs using the Language Server Protocol. Currently works with Javascript, Python, C/C++, PHP, Go, Rust and Java.

LSP-Symbol-outline-sorted

WARNING

This is both my first ever emacs package and an extremely early version of this package so be warned! It will have many bugs (which are welcome to be reported).

Dependencies

My goal is to publish this on melpa some day which will auto-install dependencies, however for now you must have these packages installed:

  • lsp-mode
  • outline-magic
  • s
  • dash

(optionally, install for languages you use)

  • lsp-java
  • lsp-rust
  • lsp-go
  • lsp-python
  • lsp-php
  • lsp-javascript-typescript
  • tern (for func arguments)
  • cquery/ccls

Install instructions

Add this project to your load path and either require or use-package.

In order to get the pretty symbol glyphs you must install the font 'atomicons.ttf' from this repo.

You must have lsp-mode installed and the required servers for the language you want to use. E.g. for javascript install https://github.com/emacs-lsp/lsp-javascript and https://github.com/sourcegraph/javascript-typescript-langserver

You must also enable LSP when opening buffers in which you want to use the symbol outline. For example, add

(require 'lsp-javascript-typescript)
(add-hook 'js2-mode-hook #'lsp-javascript-typescript-enable)

Javascript special instructions: You must have the tern package installed and a .tern-project file in the root of your project. You must have the tern package enabled.

Usage

Bind one of the following functions, or call from M-::
(lsp-symbol-outline-make-outline-python)
(lsp-symbol-outline-make-outline-js)
(lsp-symbol-outline-make-outline-java)
(lsp-symbol-outline-make-outline-C)
(lsp-symbol-outline-make-outline-rust)
(lsp-symbol-outline-make-outline-php)
(lsp-symbol-outline-make-outline-go)

OR use the following convenience function:

(defun lsp-symbol-outline-create-conditional ()
    (interactive)
    (cond ((equal major-mode 'python-mode)
           (lsp-symbol-outline-make-outline-python))
          ((equal major-mode 'go-mode)
           (lsp-symbol-outline-make-outline-go))
          ((equal major-mode 'php-mode)
           (lsp-symbol-outline-make-outline-php))
          ((equal major-mode 'rust-mode)
           (lsp-symbol-outline-make-outline-rust))
          ((or (equal major-mode 'c-mode)
                (equal major-mode 'c++-mode))
           (lsp-symbol-outline-make-outline-C))
          ((or (equal major-mode 'js2-mode)
               (equal major-mode 'js-mode)
               (equal major-mode 'typescript-mode))
           (lsp-symbol-outline-make-outline-js))
          ((equal major-mode 'java-mode)
           (lsp-symbol-outline-make-outline-java))))

Underlined symbols have documentation.

Key Bindings

emacs

  • C-n move down
  • C-p move up
  • TAB hide all sublevels
  • BACKTAB show all sublevels
  • f fold sublevel
  • q kill window
  • M-< go to top
  • M-> go to bottom
  • o go to symbol in document lose focus
  • i cycle argument visibility
  • C-M-u go up scope
  • M-p go up sibling
  • M-n go down sibling
  • w widen to widest column
  • s toggle sorted view (sorts by symbol category)
  • l peek symbol (goes to location in document, but does not lose focus)
  • d show documentation string if available
  • m mark (select) the symbol name at point
  • h show help message

evil

  • j move down
  • k move up
  • TAB hide all sublevels
  • BACKTAB show all sublevels
  • f fold sublevel
  • q kill window
  • gg go to top
  • G go to bottom
  • o go to symbol in document lose focus
  • i cycle argument visibility
  • gh go up scope
  • gk go up sibling
  • gj go down sibling
  • w widen to widest column
  • s toggle sorted view (sorts by symbol category)
  • l peek symbol (goes to location in document, but does not lose focus)
  • d show documentation string if available
  • m mark (select) the symbol name at point
  • h show help message

Notes on current state of this package, lsp and bugs

As mentioned at the beginning, this is an early stage package which will undergo many changes in the future. The next priority is to structure this package properly and minimize dependencies.

LSP

Currently this package uses Microsoft's Language Server Protocol features and the various implementations. As this is not yet a mature project, this means there will be bugs with this package as well. One I came across many times is having more than one project open at the same time causes the server to fail. Reopening the file usually fixes this.

Furthermore, features to this package will track LSP features. One that is on the horizon currently is real implementation of a symbol hierarchy which will enable a more precise tree structure for this package. Please follow the following issues: https://github.com/Microsoft/language-server-protocol/issues/136 https://github.com/Microsoft/language-server-protocol/issues/327 https://github.com/Microsoft/vscode/issues/34968 .

Known Bugs

Why are the function arguments in JS modes missing?
This seems to be related to tern. It seems to get confused when more than one file from different projects are opened simultaneously, or after a long idle period. Try reverting the buffer.

Why is symbol X missing from the outline?
This package relies on the symbols returned by the LSP "textDocument/documentSymbol" method, as such, it has no control over the symbols that get displayed in the outline tree. Therefore, missing symbols that you think should have been included should be reported upstream to the relevant language server.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].