Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unhandled method textDocument/d\ ocumentSymbol" #9

Open
swarnendubiswas opened this issue Jun 18, 2023 · 5 comments
Open

"Unhandled method textDocument/d\ ocumentSymbol" #9

swarnendubiswas opened this issue Jun 18, 2023 · 5 comments

Comments

@swarnendubiswas
Copy link

I get the following error with imenu when using say markdown or org files.

progn: jsonrpc-error: "request id=2 failed:", (jsonrpc-error-code . -32601), (jsonrpc-error-message . "Unhandled method textDocument/d\
ocumentSymbol"), (jsonrpc-error-data)

Here is an MWE to help reproduce the error. I have Emacs 28.2 and server version 0.2.1

(setq straight-build-dir (format "build/%d%s%d"
                                 emacs-major-version
                                 version-separator
                                 emacs-minor-version)
      straight-use-package-by-default t)

(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 6))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(setq use-package-hook-name-suffix nil)
(straight-use-package 'use-package)

(use-package eglot
  :config
  (setq eglot-ignored-server-capabilities
    '
    (:codeLensProvider
      :executeCommandProvider
      :hoverProvider ; Automatic documentation popups can be distracting
      :foldingRangeProvider
      :documentOnTypeFormattingProvider
      :documentLinkProvider
      :documentHighlightProvider
      ;; Inlay hints are distracting
      :inlayHintProvider)))

(use-package eglot-grammarly
  :straight (:host github :repo "emacs-grammarly/eglot-grammarly")
  :hook
  (text-mode-hook . (lambda ()
      (require 'eglot-grammarly)
      (eglot-ensure))))
@jcs090218
Copy link
Member

I don' think the language server supports textDocument/documentSymbol. 🤔

@swarnendubiswas
Copy link
Author

Right. Can we not default to regular imenu in such cases? That would still work with Org and Markdown files.

@jcs090218
Copy link
Member

Right. Can we not default to regular imenu in such cases? That would still work with Org and Markdown files.

I think this should report to eglot, and not here. 🤔

@swarnendubiswas
Copy link
Author

Okay, but the eglot package so far does not need to deal with such servers. That is why I reported this here. I do not get this error with eglot-ltex.

@jcs090218
Copy link
Member

Okay, but the eglot package so far does not need to deal with such servers. That is why I reported this here.

We're in a dilemma. One is upstream language server doesn't want to deal with it (I don't think it's their responsibility). The other one is the client implementation doesn't want to deal with it (eglot). Then there is no solution from my end (eglot-ltex). 🤔 In addition, the author of eglot has a strong opinion of his own taste. If he doesn't want to support this package or grammarly-language-server (this includes all language servers that do the same thing), we are out of luck.

Another solution is lsp-grammarly; and I never had this issue with lsp-mode.

I do not get this error with eglot-ltex.

Yes, cuz the upstream doesn't use that protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants