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

Can't have function which takes an attrset as an argument defined on same line as opening { in attrset #2

Open
LisannaAtHome opened this issue Nov 15, 2017 · 1 comment

Comments

@LisannaAtHome
Copy link

The issue is visible here: https://imgur.com/a/FBy9Q

When defining an attrset, if one of the elements of the attrset is a function which itself takes an attrset, putting it on the same line as the opening { of the attrset (common Nix style) causes red highlighting.

Workaround for hetergeneous attrsets: have the first element listed not be a function.
Workaround for homogenous attrsets of functions: add a newline between the opening { and the next element.

@msteen
Copy link

msteen commented Mar 13, 2020

Considering GitHub uses pretty much the same syntax highlighter, here you can see another case were this goes wrong:

{ sourcePort = 80; destination = "${test}:80"; proto = "both"; }

It seems to couple the closing brace to greedy to the attrset.

{ sourcePort = 80; destination = "${test:80"; proto = "both"; }

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

No branches or pull requests

2 participants