Giter Site home page Giter Site logo

Comments (8)

nela avatar nela commented on May 29, 2024 1

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.

themkat avatar themkat commented on May 29, 2024

Was the application built before debugging? I have gotten some weird errors if not building, or if build is older.

from kotlin-debug-adapter.

nela avatar nela commented on May 29, 2024

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.

themkat avatar themkat commented on May 29, 2024

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.

themkat avatar themkat commented on May 29, 2024

@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.

nela avatar nela commented on May 29, 2024

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.

mairs8 avatar mairs8 commented on May 29, 2024

@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.

nela avatar nela commented on May 29, 2024

@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)

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.