Giter Site home page Giter Site logo

dradtke / vim-dap Goto Github PK

View Code? Open in Web Editor NEW
48.0 3.0 0.0 43.76 MB

Vim/Neovim debugger plugin providing a terminal interface to the Debug Adapter Protocol

Shell 1.46% Go 11.63% Makefile 0.13% Java 19.72% Lua 0.58% Vim Script 66.48%
vim debugger vim-plugin debug-adapter-protocol neovim neovim-plugin

vim-dap's Introduction

vim-dap

vim-dap is a Vim plugin for integrating with the Debug Adapter Protocol. to provide full debugger functionality for Vim. Unlike other debugger plugins, it doesn't attempt to replicate the user interface of an IDE; instead, interaction with the debugger happens in the terminal, through a fully readline-enabled debugger console:

Neovim's LSP API appears to still be in flux, so if something isn't working, the first thing to try would be to upgrade to the latest Neovim release.

demo

Supported Languages

This plugin is intended to be as configuration-free as possible, but this section will detail existing language support and their requirements.

Java

Java requires you to be running the eclipse.jdt.ls language server with java-debug installed. The dap#run() method requires you to be using either Neovim with native LSP support, vim-lsp or LanguageClient-neovim as your client, but dap#connect() can be called manually to connect to the debug adapter if it's already running.

In order to run the language server with debug support, you will need to initialize the server with the path of the debug jar bundle. An example using settings.json:

{
  "initializationOptions": {
    "bundles": ["/path/to/java-debug.jar"]
  }
}

You will also need to add all of the jars included in the server extension for vscode-java-test. The easiest way to do that is to download it from the VSCode Marketplace:

https://vscjava.gallery.vsassets.io/_apis/public/gallery/publisher/vscjava/extension/vscode-java-test/${version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage

Debugger Settings

The debug settings can be customized by defining either a .vim/launch.json or .vscode/launch.json file, i.e.

{
  "javaHome": "/usr/lib/jvm/java-11-openjdk-amd64"
}

Tips

To make it easier to run Java tests, I recommend adding something like this to your .vimrc. With this in place, you can use \rb to run all tests in the current file, \rf to only run the test which your cursor is in, and \rl to re-run the most recent test.

au filetype java nmap <Leader>rb :call dap#lang#java#run_test_class()<cr>
au filetype java nmap <Leader>rf :call dap#lang#java#run_test_method()<cr>
au filetype java nmap <Leader>rl :call dap#run_last()<cr>

Go

First, make sure that you have Delve installed and that dlv is available on your PATH.

Second, the debug adapter for Go is implemented as part of vscode-go, so your system must have Node available in order for it to run (womp womp). It will be automatically downloaded on first use.

vim-dap's People

Contributors

dradtke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.