Skip to content
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

how to setup hyprls with lspconfig? #11

Closed
daUnknownCoder opened this issue Jun 22, 2024 · 1 comment
Closed

how to setup hyprls with lspconfig? #11

daUnknownCoder opened this issue Jun 22, 2024 · 1 comment

Comments

@daUnknownCoder
Copy link

daUnknownCoder commented Jun 22, 2024

i use this in my init.lua:

vim.filetype.add({
  pattern = { [".*/hypr/.*%.conf"] = "hyprlang" },
})

which works for my hyprlang treesitter parser

im not sure how to use hyprls in lspconfig like the others:
something like:

      lspconfig["hyprls"].setup({
        capabilities = capabilities,
        on_attach = on_attach,
      })

installation requires just not sure why i need it tho

in this pattern, can i not use hyprlang?

-- Hyprlang LSP
vim.api.nvim_create_autocmd({'BufEnter', 'BufWinEnter'}, {
		pattern = {"*.hl", "hypr*.conf"},
		callback = function(event)
				print(string.format("starting hyprls for %s", vim.inspect(event)))
				vim.lsp.start {
						name = "hyprlang",
						cmd = {"hyprls"},
						root_dir = vim.fn.getcwd(),
				}
		end
})

also in the blog, you have the color picker and a ⭐, which looks like a plugin, mind if you tell me what is it?

image

is it neovim?

@ewen-lbh
Copy link
Member

Hi! I actually did a PR for lspconfig to include hyprls (see neovim/nvim-lspconfig#3137) but it's misconfigured: I mistook filetypes for file name patterns...

However someone fixed my mistake lmao, thx @mehalter

So the lspconfig should work if the hyprlang filetype is defined

The installation does not require Just, this is required to build from source. Just is a modern alternative to Makefiles.

You can install with go.

Having HyprLS available in linux repos would be nice, but I don't really have the time to setup all of that up. I kinda did set that up for ortfo/db so I could do it eventually but I don't really have the time right now.

Lastly, the color picker is indeed using the color features of the LSP standard, but the screenshot comes from VSCode. I don't really know if neovim has an equivalent feature, some plugin may be able to tap into the LSP color features.

The star emoji has nothing to do with LSPs, I think it's copilot? not rly sure tbh.

And it the autocmd is kind of a dirty hack (see #9), so changing the readme might be a good idea.

Feel free to re-open the issue if this doesn't answer what you asked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants