-
-
Notifications
You must be signed in to change notification settings - Fork 38
DAP support kotlin
Zeioth edited this page Aug 28, 2023
·
2 revisions
Nothing special needs to be done for kotlin.
Please note that this section has nothing to do with compiler.nvim. I'm documenting this to make your life easier. To debug kotlin with DAP you have to:
- Install
kotlin-debug-adapter
using Mason. - Setup DAP for kotlin.
Here you have an example of how to configure DAP for Kotlin
-- Kotlin
-- Kotlin projects have very weak project structure conventions.
-- You must manually specify what the project root and main class are.
dap.adapters.kotlin = {
type = 'executable';
command = vim.fn.stdpath('data')..'/mason/bin/kotlin-debug-adapter',
}
dap.configurations.kotlin = {
{
type = 'kotlin';
request = 'launch';
name = 'Launch kotlin program';
projectRoot = "${workspaceFolder}/app"; -- ensure this is correct
mainClass = "AppKt"; -- ensure this is correct
};
}
- If you find any issue while configuring DAP, run
:DapSetLogLevel trace
and:DapShowLog
to find the reason.