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

typos_lsp (potentially others): ignores root dir, when single_file_support = true #3201

Open
kmoschcau opened this issue Jun 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kmoschcau
Copy link

Description

When I open a file with typos_lsp set up for it, typos_lsp always starts in single file mode, even though root_dir returns a file path. I can only get typos_lsp to run with a root_dir, when I explicitly set single_file_support to false.

local common = require "lsp.common"
local lspconfig = require "lspconfig"

lspconfig.typos_lsp.setup {
  root_dir = function(fname)
    local root = lspconfig.util.root_pattern(
      "typos.toml",
      "_typos.toml",
      ".typos.toml",
      "pyproject.toml"
    )(fname)

    print(root, type(root)) --> /home/kmoschcau/.config/nvim string

    return root
  end,
  single_file_support = false,
  capabilities = common.capabilities,
  handlers = common.handlers,
}

I only realized this, because typos_lsp does not take its config file into account, when it runs in single file mode.

@kmoschcau kmoschcau added the bug Something isn't working label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant