Open k3yss opened 3 weeks ago
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 fornixd
.
The solution LGTM, I kindly ask what is that "required data structure"?
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: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.Custom Flake Handling:
devenv
uses its own version of nix and a custom implementation of the flake (.devenv.flake.nix
). The defaultbuiltins.getFlake
doesn't work with this setup, so we need an alternative method to parse this flake.Custom Option Completion: While the current implementation works in case of the default
devenv
options, but in case we are defining custom option in thedevenv.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 fornixd
.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