Comments (8)
Thanks for the reply! I've been looking into the issue and it turns out that it the error indeed was with nvim-dap and the way it handles thread execution. Here is the link to the discussion and fix for the problem. Although, there still might be some issues regarding two stopped events for the same thread without any continue/step in-between - see this comment
Here is a gist showing full logs between nvim-dap end Kotlin Debug Adapter.
I am also experiencing some issues with the spring boot projects. Using a spring-boot-kotlin demo, the Debugger seems to have problems with dependency resolutions. Here is the output I get when trying to set breakpoints and debug:
[INFO] main Connected to client
[INFO] async1 Found mvn at /home/nela/.local/share/asdf/shims/mvn
[INFO] async1 Run [/home/nela/.local/share/asdf/shims/mvn, dependency:list, -DincludeScope=test, -DoutputFile=/tmp/deps15176148338603586867.txt, -Dstyle.color=never] in /home/nela/projects/kotlin-tutorials/spring-boot-kotlin
[INFO] async1 Run [/home/nela/.local/share/asdf/shims/mvn, dependency:sources, -DincludeScope=test, -DoutputFile=/tmp/sources2061694013933146372.txt, -Dstyle.color=never] in /home/nela/projects/kotlin-tutorials/spring-boot-kotlin
[WARN] async1 Couldn't find io.netty:netty-transport-native-epoll:4.1.34.Final in /home/nela/.m2/repository/io/netty/netty-transport-native-epoll/4.1.34.Final/netty-transport-native-epoll-4.1.34.Final.jar
[INFO] async1 Run [/home/nela/.local/share/asdf/shims/mvn, dependency:list, -DincludeScope=test, -DoutputFile=/tmp/deps3469807033879373704.txt, -Dstyle.color=never] in /home/nela/projects/kotlin-tutorials/spring-boot-kotlin
[INFO] async1 Found 120 artifacts in /home/nela/projects/kotlin-tutorials/spring-boot-kotlin/pom.xml
[WARN] async1 Couldn't find io.netty:netty-transport-native-epoll:4.1.34.Final in /home/nela/.m2/repository/io/netty/netty-transport-native-epoll/4.1.34.Final/netty-transport-native-epoll-4.1.34.Final.jar
[INFO] async1 Starting JVM debug session with main class com.baeldung.springbootkotlin.KotlinDemoApplication
Error: Main method not found in class com.baeldung.springbootkotlin.KotlinDemoApplication, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
[INFO] eventBus Sent exit event
I find it strange that warnings for not finding libs is issued, because they do exists on the specified path. I assume this has something to do with setting the mainClass in spring boot projects. Any advice on how to approach this?
from kotlin-debug-adapter.
Was the application built before debugging? I have gotten some weird errors if not building, or if build is older.
from kotlin-debug-adapter.
Yep, the application(s) build and run successfully.
$ ./gradlew build
BUILD SUCCESSFUL in 1s
8 actionable tasks: 8 up-to-date
Also built and run prior to running debugger.
from kotlin-debug-adapter.
Would it be possible for you to log the request/responses (json objects) of the debug adapter to file? (in Emacs I can do this with dap-print-io
, but unsure about the various vim-variants). Might be that the neovim plugin sends data in a way that confuses the language server or something :/ Would be easier to look for possible issues in that regard if I could see the request/responses. Larger chunks of the logs might also help if you could upload that :)
Tried cloning the quickstart project now, and was able to use it without issues in Emacs. The arguments you have supplied seems to be the same as I used when setting up the dap-kotlin setup in Emacs (might be worth a look for inspiration in case I have overlooked something above).
from kotlin-debug-adapter.
@nela , Have you named the class with @JvmName
? If not I would guess that you could add Kt
to the end of the name to make it work. Something like com.baeldung.springbootkotlin.KotlinDemoApplicationKt
. The Kotlin compiler adds Kt to the filenames when generating classes.
from kotlin-debug-adapter.
The issue must have been the improper mainClass configuration. Anyhow, my initial issue was resolved as stated above so I'll go ahead and close this. Thanks for the help!
from kotlin-debug-adapter.
@nela i also had issues with the auto_continue_if_many and dependency injections. keen to understand if you were able to effectively write and debug in neovim on these more complex projects. how did it go?
from kotlin-debug-adapter.
@mairs8 I've managed to get it working with this config, although it's been some time since I've used it so some tweaking might be necessary. I did use it for a short time, however, it kept bothering me that it data was shown in a Java context, rather than Kotlin context. Ultimately, I had to switch to IntelliJ due to the performance difficulties of Kotlin LSP and DAP.
from kotlin-debug-adapter.
Related Issues (20)
- Unable to attach debugger to a unit test HOT 1
- Problems using within gradle project
- Support variable presentation hints, e.g. for lazy evaluation of values
- Ability to debug a Kotlin program (JVM, not Native), without gradle or maven HOT 1
- Cannot Debug Quarkus Kotlin project HOT 2
- How to debug kotlin-debug-adapter
- Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication HOT 3
- Fix issues with the shared module dependency and update it HOT 4
- [Discussion] Instruction on developing new feature on the debug adapter
- Improve source root resolving for multi-module projects
- Gradle dependencies could not be resolved [Kotlin VS Code Extension] HOT 4
- Gradle runtimeOnly dependencies not in classpath HOT 1
- Resolving dependencies not working -> Gradle fails with "configuration linuxCompileClasspath not found" HOT 1
- Debugging unit tests HOT 1
- Fields from outer class not shown, only inner fields
- Can I use this to debug android project?
- Kotlin debug doesn't stop at Clikt subcommand
- VSCode Debug Console not evaluating expressions HOT 1
- Custom Kotlin Script definition can't be debugged
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotlin-debug-adapter.