-
Notifications
You must be signed in to change notification settings - Fork 89
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
Autocompletion from a contract computed by merging #1499
Comments
A variation of the above (let me know if you think it deserves its own issue) is completion based on field names for merged records. For instance
offers a completion for
|
Related: #1477. I think the current state of the semantics doesn't address this, and the semantics of completion for merging should be quite natural (probably |
My bad, it did address it already, I just hadn't seen the change. |
Is your feature request related to a problem? Please describe.
The Nickel lsp currently provides completion for field names when writing a record with a record contract. For instance:
will offer
abcde
as completion.However this only works if the contract is a record literal. For instance, there will be no completion for the snippet below:
Describe the solution you'd like
Allowing any kind of computation in the LSP is probably not a good idea, but ome heuristic to allow completion with contracts which are marginally more complex than a record literal would be very useful. In particular plain merging could be allowed here.
Describe alternatives you've considered
Not merging contracts. But that would make my life very painful. Or living without completion, but that would be sad too.
Additional context
https://github.com/nickel-lang/nickel-nix is making a heavy usage of merged contracts (all the builders and shells are defined with some variation of
Derivation & { some_extra_arg | Number, some_other_extra_arg | String }
), so this would be very valuableThe text was updated successfully, but these errors were encountered: