Skip to content

Change root_dir to allow function, like lspconfig. #371

Closed
@magnusriga

Description

@magnusriga

copilot.nvim currently uses the current working directory at time of loading the plugin, as the root_dir for its language server (vim.loop.cwd()).

I was hoping to make it work like other language server configs defined by nvim-lspconfig, where a function is accepted as root_dir, which runs each time the LSP client attaches to a new buffer.

I tried passing a function to server_opts_overrides.root_dir, but this causes the plugin to crash.

Happy to add a PR, if helpful.

Thanks for the awesome work on this plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions