Coder Social home page Coder Social logo

xbc5 / dapinstall.nvim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pocco81/dap-buddy.nvim

0.0 0.0 0.0 144 KB

๐Ÿฆ† A NeoVim plugin for managing several debuggers for Nvim-dap

License: GNU General Public License v3.0

Lua 93.30% Vim Script 6.70%

dapinstall.nvim's Introduction

๐Ÿฆ† DAPInstall

A NeoVim plugin for managing several debuggers for Nvim-dap

Repository's starts Issues License
Say thanks Latest commit GitHub repository size

Demo


TL;DR

DAPInstall.nvim is a NeoVim plugin written in Lua that extends nvim-dap's functionality for managing various debuggers. Everything from installation, configuration, setup, etc... can be done using DAPInstall.nvim. To get started, install it with your favorite plugin manager and then install the debuggers you'd like to use using the ':DIInstall ' command and [optionally] use their default configs.

๐ŸŒฒ Table of Contents

๐ŸŽ Features

  • (Un)Installs debuggers
  • List installed debuggers
  • Can manage the configuration of every debugger [individually]
  • Supports a wide range of debuggers
  • User-friendly interface

๐Ÿ“บ Notices

Checkout the CHANGELOG.md file for more information on the notices below:

๐Ÿ“ฆ Installation

Prerequisites

Adding the plugin

You can use your favorite plugin manager for this. Here are some examples with the most popular ones:

Vim-plug

Plug 'Pocco81/DAPInstall.nvim'

Packer.nvim

use "Pocco81/DAPInstall.nvim"

Vundle

Plugin 'Pocco81/DAPInstall.nvim'

NeoBundle

NeoBundleFetch 'Pocco81/DAPInstall.nvim'

Setup (configuration)

As it's stated in the TL;DR, there are already some sane defaults that you may like, however you can change them to match your taste. These are the defaults:

installation_path = vim.fn.stdpath("data") .. "/dapinstall/",
verbosely_call_debuggers = false,

The way you setup the settings on your configuration varies on whether you are using vimL for this or Lua.

For init.lua

local dap_install = require("dap-install")

dap_install.setup({
	installation_path = "/tmp/test_dap_install/",
	verbosely_call_debuggers = true,
})

For init.vim

lua << EOF
local dap_install = require("dap-install")

dap_install.setup({
	installation_path = "/tmp/test_dap_install/",
	verbosely_call_debuggers = true,
})
EOF

For instructions on how to configure the plugin, check out the configuration section.

Updating

This depends on your plugin manager. If, for example, you are using Packer.nvim, you can update it with this command:

:PackerUpdate

๐Ÿค– Usage (commands)

All the commands follow the camel casing naming convention and have the DI prefix so that it's easy to remember that they are part of the DAPInstall.nvim plugin. These are all of them:

Default

  • :DIInstall <debugger> installs <debugger>.
  • :DIUninstall <debugger> uninstalls <debugger>.
  • :DIList lists installed debuggers.

๐Ÿฌ Configuration

Although settings already have self-explanatory names, here is where you can find info about each one of them and their classifications!

General

This settings are unrelated to any group and are independent.

  • installation_path: (String) path to where the debuggers will be installed. The only condition is that the path must end with a forward slash ("/")
  • verbosely_call_debuggers: (Boolean) prints a message whenever a debugger that the user it trying to call for configuration isn't installed.

Debuggers

To configure the debuggers DAPInstall.nvim provides the config("<debugger>", {<config>}) function that receives two arguments:

  • <debugger>: the name of the debugger that can be found in the table below.
  • <config>: the configuration of the debugger itself.

In the <config> you must pass a table with at least one of two keys (adapters and/or configurations). Every debugger has its own settings but they all something in common, they either have a adapters = {} table, a configurations = {} table or both. To edit the debuggers' settings in either of those sections just create the key and set the value to whatever you want. Remember that every debugger has its own config that can be found here

Examples:

  1. Will configure the Python debugger with its default values:
local dap_install = require("dap-install")
dap_install.config("python_dbg", {})
  1. Will override some values from the Python debugger:
local dap_install = require("dap-install")
dap_install.config(
	"python_dbg",
    {
        adapters = {
            type = "executable",
            command = "python3.9",
            args = {"-m", "debugpy.adapter"}
        },
        configurations = {
            {
                type = "python",
                request = "launch",
                name = "Launch file",
                program = "${file}",
                pythonPath = function()
                    local cwd = vim.fn.getcwd()
                    if vim.fn.executable(cwd .. "/usr/bin/python3.9") == 1 then
                        return cwd .. "/usr/bin/python3.9"
                    elseif vim.fn.executable(cwd .. "/usr/bin/python3.9") == 1 then
                        return cwd .. "/usr/bin/python3.9"
                    else
                        return "/usr/bin/python3.9"
                    end
                end
            }
        }
    }
)

You could also use a loop to configure every installed debugger like so:

local dap_install = require("dap-install")
local dbg_list = require("dap-install.debuggers_list").debuggers

for debugger, _ in pairs(dbg_list) do
	dap_install.config(debugger, {})
end

List of debuggers

DI. Name Pro. Language Debugger Status
python_dbg Python debugpy Tested
go_dbg Go delve, vscode-go Tested
go_delve_dbg Go delve Tested
php_dbg PHP vscode-php-debug Tested
lua_dbg Lua OSSFV Tested
dart_dbg Dart dart-code Supported
jsnode_dbg JavaScript node-debug2 Supported
dnetcs_dbg .NET, C# netcoredbg Supported
ruby_vsc_dbg Ruby netcoredbg Experimental
ccppr_lldb_dbg C, C++, Rust lldb-vscode Experimental
ccppr_vsc_dbg C, C++, Rust vsc-cpptools Experimental
markdown_dbg Markdown mockdebug Experimental
java_dbg Java java-debug Unsupported
haskell_dbg Haskell haskell-debug-adapter Unsupported
scala_dbg Scala nvim-metals Unsupported
  • Tested: Fully supported
  • Supported: Fully supported, but needs testing.
  • Experimental: Still on the works.
  • Legacy: No longer supported, please migrate your configuration.
  • Retired: No longer included or supported.
  • Unsupported: No implementation whatsoever.

๐Ÿ™‹ FAQ

  • Q: "How can I view the doc from NeoVim?"
  • A: Use :help DAPInstall.nvim

๐Ÿซ‚ Contribute

Pull Requests are welcomed as long as they are properly justified and there are no conflicts. If your PR has something to do with the README or in general related with the documentation, I'll gladly merge it! Also, when writing code for the project you must use the .editorconfig file on your editor so as to "maintain consistent coding styles". For instructions on how to use this file refer to EditorConfig's website.

Need help

This is a list of things I currently need help with:

  1. Testing the installers and reporting back via an issue
  2. Creating the missing installers for the various debuggers
  3. Correcting the installers that are broken

๐Ÿ’ญ Inspirations

The following projects inspired the creation of DAPInstall.nvim. If possible, go check them out to see why they are so amazing :]

๐Ÿ“œ License

DAPInstall.nvim is released under the GPL v3.0 license. It grants open-source permissions for users including:

  • The right to download and run the software freely
  • The right to make changes to the software as desired
  • The right to redistribute copies of the software
  • The right to modify and distribute copies of new versions of the software

For more convoluted language, see the LICENSE file.

๐Ÿ“‹ TO-DO

High Priority

  • Test every debugger

Low Priority

  • None

Enjoy!

dapinstall.nvim's People

Contributors

andersevenrud avatar logeshg5 avatar pocco81 avatar rafcamlet avatar venson 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.