-
Notifications
You must be signed in to change notification settings - Fork 24
bug: Something is wrong with svelte and astro and maybe tailwind in LazyVim? #131
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
Comments
How are you downloading the servers? How are you loading them? I dont have any information here. |
Oh wait, your config is in the other issue... Hmmm I dont see you install them via nix anywhere? You need to put them in lspsAndRuntimeDeps, or allow mason to run and provide any dependencies the things mason is installing would need. Mason doesnt work well on nixos If you are on another linux distro, then it might but mason installs precompiled binaries that will need dependencies provided to it, which nixos will not provide. So you would need to install those dependencies for the lsp, or the lsp itself via nix But if you install them to your path, such as via lspsAndRuntimeDeps, LazyVim will be able to load them. You can see that I do that with the lua and nix lsps Or you could change where in your template you disable mason, and instead use mason and deal with providing extra dependencies when mason fails to install them |
but basically, it cant load them because they are not installed. You have to install them via nix, or re enable mason and fix the things mason downloads by providing the dependencies each lsp needs. (much easier to just put the name in the list in nix) |
@BirdeeHub I have added them to lspsAndRuntimeDeps = with pkgs; {
general = [
universal-ctags
curl
# NOTE:
# lazygit
# Apparently lazygit when launched via snacks cant create its own config file
# but we can add one from nix!
(pkgs.writeShellScriptBin "lazygit" ''
exec ${pkgs.lazygit}/bin/lazygit --use-config-file ${pkgs.writeText "lazygit_config.yml" ""} "$@"
'')
ripgrep
fd
stdenv.cc.cc
lua-language-server
svelte-language-server
tailwindcss-language-server
astro-language-server
nil # I would go for nixd but lazy chooses this one idk
stylua
];
}; but I still cannot get it to work :( the completion doesn't work and also I am still getting the same errors. |
Does adding your extras from inside lua instead of via lazyvim.json work? { 'LazyVim/LazyVim', import = 'lazyvim.plugins' },
{ import = "lazyvim.plugins.extras.editor.neo-tree", },
{ import = "lazyvim.plugins.extras.editor.telescope", },
{ import = "lazyvim.plugins.extras.lang.astro", },
{ import = "lazyvim.plugins.extras.lang.clangd", },
{ import = "lazyvim.plugins.extras.lang.git", },
{ import = "lazyvim.plugins.extras.lang.go", },
{ import = "lazyvim.plugins.extras.lang.json", },
{ import = "lazyvim.plugins.extras.lang.markdown", },
{ import = "lazyvim.plugins.extras.lang.nix", },
{ import = "lazyvim.plugins.extras.lang.rust", },
{ import = "lazyvim.plugins.extras.lang.svelte", },
{ import = "lazyvim.plugins.extras.lang.tailwind", },
{ import = "lazyvim.plugins.extras.util.dot", },
{ import = "lazyvim.plugins.extras.util.mini-hipatterns", },
{ import = "lazyvim.plugins.extras.vscode" }, If so you may need to tell it where the new one is Ok well, here is where the error message is being printed from, you can turn off opts.warn and make it stop with that apparently The warning is only telling us that we dont have mason installed, and doesnt necessarily have any bearing on if it is installed or not. It does appear that on my machine, adding the imports in lua and installing the lsps works? When I do LspInfo its now showing that they are running? What does your LspInfo show? |
Unfortunately, lazy.nvim and especially LazyVim will always be somewhat of second citizen on nix because it blocks nix from installing things on its own, and LazyVim heavily assumes you are using mason to install things and not some other solution but mason installs precompiled binaries that are unlikely to work on nixos |
The rust and other languages you have enabled also likely wont work unless you install some things. Honestly using LazyVim through nix in general via any solution is way too many layers of indirection for my taste. If I was set on using LazyVim I wouldnt be using nix or nixos at all. NixCats makes it possible to use LazyVim, anywhere from easier to the same as other wrappers, but you still have to work through it a bit. |
@BirdeeHub I am using a darwin system can you help me enabled mason? |
Comment out the lines that disable it in the init.lua in your config and optionally also add it to the startup plugins list in nix. |
@BirdeeHub thanks! edit: also is there any consideration for an nvchad template? If not can you maybe explain how to get nvchad working with nixcats? |
Honestly, more templates is not ideal tbh, there are already a lot, I would rather see the quality of them improve Ive never used nvchad, if it uses lazy.nvim definitely not. I would rather if possible steer people away from lazy.nvim who want more minimal configs because lazy.nvim intercepts all plugin loading from nix so you need a small compat layer to set some settings properly (which is what the lazy wrapper is) There are other ways to lazy load that I mentioned in my readme that are nice, lze and lz.n which are faster and more minimal but both also have extensible specs for plugins. They work really well with paq-nvim and also nix! The general idea is that nixCats and the other nix wrappers follow the normal packpath plugin scheme, and so if you put them in optionalPlugins, lze and lz.n can load them lazily by name with vim.cmd.packadd along with a setup call on some trigger, or you can put them in startupPlugins and just call setup wherever if the plugin even requires a setup call at all. But because you are using lazy, you can still download via lazy, but when you download stuff via nix the lazy wrapper is just going to take all the plugins in both startupPlugins and optionalPlugins and make them available to lazy for lazy to deal with, and you need to make sure the names match up with the url. But thats only lazy.nvim The issue is that LazyVim is popular so making the template gets attention... something similar to the nixCats lazy.nvim wrapper can be made for most nix wrappers. nixCats is a decent approach to doing LazyVim on nixos, but its not going to fully take advantages of the strengths of nix in pretty much any way you decide to use lazy.nvim |
Ok |
Yeah Im sorry I cant give a better answer, using mason normally should work pretty well on darwin but if you try to run it on nixos you might have a bad time. LazyVim is highly integrated with mason, so, you can see why all that leads to some warts for LazyVim useage on nixos. Again, mason should work on darwin though. Because you will probably have a global rust and a global C and a /bin/bash for it to use among other things. You can add all those things into lspsAndRuntimeDeps and sharedLibraries sections of nixCats to then make mason work on nixos, its just that mason doesnt give the best error messages, so it could be unclear what you are missing. |
This conversation has got me thinking though I might at some point go through, identify all the dependencies that mason will need to load lazyvim extras, and install them in the template, and then reenable mason That way people could have the plug and play experience with lazyvim and if they wish to make it more refined by installing things with nix later they can. That might not be something I will do soon, but I am open to it if someone contributes it, and I might end up getting to it eventually. That being said, again, no solution using lazy in nix is going to be completely wart-free |
I am still working on this by the way. Im trying to find a way to get more of the extras to work without replicating all the extras as categories. Because I really dont want to do that? For a personal config that isnt that bad, because you only need to do the ones you use. But ALL of them is... a lot. If I have to do that, I will likely leave it as is for the most part? If I can instead find a fairly small subset of dependencies that makes mason work for stuff on nixos, then I will do that. |
I created an error in the LazyVim repo and they said that they will not support it and told me to come here. LazyVim/LazyVim#5792. I am getting this on opening the first svelte file of a neovim session, so basically if I open a second file it doesn't show the error but if I close neovim and open it again and open a .svelte file it shows the error. See below
Also the LSP and completion doesn't seem to be working (for svelte anyway).
I don't really know what is wrong with the tailwind-language-server, if anyone can help with that.
The text was updated successfully, but these errors were encountered: