Emacs LSP and DAP

5 min readFeb 27, 2021

LSP and DAP for Python, Golang, Rust and Typescript/Javascript.

Emacs LSP and DAP


In previous article I developed a configuration for Emacs beginner. In this article let’s continue to set up LSP (Language Server Protocol) and DAP (Debug Adapter Protocol). Particularly the languages that I will focus on are Python, Golang, Rust and Typescript.

Language Servers Installation

I am going to use the same language servers in my earlier article on setting up Neovim LSP using Lua.


For Python, let’s install pyright.

$ npm install -g pyright


For Golang, let’s install gopls.

$ GO111MODULE=on go get golang.org/x/tools/gopls@latest


For Rust, let’s use rust_analyzer. The easiest way to install is to download the binary, copy to a folder, and add the folder to environment PATH.


For Typescript, let’s install typescript-language-server.

$ npm install -g typescript-language-server$ npm install -g typescript

lsp-mode and dap-mode

I am going to use lsp-mode and dap-mode for Emacs.

Create a file called lang.el under the elisp folder with the following content.

Besides lsp-mode, I installed dap-mode, dap-node, dap-gdb-lldb, and dap-go in this package.

In init.el, require this package.

(require 'lang)   ;; base extensions

Python LSP and DAP




Software engineer, Data Science and ML practitioner.