-
Notifications
You must be signed in to change notification settings - Fork 51
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
More completions for environments #29
Comments
Which package that defines |
As far as I know, |
The following document does not compile on my machine (TeX 3.14159265 (TeX Live 2019/Arch Linux)): \documentclass{article}
\usepackage{amsthm}
\begin{document}
\begin{lemma}
Foo Bar Baz
\end{lemma}
\end{document} The log says: \documentclass{article}
\newtheorem{lemma}{Lemma}
\begin{document}
\begin{lemma}
Foo Bar Baz
\end{lemma}
\end{document} As one has to explicitly define the environment using |
You are of course completely right, I confused that with the (I checked again; vimtex provides |
Regarding the To be precise, completion is triggered correctly on |
@clason Can you try the latest commit of the master branch? I think I have fixed the issue. |
Yes, that works now, thank you! (One minor thing that I just noticed with a minimal example: vimtex always takes the -- only! -- completion candidate from whatever is in the In fact, it might make sense to not only preselect the matching environment, but return it as the only completion candidate -- I have a hard time coming up with an example where you don't want to end the last opened environment. What do you think?) |
I'm also still missing some (less common) environments such as Is the list still being expanded, or did you decide on only providing a common subset for performance or simplicity, or is this a parsing bug? Did I prematurely close the issue? |
I cannot reproduce this issue with my machine.
The list is always "incomplete" in the sense that it gets recomputed after every keystroke. |
I cannot reproduce this on another machine, either; the other machine's So do I understand correctly and the completion candidates are crawled from actually the included packages and stored (persistently) in In this case, could it be that this file had been already created by an earlier version of texlab, which contained a -- for some reason, for example crashing server or prematurely closing the file, incomplete -- entry for I'll try removing the file and restarting and see if that helps. |
Yes, something is wrong with texlab on that machine; opening a tex file and letting texlab idle for a few minutes produces the attached (nearly empty) file. This is latest master compiled with rust nightly on Linux. Curiously, what's missing from this file is The other machine is a macOS 1.0.0 binary downloaded from the releases page; here I get a 50k json, and everything works correctly (for the same tex file!) |
But even on the other machine, it doesn't give me (all) environment candidates for included packages for a more complicated project. (Commands seem to work, curiously.) |
@efoerster needs to have a look at this. We will probably add some logging statements to debug the problem.
Until the latest commit, TexLab did not support the syntax
Are these packages included with the syntax from above? If not, can you please give an example of an environment that is missing? |
Yes, it's (again) |
I see the following in the stderr log (with the latest commit, which correctly picks up the full list of packages, but not their contents):
|
The problem seems to be related to the compilation of the document. Can you please try to the compile the following document \documentclass{scrartcl}
\listfiles
\begin{document}
\end{document} with |
Regarding the issue with EDIT: If i understand you correctly, then |
@efoerster Good call! With this minimal file (and TeXlive 2019, updated daily), I get
Deleting the offending @pfoerster Yes, |
Nice! And much more performant, too. I still have the issue that it doesn't appear in a multi-file project -- I suspect that something prevents texlab from finding the included file where all the |
I think I see what the problem is: I'm using my own To be specific, texlab doesn't consider |
Thanks for the report. This was indeed the problem. TexLab should now support |
Indeed, that fixed it! Thanks for the quick help! I feel really bad about this, but could it be that |
Hmm, the Thank you for your patience with me! |
I noticed that when asking for completions on
\begin{
, typical suspects such astheorem
,lemma
,proof
, etc. are missing from the list of candidates.(I'm spoiled; vimtex has a huge list of completions generated via
convert-cwl
, see https://github.com/lervag/vimtex/tree/master/autoload/vimtex/complete. Also, one neat related feature is that when completing for\end{
, the first match is always the environment from the last unclosed\begin{...}
above.)EDIT: the corpus also contains information about the package the environment (or command) is defined in, which can (and is by vimtex) shown as a preview (rather than "user-defined").
The text was updated successfully, but these errors were encountered: