svaante / dape

Debug Adapter Protocol for Emacs
GNU General Public License v3.0
448 stars 25 forks source link

Prefer the current file when having multiple Java main classes #83

Closed papadakis-k closed 5 months ago

papadakis-k commented 5 months ago

Fixes #82

svaante commented 5 months ago

Nice work and change makes sense.

How is your FSF status? (see Contribute in README)

Your contribution is not legally significant contribution.

So if you do not plan to contribute I just need you to https://github.com/svaante/dape/pull/5#issuecomment-1872517008

papadakis-k commented 5 months ago

Hello. Thanks for reviewing. I have added the comment in the new commit. Please let me know if there is any other issue.

svaante commented 5 months ago

Hey the formatting seams a bit off how about

                     (let* ((main-classes
                             (eglot-execute-command (eglot-current-server)
                                                    "vscode.java.resolveMainClass"
                                        (file-name-nondirectory
                                                     (directory-file-name (dape-cwd)))))
                            (main-class
                             (or (seq-find (lambda(val)
                                             (equal (plist-get val :filePath)
                                                    (buffer-file-name)))
                                           main-classes)
                                 (aref main-classes 0))))
papadakis-k commented 5 months ago

Sure, that's how I prefer it too. I have updated it.