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

Fix and improve types for flake outputs #66

Merged
merged 3 commits into from
Mar 8, 2023
Merged

Fix and improve types for flake outputs #66

merged 3 commits into from
Mar 8, 2023

Conversation

figsoda
Copy link
Contributor

@figsoda figsoda commented Mar 8, 2023

nil was giving me questionable completions - packages.default is not supposed to be a derivation, packages.${system}.default is. This PR fixes this issue for packages and devShells, and also fixes and improves types for nixosConfigurations. I wasn't able to get completion working correctly, but that seems to be a separate issue since I also couldn't get inputs.*.inputs.* to complete follows

@oxalica
Copy link
Owner

oxalica commented Mar 8, 2023

I wasn't able to get completion working correctly, but that seems to be a separate issue since I also couldn't get inputs.*.inputs.* to complete follows

Because the rest type { _: ty } is not implemented yet, only types of constant keys are.

({ $($key:literal : $ty:tt),* $(,)? $(_ : $rest_ty:tt)? }) => {{
// TODO: Rest type.
$(let _ = ty!($rest_ty);)?
$crate::ty::Ty::Attrset($crate::ty::Attrset::from_internal([
$(($key, ty!($ty), $crate::ty::AttrSource::Unknown),)*
]))
}};

Nevertheless, this patch is good to have.

crates/ide/src/ty/known.rs Outdated Show resolved Hide resolved
@oxalica oxalica merged commit 267e2b4 into oxalica:main Mar 8, 2023
@figsoda figsoda deleted the flakes branch March 8, 2023 14:19
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.

2 participants