astoff / digestif Goto Github PK
View Code? Open in Web Editor NEWA language server for TeX and friends
License: Other
A language server for TeX and friends
License: Other
I've been using digestif and I'm very happy with it. Thanks for that nice piece of software.
I often use hyperref \autoref instead of \ref but I noticed that using hyperref I could not find references nor definitions.
Is there a way to configure the command \autoref to have the same lsp features of \ref?
I'm using eglot on emacs.
I'm trying to add support for acronym.sty
and --generate
is unfortunately not very helpful. I would do it myself, but I lack time and documentation (extended examples on well-known commands would maybe help).
Hi astoff, first I'd like to say this is a great project that's really improved my emacs/LaTeX experience!
However, most of my documents are short scientific papers where the usual style is to have a main document with the section headings followed by \include statements for the text of those sections (this makes it way easier to change the format of the paper for different venues). I see in a different issue that you are aware that with this setup completion of citations does not work properly even with % !TeX root = main.tex
added at the top.
Any chance that this functionality will be added soon? The citation completion is one of my favorite parts of this project!
TexLab is a popular project which implements the Language Server Protocol for LaTeX. How does this project relate to TexLab? Is it intended as a replacement?
I am currently using digestif on emacs via lsp-mode (emacs 26.3, just reinstalled everything from scratch. config).
I am running lua 5.3.1 (via luaver) / digestif 0.3.1.
As I try to have auto-completion for the content of a \begin{
block , I get the following error
Company: An error occurred in auto-begin
Company: backend company-capf error "...luarocks/2.3.0_5.3/share/lua/5.3/digestif/Manuscript.lua:867: attempt to call a nil value (method ’all_environments’)" with args (candidates it)
Auto-saving...done
any suggestion?
Thanks
Reading about the TeXShop-style magic comments, it occurred to me that digestif might like to support AUCTeX-style multifile definitions as well, since eglot is emacs based.
See: https://www.gnu.org/software/auctex/manual/auctex/Multifile.html#Multifile
This is an example at the end of a .tex file (note the extension from the file name is omitted):
%%% Local Variables:
%%% TeX-master: "master"
%%% End:
Thanks
Hi! I am on macOS Mojave, and installed digestif via luarocks. However I can't seem to get completions for commands of some packages, e.g. listings, amsmath. But commands like \def
, \usepackage
get completions fine.
I expect to have a popup completion menu containing lstset{}.... Is there something I should do in configuration to make digestif work as expected? Thanks!
Thank you so much for this great package.
I use a nix-based system which means digestif and texlive are installed in non-conventional places. digestif -h
suggests that I need to set DIGESTIF_DATA
, DIGESTIF_TEXMF
, and DIGESTIF_TLPDB
variables. However, I do not know what those variables are and for. I was hoping you can show me an example of the values of these variables.
P.S., the installed path of texlive
is /nix/store/2mvi6sz0q96kbrz6p8zh2nsn7ays1nwq-texlive-combined-full-2020.20210109
and (the wrapper script) digestif
is /nix/store/hckcnvihrgpzkfx166yhpljdsj78bhns-digestif
I use digestif
with eglot
in emacs. But when I put cursor under some citation key, it says "cite info is not available". I have to open the .bib file so that digestif
can scan it. Also, the completion is not working either. Is there a way to let digestif
know about my bibliography file? When I try to run digestif -g /path/to/file.bib
, it says "can't generate tags from it".
Hi Astoff,
I got your Language Server running with Emacs 27 on Arch Linux. Currently I am using LSP-mode with company for completion, when editing LaTeX projects. I installed the Server via luarocks.
So far everything works as expected, but I get a random occuring error, that freezes my whole Emacs for about 2 Seconds. Usually it occurs while fastly deleting some words, but I can not pin it down completely. Therefore I can not provide a manual for reproducing. But the Error happens on both my Arch Linux Systems.
Error Message is:
error in process filter: Unknown message type: #s(hash-table size 3test equal rehash-treshold 0.8125 data ("error" #s(hash-tabel size 2 test equal rehash-site 1.5 rehash-treshold 0.8125 data ("code" 1 "message" "/use/share/lua/5.3/digestif/langserver.lua:179: Range length mismatch in textdocument/didChange operation")) "result" nil "jsonrpc" "2.0"))
I've used digestif on several Fedora systems without a problem, but after installing it on a RHEL system with luarocks via luarocks install --local digestif
I get the following error when I try to run it (just running digestif
in my home directory):
kpsewhich: unrecognized option '-var-brace-value=TEXMF'
/usr/bin/lua: /home/jg110/.luarocks/share/lua/5.3/digestif/config.lua:26: attempt to index a nil value
stack traceback:
/home/jg110/.luarocks/share/lua/5.3/digestif/config.lua:26: in main chunk
[C]: in function 'require'
/home/jg110/.luarocks/share/lua/5.3/digestif/langserver.lua:1: in main chunk
[C]: in function 'require'
/home/jg110/.luarocks/lib/luarocks/rocks-5.3/digestif/0.4-1/bin/digestif:2: in main chunk
[C]: in ?
On Ubuntu 20.04, I try to test the Emacs with the lsp-mode package
based setting according to the instruction here using the following steps:
digestif
according to the instruction here:$ git clone https://github.com/astoff/digestif.git digestif.git
$ cd digestif.git/scripts
# Bootstrap digestif with the self-installing wrapper script.
$ ./digestif
# Place it in your $PATH
$ ln -sfr digestif ~/.local/bin
(straight-use-package
`( auctex :type git :host nil :repo "https://git.savannah.gnu.org/git/auctex.git"
:pre-build ,(pcase system-type
(`berkeley-unix '("gmake"))
(_ '(
;("bash" "-c" "cd ~/.emacs.d/straight/repos/auctex")
("./autogen.sh")
("./configure")
("make")
("sudo" "make" "install"))))))
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(use-package lsp-mode)
(use-package company-lsp)
(require 'company-lsp)
(push 'company-lsp company-backends)
(add-to-list 'company-lsp-filter-candidates '(digestif . nil))
Then I open some TeX document and still can't have the Digestif enabled. OTOH, I've successfully configured and tested Emacs with the Eglot package
based approach as described here.
Any hints for this problem will be highly appreciated.
Regards,
HY
Hi,
Consider this latex file:
\documentclass{article}
\begin{document}
\noindent
foo
\end{document}
Now do ESC-: (goto-char 50) RET and Eglot loses connection to digestif. In *Messages*
buffer, I see this:
[jsonrpc] Server exited with status 1
[eglot] (warning) Reconnecting after unexpected server exit.
[eglot] Connected! Server `Digestif' now managing `(latex-mode tex-mode context-mode texinfo-mode bibtex-mode)' buffers in project `eglot'.
[eglot] Reconnected!
This seems the relevant part after M-x eglot-events-buffer RET (line breaks added for better legibility):
...
(:jsonrpc "2.0" :id 5 :method "textDocument/hover" :params
(:textDocument
(:uri "file:///c%3A/path/to/eglot-test.tex")
:position
(:line 4 :character 6)))
[stderr] info: ./(latex2e)\indent : No such file or directory
[server-reply] (id:4) Fri Jan 13 13:06:13 2023:
(:jsonrpc "2.0" :result nil :id 4)
[stderr] Der Befehl "\noindent'" ist entweder falsch geschrieben oder
[stderr] konnte nicht gefunden werden.
[server-reply] (id:5) Fri Jan 13 13:06:13 2023:
(:jsonrpc "2.0" :result
(:contents
(:value "`\\noindent`: Go into horizontal mode, without an indent.\n\n
# Documentation\n\n
`\\noindent` is defined in the [latex](https://www.ctan.org/pkg/latex) package.\n\n
- <info:latex2e#\\indent & \\noindent>\n
- [A (Not So) Short Introduction to LaTeX 2ε](file://C:/path/to/texlive/2022/texmf-dist/doc/latex/lshort-english/lshort.pdf)\n
- [LaTeX 2ε for authors](file://C:/path/to/texlive/2022/texmf-dist/doc/latex/base/usrguide.pdf)\n
- [LaTeX 2ε for class and package writers](file://C:/path/to/texlive/2022/texmf-dist/doc/latex/base/clsguide.pdf)" :kind "markdown"))
:id 5)
[internal] Fri Jan 13 13:06:13 2023:
(:message "Connection state changed" :change "exited abnormally with code 1\n")
This is my setup:
If seems to me that info
doesn't grok the command for finding latex2e.info
. I'm not familiar with this, but I can do info latex2e RET in bash and it works. Emacs also finds the files since $INFOPATH
and Info-directory-list
are adjusted. Any idea what's going wrong? TIA.
Hi. I'm trying your server with coc.nvim
and I'm not sure about the correct filetype mapping for the server, currently I've updated the wiki to the following, since it seems to provide better results than what was there:
let g:coc_filetype_map = {'plaintex': 'tex'}
Initially it was
let g:coc_filetype_map = {'tex': 'latext', 'plaintex': 'tex'}
I imagined 'latext'
was a typo for 'latex'
, so I changed it to 'latex'
, but even then I was not getting completion for trivial commands like \documentclass
, etc, only after removing the 'tex': 'latex'
mapping that I was able to get this command. Still it is not being perfect regarding imported commands, for example, for \documentclass[11pt,a4paper,sans]{moderncv}
(for resumes) I don't have completion for \cventry
and others.
Hi,
first of all thanks for this package. I am using it in combination with Eglot and Company.
One thing I noticed is that I cannot get any completion for my bibliography, while I am getting completion and documentation (ElDoc) for other LaTeX elements.
This is what I have:
@Book{seneca,
author = {SENECA},
title = {Lettere a Lucilio},
date = 2020,
publisher = {Garzanti}
}
When I do \cite{se
and try to complete with Company I get the message No completion found
.
Furthermore, this is how I set up LaTeX-mode
:
(defun mu-latex-mode-setup ()
"Configure `latex-mode'."
(adaptive-wrap-prefix-mode)
(eglot-ensure)
(reftex-mode))
(add-hook 'LaTeX-mode-hook #'mu-latex-mode-setup)
If you need more details, do let me know.
Greetings. Suppose I have two LaTeX files called main.tex
and macro.tex
in the same directory. Suppose macro.tex
reads:
% !TeX root = main.tex
\newcommand{\hellohello}{\mathrm{hello}}
and it is included in main.tex
:
\documentclass{article}
\input{macro.tex}
\begin{document}
...
\end{document}
An expected behavior is that when one starts to type \helloh...
in main.tex
, a completion should pop up. But the actual behavior is that no such completion is suggested by digestif. It seems that digestif does not find the commands defined in the included files.
Whenever I try to run the server, I get the following:
$ digestif
/usr/bin/lua5.3: ...rocks/lib/luarocks/rocks-5.3/digestif/scm-1/bin/digestif:19: Could not find data files at the following locations:
./digestif-data
/home/alex/.local/share/digestif-data
stack traceback:
[C]: in function 'error'
...rocks/lib/luarocks/rocks-5.3/digestif/scm-1/bin/digestif:19: in main chunk
[C]: in ?
I installed using luarocks using the instructions in the README.
I do not know if the digestif upstream is directly involved in the texlive packaging or if they can help, if this is not the case, then my apology for the noise.
From the documentation, it is not clear to me how digestif is meant to be used in this scenario.
TeXLive makes a digestif
executable available, however trying to invoke it invariably returns
/usr/local/texlive/2022/bin/x86_64-linux/digestif:8: Can't find 'digestif.zip' archive
Trying to use ESC-x eglot in emacs produces a server died
error.
Any clue?
This project is awesome.
Though less powerful than Texlab, Digestif is efficient and lightweight.
I used Digestif in my own project SwiftLaTeX (https://www.swiftlatex.com), which is an online WebAssembly-based LaTeX editor. I compiled a Lua interpreter and digestif scripts into WebAssembly. It provides intelligence sense to my monaco editor.
Just one question, would it be possible to pack all documentations into the tag data files, so it does not have to rely on the info command.
Cheers
Emacs lsp-mode has recently introduced support for company-capf.
Is it possible when using company-capf to have completions for citations?
Would it be possible to document better how it should be configured as a complete example? I am using lsp and company and when I do what documentation does it still doesn't provide the completion.
Hi @astoff ,
I am really interested in using digestif
in combination with eglot
and tikz-mode
. Recently, I have forked tikz.el
, and made some changes in order to fit it to my typical workflow. You can find my tikz.el
here.
However, when I open the example block diagram in Emacs, and add the first line
% !TeX root = ../templates/tikz-preamble-template.tex
I do not get completions for e.g. tikz's node options. Am I missing something?
From #19, I know that you are also using and developing digestif
in combination with elgot
. Would be great, if you could help me with ideas what might be going wrong.
Hi,
I updated Digestif yesterday by removing the .digestif
directory and re-running digestif
from the command line, but I cannot complete bibliographical entries any more.
This is a small recipe to reproduce the problem:
mkdir /tmp/test-completion
biblio.bib
file with the following content:@Book{test,
author = {testy, test},
title = {This is a test},
date = 2022,
publisher = {Test Press}
}
test.tex
file with the following content:\documentclass[12pt, oneside]{book}
\begin{document}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
\begin{document}
, try inserting \cite{te
and press TAB (or M-x completion-at-point)This is the content of the Eglot events buffer:
[internal] Sat Dec 31 14:48:35 2022:
(:message "Running language server: /home/manuel/.bin/digestif")
[client-request] (id:1) Sat Dec 31 14:48:35 2022:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
(:processId 5997 :rootPath "/tmp/test-completion/" :rootUri "file:///tmp/test-completion" :initializationOptions #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
())
: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 :json-false :deprecatedSupport t :resolveSupport
(:properties
["documentation" "details" "additionalTextEdits"])
:tagSupport
(:valueSet
[1]))
:contextSupport t)
:hover
(:dynamicRegistration :json-false :contentFormat
["plaintext"])
:signatureHelp
(:dynamicRegistration :json-false :signatureInformation
(:parameterInformation
(:labelOffsetSupport t)
: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 :codeActionLiteralSupport
(:codeActionKind
(:valueSet
["quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"]))
:isPreferredSupport t)
:formatting
(:dynamicRegistration :json-false)
:rangeFormatting
(:dynamicRegistration :json-false)
:rename
(:dynamicRegistration :json-false)
:publishDiagnostics
(:relatedInformation :json-false :codeDescriptionSupport :json-false :tagSupport
(:valueSet
[1 2])))
:experimental #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
()))
:workspaceFolders
[(:uri "file:///tmp/test-completion" :name "/tmp/test-completion/")]))
[server-reply] (id:1) Sat Dec 31 14:48:36 2022:
(:id 1 :jsonrpc "2.0" :result
(:capabilities
(:completionProvider
(:triggerCharacters
["\\" "{" "[" "," "="])
:workspaceSymbolProvider t :documentSymbolProvider t :textDocumentSync
(:change 2 :openClose t)
:referencesProvider t :hoverProvider t :definitionProvider t :signatureHelpProvider
(:triggerCharacters
["{" "[" "="]))
:serverInfo
(:name "Digestif" :version "0.5.1")))
[client-notification] Sat Dec 31 14:48:36 2022:
(:jsonrpc "2.0" :method "initialized" :params #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
()))
[client-notification] Sat Dec 31 14:48:36 2022:
(:jsonrpc "2.0" :method "textDocument/didOpen" :params
(:textDocument
(:uri "file:///tmp/test-completion/test.tex" :version 0 :languageId "latex" :text "\\documentclass[12pt, oneside]{book}\n\n\\begin{document}\n\n\\cite{te\n\n\\end{document}\n\n%%% Local Variables:\n%%% mode: latex\n%%% TeX-master: t\n%%% End:\n")))
[client-notification] Sat Dec 31 14:48:36 2022:
(:jsonrpc "2.0" :method "textDocument/didOpen" :params
(:textDocument
(:uri "file:///tmp/test-completion/biblio.bib" :version 0 :languageId "latex" :text "@Book{test,\n author = {testy, test},\n title = {This is a test},\n date = 2022,\n publisher = {Test Press}\n}")))
[client-notification] Sat Dec 31 14:48:36 2022:
(:jsonrpc "2.0" :method "workspace/didChangeConfiguration" :params
(:settings #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
())))
[client-request] (id:2) Sat Dec 31 14:48:44 2022:
(:jsonrpc "2.0" :id 2 :method "textDocument/completion" :params
(:textDocument
(:uri "file:///tmp/test-completion/test.tex")
:position
(:line 4 :character 8)
:context
(:triggerKind 1)))
[server-reply] (id:2) Sat Dec 31 14:48:44 2022:
(:id 2 :jsonrpc "2.0" :result
[])
I am using GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2022-12-31
Some profiling showed that the language server may spend around 50% of the CPU time inside dkjson's encode routines, and take around 20 ms to encode a large completion response.
We should replace dkjson with a C library, but currently cjson doesn't work reliably in Lua 5.3, see this issue. So we need to wait for a fix or find another native json library.
Example document:
\section{a}
\startsection[title={b}]
\stopsection
This should result in a TOC entry for both a
and b
with the same section_level
but I only see a
It would be nice if digestif can offer path completion function support. For example, when inserting images with \includegraphics
command, it can show completion candidates based on file path when you are typing.
The fuzzy completion features is known to work in conjunction with Company mode. Other completion UIs may be incompatible.
Hi,
would you consider adding a .dir-locals.el
to the repo? This could help people who want to contribute and use Emacs for coding. A skeleton can look like this:
;;; Directory Local Variables -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")
((nil . ((indent-tabs-mode . nil)))
(auto-mode-alist . (("\\.tags\\'" . lua-mode)
("\\.texlua\\'" . lua-mode)
("\\.rockspec\\'" . lua-mode)))
(lua-mode . ((lua-indent-level . 2))))
I installed digestif as root on ubuntu 18.04 and use it with neovim v0.4.0-dev and coc.nvim 0.0.66.
Everything works pretty well except the extra "//" that I have to move cursor back and manually delete it. For example, when I type \begin and get completion prompt "begin~ {environment} [LS]" and I hit enter to choose it. Then I get "\begin\{enviroment}". An extra "\" is added before "{".
My coc.nvim config is like
"digestif": {
command : digestif ,
args : [],
filetypes : [
tex ,
plaintex ,
bibtex
],
}
Hi,
I'm trying to run digestif so that I can get LSP under Emacs on my OpenBSD box.
When I go to ~/.digestif
and run ./bin/digestif
, nothing happens, but the program does not end, which seems good to me for a (language)-server.
However, when I open a .tex
file in Emacs and do M-x lsp
it tells me lsp server did not run correctly and buffer digestif::stderr
says:
stack traceback:
[C]: in function 'require'
/home/user/.digestif/bin/digestif:2: in main chunk
[C]: in ?
Process digestif stderr<1> finished
Process digestif stderr finished
Do do not know anything about lua
and this message does not help me much.
Any idea?
NOTE: I apparently have lua51
and lua53
installed
EDIT: running ./bin/digestif -v
gives me 22:02:12 Digestif started!
so everything seems OK outside Emacs.
I tried this language server in Sublime Text and I like it so far.
But I noticed that popups on mouse hover look broken, because the hover response from the server contains an unclosed and invalid HTML-tag <info:latex2e# [...] >
. Sublime Text uses a custom HTML rendering engine for its hover popups, and so the Markdown content has to be converted to HTML by the client. Since HTML tags (including custom tags) are valid within Markdown, they are preserved when converting to HTML. However, Sublime Text can't handle unclosed custom tags, and afaik :
and #
are also invalid characters in tag names (see https://github.github.com/gfm/#tag-name).
Here is an example of the server response when I hover over the \LaTeX
macro:
{
"contents": {
"value": "`\\LaTeX`\n\n# Documentation\n\n`\\LaTeX` is defined in the [latex](https://www.ctan.org/pkg/latex) package.\n\n- <info:latex2e#Text symbols>\n- [A (Not So) Short Introduction to LaTeX 2ε](https://www.tug.org/texlive/Contents/live/texmf-dist/doc/latex/lshort-english/lshort.pdf)\n- [LaTeX 2ε for authors](file://C:/Users/jwortmann/AppData/Roaming/MiKTeX/2.9/doc/latex/base/usrguide.pdf)\n- [LaTeX 2ε for class and package writers](file://C:/Users/jwortmann/AppData/Roaming/MiKTeX/2.9/doc/latex/base/clsguide.pdf)",
"kind": "markdown"
}
}
The popup cuts off after the first list item:
It would be nice if this HTML tag could be removed from the Markdown content, assuming it serves no purpose. In case it should be rendered literally, please consider to replace <
by <
.
Hello astoff thanks for the great package you have developed.
I would like to ask you if multifile latex projects are supported?
If not do you intend to add support for them later?
Hello,
I've noticed that digestif
does work for both eglot
and lsp-mode
when ConTeXt is installed system-wide via TeXLive package (I'm on Debian Sid), while if I try to use ConteXt via user-installed LMTX it does not offer any auto-completion.
Considering that LMTX is the preferred ConTeXt installation for those not requiring LaTeX since it provides latest version and is much smaller, I wonder what should be configured to make digestif
recognize LMTX local ConTeXt installation?
Let me add that I can normally typeset documents by using local installation...
[Error - 18:28:10] Request textDocument/hover failed.
Message: /usr/share/lua/5.4/digestif/Manuscript.lua:552: attempt to index a nil value (field 'data')
Code: 1
referring to this line:
digestif/digestif/Manuscript.lua
Line 552 in 1fac471
Hello,
I'd like to use Digestif for writing ConTeXt markup, but wonder if it would be possible to use it with Onivim 2 editor which can use VScode extension or I need Vim+Coc?
Hi! Someone just pointed this one out to me.
I’m using the project structure system. I saw the bit about “TeXShop-style magic comments”, but supporting \project
and so on could be a better alternative for ConTeXt.
I also wonder if command completion and bib support works for ConTeXt (completion of \cite[<tab>
), because this is my biggest pain point at the moment. If so, I’ll throw together a quick VS Code extension. If not, maybe I’ll find time to help here (but I’m writing my PhD thesis right now so no promises)
Command and signature completion as well as hover docs can be done by checking the interface files: https://source.contextgarden.net/tex/context/interface/mkiv/i-accent.xml
Am I correct that with environments the cursor is placed inside the brackets after completion (then triggering a new completion popup where one can select the right environment), but that something similar does not happen with e.g. the \cite
command, where it would put the cursor inside the {}
and trigger completion based on the .bib file?
VS Code offers several versions of the \cite
command in the popup, from \cite{}
to \cites()()[][]{}{}
. One can then tab between the different brackets.
stack traceback:
[C]: in function 'table.concat'
/usr/share/lua/5.3/luarocks/core/dir.lua:21: in function 'luarocks.core.dir.path'
/usr/share/lua/5.3/luarocks/cmd.lua:160: in upvalue 'get_lua_version'
/usr/share/lua/5.3/luarocks/cmd.lua:287: in function 'luarocks.cmd.run_command'
/usr/bin/luarocks:38: in main chunk
[C]: in ?
I execute the command
sudo luarocks install https://github.com/astoff/digestif/raw/master/rockspec/digestif-scm-1.rockspec
get those errors
I am currently using digestif with coc.nvim. I installed digestif using luarocks but I didn't get any autocompletion. Whenever I try to generate tags file, digestif gives me an error
digestif --generate $(kpsewhich amsmath.sty)
Error: can't find '/usr/share/texmf-dist/tex/latex/amsmath/amsmath.sty' or can't generate tags from it.
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.
Citation completion works great in \cite{}, but it does not work in \citet{} and \citep{}.
I also tried generating tag file for natbib.sty and put it into the data folder. Unfortunately, completion still does not work.
Hi,
I played a little with digestif and updated the file data/natbib.sty.tags
. I have no clue about writing tags file, but this seems to work. Only the package options part doesn't work. Can someone give me a hint what I've done wrong? I don't get the option summary when the point is * and inside \usepackage[rou*nd]{natbib}
.
Any other comments are welcome as well; I'll prepare a PR then. TIA.
natbib.sty.tags.patch
Hi, astoff!
Thank you for developing the fantastic package!
I'm using Debian Bullseye/Sid, GNU Emacs 28.0.50, debian apt install Lua 5.3 (Ver: Lua 5.3.3) and LuaRocks (Ver: 2.4.2).
As your follows, luarocks install digestif. Then ELPA install lsp-mode and company-lsp, at last, put the syntax (require 'company-lsp)
(add-to-list 'company-lsp-filter-candidates '(digestif . nil)) in init file.
Once open a tex file, Emacs minibuffer display "Server digestif:78655 status:starting exited with status exit." I check the digestif buffer, it's a blank buffer with size is 0. The digestif::stderr buffer says "/usr/bin/lua5.3: /usr/share/lua/5.3/luarocks/loader.lua:147: error loading module 'lpeg' from file '/usr/local/lib/lua/5.3/lpeg.so':
/usr/local/lib/lua/5.3/lpeg.so: undefined symbol: lua_tointeger"
I check the /usr/local/lib/lua/5.3, and there is a file lpeg.so. So i open the loader.lua file, the line 144 is a function, and the line 147 local results = { a_loader(module_name) }
At the end, i don't know how to fix this error: undefined symbol
Hope the information above useful to you.
Thanks again.
When opening a .bib file, I get a lot of errors like:
[Error - 12:52:55] Request textDocument/hover failed.
Message: /usr/share/lua/5.3/digestif/Manuscript.lua:258: attempt to index a nil value (field 'parser')
The error occurs in Manuscript:find_par
:
digestif/digestif/Manuscript.lua
Lines 253 to 263 in 8f8a8b7
Hi Astoff!
Thanks for developing a fantastic package!
I am using lua 5.3.5 (32-bit).
I have installed digestif using luarocks, but have the following error when I try to run digestif in cmd or when it is called in nvim.
I am new to this, so any help would be appreciated!
C:\Program Files (x86)\lua\5.3\bin\lua.exe: ...ram files (x86)\lua\5.3\/share/lua/5.3/digestif\util.lua:322:
bad argument #1 to 'match' (string expected, got nil)
stack traceback:
[C]: in function 'lpeg.match'
...ram files (x86)\lua\5.3\/share/lua/5.3/digestif\util.lua:322: in local 'f'
...ram files (x86)\lua\5.3\/share/lua/5.3/digestif\util.lua:27: in function 'digestif.util.foldl1'
(...tail calls...)
...m files (x86)\lua\5.3\/share/lua/5.3/digestif\config.lua:7: in main chunk
[C]: in function 'require'
...les (x86)\lua\5.3\/share/lua/5.3/digestif\Manuscript.lua:4: in main chunk
[C]: in function 'require'
...am files (x86)\lua\5.3\/share/lua/5.3/digestif\Cache.lua:5: in main chunk
[C]: in function 'require'
...les (x86)\lua\5.3\/share/lua/5.3/digestif\langserver.lua:1: in main chunk
[C]: in function 'require'
...\5.3\\lib\luarocks\rocks-5.3\digestif\0.2-1\bin\digestif:2: in main chunk
[C]: in ? ```
When attempting to retrieve the currently installed version of Digestif, I receive an error message:
% digestif --version
Usage: digestif [-h] [-v] [-g FILES]
Invalid option: --version
I think it would be an improvement if the current version number were printed instead.
Many ConTeXt commands have optional arguments which are not distinguishable just by the delimiters, for instance \citation[optional][mandatory]
. This is currently not parsed correctly.
Integration tests work with lsp-test version 0.9. The newest version seem to be more stringent on the server response, maybe we are not 100% compliant to the LSP spec.
I have some tooling that generates packages from luarocks that are on www.luarocks.org (I should adapt it to fetch the rockspec from any source really) so I wonder if you could post your rockspec on luarocks.org please ?
Would also make it easier to install.
I could do it but I don't want to hijack the name in the global namespace ;)
I download this repo using that digestif.cmd
, and set the bin
folder path into the PATH
environment variable. After open a .tex
document in Emacs, M-x eglot
, it failed to find this digestif
. I think the problem is that, the digestif
program inside the bin
folder is not really a real Windows executable.
So, facing this problem, how can I install digestif
successfully on Windows? Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.