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

feat(findNvim)!: rename paths:string[] => cmds:string[][] #432

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justinmk
Copy link
Member

@justinmk justinmk commented Oct 21, 2024

todo

  • ergonomics?
  • normalization of paths?
  • string[][] or Map<string[]> ?
  • NvimVersion.cmd ?

Problem

Consumers like vscode-neovim/vscode-neovim#2287 can't send a full command which represents "nvim". It can only send a location (arg0) or directory.

But such consumers want to invoke Nvim in WSL, which requires extra preamble before the nvim.exe part:

https://github.com/vscode-neovim/vscode-neovim/blob/c3e8387a9e9f923ec39c28af6cb8985ca431e438/src/main_controller.ts#L181-L186

if (config.useWsl) {
    args.push("C:\\Windows\\system32\\wsl.exe");
    if (config.wslDistribution.length) {
        args.push("-d", config.wslDistribution);
    }
}

Solution

node-client doesn't need to know about WSL, it just needs to run what the consumer gives it. Currently the consumer can only send arg0, but we can fix that by allowing consumers to send [arg0, arg1, ...].

  • Change findNvim to accept cmds: string[][], so that consumers can pass a command like:
    findNvim(..., {
     cmds: [
       ['C:\\Windows\\system32\\wsl.exe', '-d', ..., 'nvim'],
     ],
    })
  • Drop the paths:string[] option. It's redundant with cmds.

fix #430

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

Successfully merging this pull request may close these issues.

findNvim: support finding nvim in Windows WSL
1 participant