astoff / digestif

A language server for TeX and friends
Other
251 stars 6 forks source link

Using digestif in org mode #41

Closed joshcho closed 2 years ago

joshcho commented 2 years ago

I am trying to run digestif in org-mode (using eglot and company), and I am getting an error message. Not sure which part of the pipeline is the problem. Every time I type a letter, I get the following error message:

Company: An error occurred in auto-begin
Company: backend company-capf error "jsonrpc-error: 
"request id=29 failed:", (jsonrpc-error-code . 1), (jsonrpc-error-message . 
"/home/pollock/.digestif/digestif/langserver.lua:32: 
Trying to access unopened file /home/pollock/Dropbox/chart/roam/20220104135144-
abstract_algebra_by_dummit_and_foote.org"), (jsonrpc-error-data)" with args (prefix)

The toggle-debug gives the following:

Debugger entered--Lisp error: (jsonrpc-error "request id=20 failed:" (jsonrpc-error-code . 1) (jsonrpc-error-message . "/home/pollock/.digestif/digestif/langserver.lua:32...") (jsonrpc-error-data))
  signal(jsonrpc-error ("request id=20 failed:" (jsonrpc-error-code . 1) (jsonrpc-error-message . "/home/pollock/.digestif/digestif/langserver.lua:32...") (jsonrpc-error-data)))
  #<subr jsonrpc-request>(#<eglot-lsp-server eglot-lsp-server-155df8d9b74c> :textDocument/completion (:textDocument (:uri "file:///home/pollock/Dropbox/chart/roam/2022010413...") :position (:line 29 :character 1) :context (:triggerKind 1)) :deferred :textDocument/completion :cancel-on-input t)
  apply(#<subr jsonrpc-request> (#<eglot-lsp-server eglot-lsp-server-155df8d9b74c> :textDocument/completion (:textDocument (:uri "file:///home/pollock/Dropbox/chart/roam/2022010413...") :position (:line 29 :character 1) :context (:triggerKind 1)) :deferred :textDocument/completion :cancel-on-input t))
  jsonrpc-request(#<eglot-lsp-server eglot-lsp-server-155df8d9b74c> :textDocument/completion (:textDocument (:uri "file:///home/pollock/Dropbox/chart/roam/2022010413...") :position (:line 29 :character 1) :context (:triggerKind 1)) :deferred :textDocument/completion :cancel-on-input t)
  #f(compiled-function () #<bytecode 0x1bf8b4b582ec7e78>)()
  #f(compiled-function (probe pred action) #<bytecode -0x1c0566c2c0580068>)("e" nil nil)
  completion--capf-wrapper(eglot-completion-at-point optimist)
  company--capf-data-real()
  company--capf-data()
  company-capf(prefix)
  apply(company-capf prefix)
  company-call-backend-raw(prefix)
  company--force-sync(company-call-backend-raw (prefix) company-capf)
  company-call-backend(prefix)
  company--begin-new()
  company--perform()
  company-auto-begin()
  company-idle-begin(#<buffer 20220104135144-abstract_algebra_by_dummit_and_foote.org> #<window 3 on 20220104135144-abstract_algebra_by_dummit_and_foote.org> 62 1297)
  apply(company-idle-begin (#<buffer 20220104135144-abstract_algebra_by_dummit_and_foote.org> #<window 3 on 20220104135144-abstract_algebra_by_dummit_and_foote.org> 62 1297))
  timer-event-handler([t 25054 48351 95779 nil company-idle-begin (#<buffer 20220104135144-abstract_algebra_by_dummit_and_foote.org> #<window 3 on 20220104135144-abstract_algebra_by_dummit_and_foote.org> 62 1297) nil 235000 nil])

It seems to be completion-agnostic, as I get a similar message with corfu.

astoff commented 2 years ago

Digestif is a language server for (La)TeX. What's the goal of running it on an org file?

joshcho commented 2 years ago

There's embedded latex in org mode, so I figured I could use the autocomplete for that. But I think this would mess with parsing of the file, so perhaps something else (that only parses in-line latex fragments) is necessary.