Skip to content

Commit

Permalink
Remove eglot require
Browse files Browse the repository at this point in the history
  • Loading branch information
svaante committed Dec 10, 2024
1 parent fdcbf66 commit 6052196
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions dape.el
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@
(require 'comint)
(require 'repeat)
(require 'compile)
(require 'tree-widget)
(require 'project)
(require 'gdb-mi)
(require 'hexl)
(require 'tramp)
(require 'jsonrpc)
(require 'eglot) ;; jdtls config


;;; Obsolete aliases
Expand Down Expand Up @@ -368,9 +366,9 @@
ensure (lambda (config)
(let ((file (dape-config-get config :filePath)))
(unless (and (stringp file) (file-exists-p file))
(user-error "Unable to find locate :filePath `%s'" file))
(user-error "Unable to locate :filePath `%s'" file))
(with-current-buffer (find-file-noselect file)
(unless (eglot-current-server)
(unless (and (featurep 'eglot) (eglot-current-server))
(user-error "No eglot instance active in buffer %s" (current-buffer)))
(unless (seq-contains-p (eglot--server-capable :executeCommandProvider :commands)
"vscode.java.resolveClasspath")
Expand All @@ -394,10 +392,12 @@
,@(cl-flet ((resolve-main-class (key)
(ignore-errors
(let* ((main-classes
(eglot-execute-command (eglot-current-server)
"vscode.java.resolveMainClass"
(file-name-nondirectory
(directory-file-name (dape-cwd)))))
(with-no-warnings
(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)
Expand All @@ -410,11 +410,9 @@
(or (resolve-main-class :filePath)
(expand-file-name (dape-buffer-default) (dape-cwd))))
:mainClass
,(lambda ()
(or (resolve-main-class :mainClass) ""))
,(lambda () (resolve-main-class :mainClass))
:projectName
,(lambda ()
(or (resolve-main-class :projectName) ""))))
,(lambda () (resolve-main-class :projectName))))
:args ""
:stopOnEntry nil
:type "java"
Expand Down

0 comments on commit 6052196

Please sign in to comment.