-
Notifications
You must be signed in to change notification settings - Fork 52
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
Refactored server failure on multifile projects #202
Comments
Thanks for the report.
Can you try to run texlab with
Can you try setting
I haven't tested the performance that much yet with a release build, but I will add some benchmarks to find the regressions. I have still some optimizations left to try out so I think we will get to the level of the old performance pretty easily. |
This one seems to be odd. According to the LSP spec, the client has to specify the |
You are of course right; it just seemed related; texlab was working fine without specifying this before. (But I just checked, the error has always been there.)
Then I get \ 'workspace_config': {
\ 'bibtex': {'formatting': {'lineLength': 0}},
\ 'latex': {'rootDirectory': 'null'},
\ }, maybe that's not the right way?
Sure! How would I do that (from vim-lsp)? |
It is just an environment variable so it should get passed down to texlab if you run
This seems to be the right way. Maybe, I will try to use the old issues as test cases to find a reproducing example so I can fix this regression. |
Backtrace:
(this is without I tried a minimal example, but that worked fine. So there has to be some minimal complexity (maybe it needs bibtex?) |
In the log, I see references to |
This example has the same issue: #23 (comment) Here's the full log when doing that (ignore the vimscript errors, look for the The labels (This example works if I omit the |
From which directory are you calling
Can you run the same thing with a debug build, please? The compiler seems to have optimized the faulty function and the line numbers away. |
Yes, from the same directory. |
|
Thanks. The crash should be fixed with bf97694. |
Great, that fixes the not working hover/gotoDefinition as well! Thanks! |
Did it fix the workspace detection issue as well?
I benchmarked the completion and the initial performance seems to be roughly the same. With 7eb1adc, the new version should be a bit faster than the old version (at least for the comletion of commands). |
I think yes, because that seemed to have been the underlying issue that prevented hover from working. I also now get many more completion candidates in my multi-file projects (I haven't fully checked, but now it seems to be all of them, where previously candidates from some other files were missing)... ...however, that has made completion significantly slower than before (which is hardly surprising since now it seems to be checking much more files). Would it be possible to implement some caching for this (I did not notice any such effects)? (How can I check whether the workspace detection is working as intended, by the way?) |
This is good to hear. I fixed a lot of small errors in the workspace detection algorithm (in addititon to that, it now works with URIs mostly instead of paths like the old version so it should work with remote files too).
Caching is a bit difficult because the LSP type definition crate we are using does not support returning borrowed data. Almost all the during completion is spent allocating the
You can try triggering the completion for a command, which is provided by a package in a different file. If the command shows up in the list, then the files are considered to be in the same workspace. In addition to that, I can easily add a log statement, which displays all files that are considered when executing an operation. |
Yes, that works -- I get completion of commands from all manner of \usepackages (but this seemed to be working before already?)
If you think it's helpful, I can try that locally. Otherwise I'd consider the workspace detection fixed. I understand the caching issue. If there's anything I can do to profile this (easily) on my project, let me know! (Otherwise, my "stress test" project is an expanded version of https://arxiv.org/abs/2001.00216, for which you can download the sources if you're interested.) |
This may be premature, but I just tested the refactored version of texlab (macOS Catalina, neovim with vim-lsp). There seems to be something wrong with the workspace detection: While hover, complete, and gotoDefinition seem to work for bibtex and the current tex file, I don't get any result on these for labels from different files. Here's a (hopefully relevant) part of the vim-lsp log for calling hover on a label defined in a different subfile:
EDIT: and I just found this at the top of the log:
Also, texlab seems to be noticeable slower than before, but I can't quantify that?
EDIT 2: Same under Linux.
The text was updated successfully, but these errors were encountered: