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

Implementing LSP Features for devenv.sh #587

Closed
k3yss opened this issue Aug 21, 2024 · 3 comments
Closed

Implementing LSP Features for devenv.sh #587

k3yss opened this issue Aug 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@k3yss
Copy link

k3yss commented Aug 21, 2024

I've been working on implementing LSP features for devenv.sh and have submitted the following proof-of-concept PRs: PR 1 and PR 2. While the current implementation works, it has the following issues:

  1. Version Compatibility: The flake is fetched from the latest master branch. This approach can cause issues for users on older versions of devenv, as they won't receive the correct completions for their version.

  2. Custom Flake Handling: devenv uses its own version of nix and a custom implementation of the flake (.devenv.flake.nix). The default builtins.getFlake doesn't work with this setup, so we need an alternative method to parse this flake.

  3. Custom Option Completion: While the current implementation works in case of the default devenv options, but in case we are defining custom option in the devenv.nix file, it won't load. The only probable solution to this, is to parse the devenv flake (.devenv.flake.nix)

Desired Solution

After discussions with the maintainers of devenv, a probable solution has been identified:

  • Autocomplete Command: We could introduce a command, such as devenv autocomplete-options, that generates the required data structure for nixd.

  • Dynamic JSON Support: Another option discussed is enabling nixd to support a JSON format that could be generated dynamically and provided to the LSP.

pinging @domenkozar @sandydoo for their input on this discussion

@inclyc
Copy link
Member

inclyc commented Aug 27, 2024

I'm glad to accept PRs to get language support for devenv.

  • Another option discussed is enabling nixd to support a JSON format that could be generated dynamically and provided to the LSP.

I don't think it is a good idea to open general dynamic settings in configuration, otherwise finally we will invent a broken LISP interpreter. If this is necessary, then it should be devenv-specific at first.

  • We could introduce a command, such as devenv autocomplete-options, that generates the required data structure for nixd.

The solution LGTM, I kindly ask what is that "required data structure"?

@inclyc inclyc added the enhancement New feature or request label Sep 21, 2024
@inclyc
Copy link
Member

inclyc commented Oct 14, 2024

Kindly ping @domenkozar @sandydoo, this proposal is getting stuck for a while, would you like to take a look?

@k3yss
Copy link
Author

k3yss commented Oct 14, 2024

Sorry, I forgot to close this. We are now working on our own implementation of a lsp as the current implementation doesn't aligns with the project goals.

@k3yss k3yss closed this as completed Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants