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

Expose per-server wrapper functions for use with nix-shell and guix #1933

Closed
leungbk opened this issue Jul 17, 2020 · 3 comments · Fixed by #4211
Closed

Expose per-server wrapper functions for use with nix-shell and guix #1933

leungbk opened this issue Jul 17, 2020 · 3 comments · Fixed by #4211

Comments

@leungbk
Copy link
Member

leungbk commented Jul 17, 2020

lsp-haskell currently exposes a defcustom, lsp-haskell-process-wrapper-function, to enable a convenient means of specifying a project-specific ghcide executable (for example). This is useful in Haskell since in order to work in a particular project with ghcide, it must be compiled with the exact same version of ghc as the one used to compile the project.

It wouldn't surprise me if some other language server behaved in a similar way. For this reason, it might be nice to expose separate wrappers, defaulting to #'identity, for each language server and debug adapter.

@leungbk leungbk changed the title Expose a per-server wrapper function for nix-shell and guix Expose a per-server wrapper function for use with nix-shell and guix Jul 18, 2020
@leungbk leungbk changed the title Expose a per-server wrapper function for use with nix-shell and guix Expose per-server wrapper functions for use with nix-shell and guix Jul 18, 2020
@ericdallo
Copy link
Member

As a NixOS user, I agree with that 😄

@yyoncho
Copy link
Member

yyoncho commented Jul 18, 2020

Can this be generalized and handle #1889 as well? Or both will serve a different purpose and will run at different time(flow one when resolving server binary, and this one just before running the server).

Also, we should think of generalizing lsp-register-client. What I wanted to implement in the past by converting lsp-register-client to macro but never had the time is:

  1. Auto-generate defcustoms for binaries and parameters. This will unify the experience and it will be easier to document the behaviour, e. g. we can have in lsp-mode docs something like "Go and change the variable lsp--binary-path and lsp--args if you want this and that'. Now we have multiple variables and overall inconsistent behaviour.

  2. Have language server specific hook which users could use to customize server specific behaviour. E. g. I would like to enable lenses for rust but hot have them in java.

  3. Have language server specific keymaps.

@leungbk
Copy link
Member Author

leungbk commented Jul 18, 2020

Can this be generalized and handle #1889 as well? Or both will serve a different purpose and will run at different time(flow one when resolving server binary, and this one just before running the server).

When using nix-shell, you're not expected (but are allowed) to specify the full path of the executable, since the full path looks like /nix/store/hash123abc/.... So I think for #1889 we might want a similar but separate wrapper, generated as part of your option 1.

Also, we should think of generalizing lsp-register-client. What I wanted to implement in the past by converting lsp-register-client to macro but never had the time is:

1. Auto-generate defcustoms for binaries and parameters. This will unify the experience and it will be easier to document the behaviour, e. g. we can have in lsp-mode docs something like "Go and change the variable lsp--binary-path and lsp--args if you want this and that'. Now we have multiple variables and overall inconsistent behaviour.

2. Have language server specific hook which users could use to customize server specific behaviour. E. g. I would like to enable lenses for rust but hot have them in java.

3. Have language server specific keymaps.

All of these sound useful. I had been intending to pursue option 1 for this issue.

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

Successfully merging a pull request may close this issue.

3 participants