Open Andrew15-5 opened 1 year ago
I've tried building release from master and then copying binary to ~/.local/share/nvim/mason/packages/typst-lsp/typst-lsp-x86_64-unknown-linux-gnu
but it seems nothing have changed. I don't know if it's the correct way, since mason
can only download binaries from release page, but the latest release was 6 days ago. Probably, bug didn't disappear.
I haven't yet made a release with this fix, but I expect to soon. I'll reopen the issue for now.
No, it still exports PDF. I've compiled typst-lsp
from this commit: 46e1b0b8a667c3d4c29bdd6388df83e12e5c02dd. With:
cargo build --release --no-default-features
Change this part:
wget https://github.com/nvarner/typst-lsp/files/12430172/typst-lsp-neovim.zip
unzip typst-lsp-neovim.zip
to this:
wget https://github.com/nvarner/typst-lsp/files/12612843/typst-lsp-0.9.5-46e1b0b-neovim.zip
unzip typst-lsp-0.9.5-46e1b0b-neovim.zip
tar axf typst-lsp-0.9.5-46e1b0b-neovim.tar.zstd
typst-lsp-0.9.5-46e1b0b-neovim.zip
P.S. GitHub doesn't allow for files greater than 25 MiB, so I had to compress with zstd and then wrap it in zip, since only zip is supported. If it would have not fit, I would've gave a MEGA link.
Can you post your config? disabling exportPdf
works for me.
Can you post your config? disabling
exportPdf
works for me.
Everything is in the archive. I'm really worried, that my config is bad, but I already triple checked it several times.
Yeah looks fine. I also checked again that it works for me :) Maybe you're still not using the right binary, but I know nothing of mason...
I also checked again that it works for me
Do you use VS Code? Did this issue exist for you in previous versions?
Do you use VS Code? Did this issue exist for you in previous versions?
No I'm using neovim. Issue existed before #281 for me, too.
I also compiled completely default binary and checked which version is used via :!typst-lsp -V<CR>
in Neovim (of course, the binary with my custom version name).
Might mason somehow call a different binary though? Maybe try without mason? Shouldn't be too hard to just start a new config for testing.
No I'm using neovim. Issue existed before #281 for me, too.
Based on which commit have you compiled the binary?
I know nothing of mason...
I'm almost new to it, too. But I think mason is just a manager of many tools (LSP servers, formatter and other stuff), that can be used in Neovim. It makes it so that I can access typst-lsp
from inside of Neovim, but outside the binary is not in the PATH
.
Current HEAD (46e1b0b8a667c3d4c29bdd6388df83e12e5c02dd). If you checked the version with typst-lsp -V
you woulndn't see the commit, right? So I'm still wary of mason ;)
Might mason somehow call a different binary though?
After latest version is installed (by mason):
After restarting the Neovim:
After running mv ~/.local/share/nvim/mason/packages/typst-lsp/typst-lsp-x86_64-unknown-linux-gnu{,.bak}
:
After restarting the Neovim:
Wait a second, how did that happen? My compiled typst-lsp does not do that, it just shows Version: 0.9.5 (Typst version 0.7.0)
Current HEAD (46e1b0b).
It's not the current HEAD for more than 2 hours, but I also compiled from this commit.
Ah right, I missed that last commit ;) Still doesn't show a commit hash, though.
Wait a second, how did that happen
I literally provided fully reproducible instructions in the https://github.com/nvarner/typst-lsp/issues/265#issue-1865282732 and an updated version in https://github.com/nvarner/typst-lsp/issues/265#issuecomment-1720062016 including the archive.
Ah I missed that part. I just used the included binary, and also with that, there's no pdf produced, neither when typing nor when savin the typ
file.
I just used the included binary, and also with that, there's no pdf produced, neither when typing nor when savin the
typ
file.
But I can't use your machine for testing. The docker images shows that the bug is still present.
I have absolutely no idea how it doesn't work on my machine, it doesn't work in a container, but it works for you.
Since I know more about mason than I knew before, I really have to try using the server directly. This should give the ultimate answer.
I have absolutely no idea how it doesn't work on my machine, it doesn't work in a container, but it works for you.
Yeah, a bit freakish :) The only thing I can see is the config, somehow, although the lsp-config
setup seemed fine to me. I did load your config directly (had to mod in a root_directory function though), and even though there were a lot of unrelated errors, the lsp server was started and connected, but still did not make a pdf on save.
What's in your config file?
I'm not sure what it is, but I suspect, that the coc.nvim is the culprit. I think my init.vim is pretty old since Lua plugins are now everywhere and most of mine are probably still written in Vimscript. So I've tried using https://github.com/hrsh7th/nvim-cmp/, and it's default config... everything just works... I need to dig deeper.
I thought it was my nvim version, but it works great with the default Debian (pretty old now) version.
I can confirm, that the current setup that works with latest commit's binary doesn't work with latest release's binary
Here is the updated & simplified version:
cd "$(mktemp -d)"
wget https://github.com/nvarner/typst-lsp/files/12614551/typst-lsp-neovim-coc-cmp.tar.zstd.zip
unzip typst-lsp-neovim-coc-cmp.tar.zstd.zip
tar axf typst-lsp-neovim-coc-cmp.tar.zstd
cd typst-lsp-neovim/
just
# Inside container
vi cmp.typ
# Inside Neovim add anything to the file and exit.
ia<Esc>ZZ
# PDF file was not created.
ll cmp*
# Open init.vim
conf
# Uncomment coc.nvim, comment nvim-cmp, suspend
20G<c-/>jjvip<c-/><c-z>
# Test coc.nvim
vi coc.typ
ia<Esc>ZZ
ll coc*
# You can undo conf modifications and text nvim-cmp again
z
uu<c-z>
# You can redo conf modifications and text coc.nvim again
z
<c-r><c-r><c-z>
I guess I'll wait for the fix to be in a new release, and then I can open an issue in coc.nvim. Clearly, coc.nvim doesn't work with nvim-lspconfig. I'm not sure why. I did the exact setup. Maybe there is something about this already fixed/opened.
The new release, v0.10.0, is out now. @Andrew15-5 can you test again?
Have you tested with coc.nvim yourself? There is no way it will work, because it doesn't check the lua config in the init.vim
. Either you or nvim-lspconfig/coc.nvim should change something in order for it (coc.nvim) to read the config at all.
So I tried the initial test but updated to the newest version — of course it didn't work. But I'm sure nvim-cmp
will work. I don't have time to test that.
cd "$(mktemp -d)" wget https://github.com/nvarner/typst-lsp/files/12430172/typst-lsp-neovim.zip unzip typst-lsp-neovim.zip cd typst-lsp-neovim/ sed -i 's/0\.6\.2/0.10.0/' Dockerfile # Update init alias just # cargo install just # sudo apt install -y cargo # Inside container init # After typst-lsp is installed, exit with `qZQ` vi a.typ # Inside Neovim add anything to the file & exit ia<Esc>ZZ # PDF file was created ll a.pdf
Component:
LSP version:
v0.6.2
,v0.9.4
OS version and name: Pop!_OS 22.04
I am on the latest stable version of the extension/LSP.
I have searched the issues of this repo and believe that this is not a duplicate.
Issue
It's cool, that
typst-lsp
now also supports new package system, this means I can use built-intypst watch
again. But this doesn't help if I need to watch only for the "main" file and recompile if it or any of the included files are changed. So, I need to disable it. I think I was able to disable the option then, but I'm not sure. Now, I've tried on my host OS and even in docker container (attached it in zip file) with latestv0.9.4
andv0.6.2
(#178) — no use. I still think that maybe my config is wrong, but it's very hard to mess up 3 lines of config (mason
,mason-lspconfig
,lspconfig
). So I also think that it's a bug.What to do:
typst-lsp-neovim.zip