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

fix: filetype patterns with wildcards #1

Closed
WieeRd opened this issue Aug 20, 2024 · 2 comments
Closed

fix: filetype patterns with wildcards #1

WieeRd opened this issue Aug 20, 2024 · 2 comments
Labels
upstream Not my fault

Comments

@WieeRd
Copy link
Owner

WieeRd commented Aug 20, 2024

Problem

While inspecting the generated filetype:servers mapping, I realized there are servers with * wildcards in their filetype patterns.

return {
  filetype_servers = {
    ["*"] = { "typos_lsp" },
    ["*.hl"] = { "hyprls" },
    [".config/hypr/*.conf"] = { "hyprls" },
    ["hypr*.conf"] = { "hyprls" },
  },
}

auto-lsp.nvim cannot deal with these as the filetype lookup is done through simple table indexing.

Solution

  • Investigate upstream and find out why exactly those patterns are required.
  • Scan through the entire mapping every time.
  • Register separate autocmds just for each of those filetypes with wildcards.
@WieeRd WieeRd added the bug Something isn't working label Aug 20, 2024
@WieeRd
Copy link
Owner Author

WieeRd commented Aug 20, 2024

They were mistakes from upstream.

typos_lsp

The * filetype is unnecessary. Generic servers can just omit filetypes field completely, and lspconfig will launch them upon BufReadPost instead of FileType.

hyprls

hyprland-community/hyprls#11 (comment)

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

It was a mistake, and the filetypes with wildcards can be removed completely.

@WieeRd WieeRd added upstream Not my fault and removed bug Something isn't working labels Aug 20, 2024
@WieeRd
Copy link
Owner Author

WieeRd commented Aug 20, 2024

@WieeRd WieeRd closed this as completed Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Not my fault
Projects
None yet
Development

No branches or pull requests

1 participant