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

consider cue fmt behaviour for multi-line string indentation #2150

Open
kghenderson opened this issue Nov 26, 2022 · 0 comments
Open

consider cue fmt behaviour for multi-line string indentation #2150

kghenderson opened this issue Nov 26, 2022 · 0 comments
Labels
fmt Related to formatting functionality. Triage Requires triage/attention

Comments

@kghenderson
Copy link

kghenderson commented Nov 26, 2022

not sure how to file this, but capturing.

currently the cue fmt utility will indent the closing triple-quote for a multi-line string, e.g.

Thing: MyValue: ###""" 
Stuff
"""###
}

will be shifted to:

Thing: MyValue: ###""" 
    Stuff
    """###
}

^ notice the closing quote and string body is now tab indented.

this can be problematic for users, including myself, who are copy/pasting data between this cue file and some other system.
let's say excel ... that you copy/paste the value from an excel field into here, then save or run your script (which probably format), and now it's not what you pasted anymore, but you make some edits in your cue ide of choice, then copy & paste it back ... well ... that's a whole can a problems ... but say it works, then you copy/paste it back ... well, maybe it's not valid any more since the value now contains tabs which aren't allowed in your excel field (and for good reason). or ... maybe instead of excel it's a different editor which is 'kind' enough to convert your pasted tabs back into spaces ... so now when you paste it back into cue, you don't have a leading tab anymore so it's not valid and cue will error.

i agree the nesting looks nicer, but this is a total usability nightmare waiting to happen, so there needs to be some way to manage this behaviour.


also relates to:
#834
#1033
#1720

but this seems subtly different, maybe it's a request for an alternate syntax or requiring a raw string (to prevent escaping issues), a field attribute or something else.


also further compounded by: monogon-dev/intellij-cue#55

@kghenderson kghenderson added the Triage Requires triage/attention label Nov 26, 2022
@myitcv myitcv added zGarden fmt Related to formatting functionality. and removed zGarden labels Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fmt Related to formatting functionality. Triage Requires triage/attention
Projects
None yet
Development

No branches or pull requests

2 participants