Skip to content

cl-no-applicable-method jsonrpc-convert-to-endpoint #<eglot-java-eclipse-jdt #61

@filipencopav

Description

@filipencopav

NixOS, Emacs 30.1, default eglot with just eglot-java installed. Gives this error:

(cl-no-applicable-method jsonrpc-convert-to-endpoint #<eglot-java-eclipse-jdt eglot-java-eclipse-jdt-1437e468> (:id 1 :method "initialize" :params (:processId 17026 :clientInfo (:name "Eglot" :version "1.18") :rootPath "/home/pavel/devel/java/realworld/" :rootUri "file:///home/pavel/devel/java/realworld" :initializationOptions (:extendedClientCapabilities (:classFileContentsSupport t) :workspaceFolders ["file:///home/pavel/devel/java/realworld"] :settings (:java (:home "/nix/store/mzzw1csv750bj3c2k0kbcc08pq58ah2q-openjdk-24.0.2+12") :import (:gradle (:enabled t) :wrapper (:enabled t)))) :capabilities (:workspace (:applyEdit t :executeCommand (:dynamicRegistration :json-false) :workspaceEdit (:documentChanges t) :didChangeWatchedFiles (:dynamicRegistration t) :symbol (:dynamicRegistration :json-false) :configuration t :workspaceFolders t) :textDocument (:synchronization (:dynamicRegistration :json-false :willSave t :willSaveWaitUntil t :didSave t) :completion (:dynamicRegistration :json-false :completionItem (:snippetSupport t :deprecatedSupport t :resolveSupport (:properties ...) :tagSupport (:valueSet ...) :insertReplaceSupport t) :contextSupport t) :hover (:dynamicRegistration :json-false :contentFormat ["markdown" "plaintext"]) :signatureHelp (:dynamicRegistration :json-false :signatureInformation (:parameterInformation (:labelOffsetSupport t) :documentationFormat ["markdown" "plaintext"] :activeParameterSupport t)) :references (:dynamicRegistration :json-false) :definition (:dynamicRegistration :json-false :linkSupport t) :declaration (:dynamicRegistration :json-false :linkSupport t) :implementation (:dynamicRegistration :json-false :linkSupport t) :typeDefinition (:dynamicRegistration :json-false :linkSupport t) :documentSymbol (:dynamicRegistration :json-false :hierarchicalDocumentSymbolSupport t :symbolKind (:valueSet [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26])) :documentHighlight (:dynamicRegistration :json-false) :codeAction (:dynamicRegistration :json-false :resolveSupport (:properties ["edit" "command"]) :dataSupport t :codeActionLiteralSupport (:codeActionKind (:valueSet ...)) :isPreferredSupport t) :formatting (:dynamicRegistration :json-false) :rangeFormatting (:dynamicRegistration :json-false) :rename (:dynamicRegistration :json-false) :inlayHint (:dynamicRegistration :json-false) :publishDiagnostics (:relatedInformation :json-false :codeDescriptionSupport :json-false :tagSupport (:valueSet [1 2]))) :window (:showDocument (:support t) :workDoneProgress :json-false) :general (:positionEncodings ["utf-32" "utf-8" "utf-16"]) :experimental #<hash-table eql 0/0 0x14736212 ...>) :workspaceFolders [(:uri "file:///home/pavel/devel/java/realworld" :name "~/devel/java/realworld/")])) request)

If I do M-x RET load-library RET jsonrpc RET and then try to launch eglot again, it does not show this error anymore.

When I launch with emacs -Q and then package-install eglot-java, it works (though it doesn't see String but that's probably a separate issue).

What do? It doesn't have this behavior with other LSPs, only with Java's. Also, without eglot-java at all the same issue still happens.

Here's my config:

Eglot:

  (leaf eglot
    :elpaca nil
    :require (t jsonrpc) ;; added this after finding out that `load-library` fix from above, still doesn't fix it though
    :config
    (defun p/eglot-hooks ()
      (when (eglot-managed-p)
        (add-hook 'before-save-hook 'eglot-format nil t)))
    (add-hook 'eglot-managed-mode-hook 'p/eglot-hooks))

Eglot + Java:

  (leaf eglot-java
    :after (eglot))

  (leaf java-ts-mode
    :elpaca nil
    :after (eglot)
    :hook (java-ts-mode-hook . eglot-ensure)
    :config
    (add-to-list 'major-mode-remap-alist '(java-mode . java-ts-mode))

    (p/add-hooks
     (java-ts-mode-hook
      (auto-fill-mode)
      (flymake-mode)
      (subword-mode)
      (yas-minor-mode)
      (when window-system
        (set-fringe-style '(8 . 0)))

      ;; Fix indentation for anonymous classes
      (c-set-offset 'substatement-open 0)
      (if (assoc 'inexpr-class c-offsets-alist)
          (c-set-offset 'inexpr-class 0))

      ;; Indent arguments on the next line as indented body.
      (c-set-offset 'arglist-intro '++)))

    (defun project-find-pom-xml (dir)
      (when-let ((root (locate-dominating-file dir "pom.xml")))
        (cons 'pom-xml root)))
    (cl-defmethod project-root ((project (head pom-xml)))
      (cdr project))
    (add-hook 'project-find-functions #'project-find-pom-xml)

    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions