-
-
Notifications
You must be signed in to change notification settings - Fork 89
-
-
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
Code inside interpolated raw literals is not formatted #1308
Comments
RReverser
added a commit
to clockworklabs/SpacetimeDB
that referenced
this issue
Jul 29, 2024
Raw string literals automatically ignore indentation and can be correctly auto-formatted (although there are still some issues, eg belav/csharpier#1308), which makes them more suitable for multiline templates.
2 tasks
Yeah looks like it's not just nested raw literals; no formatting whatsoever currently happens inside interpolated raw strings. An even simpler example: var extensions =
$$"""
{{
foo
.bar
.baz(
)
}}
"""; |
RReverser
changed the title
Nested raw literals are not reindented
Code inside interpolated raw literals is not formatted
Aug 6, 2024
Ah and now that I figured it's a general issue, I can see it's a duplicate of #1136, so closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Input:
Minimal repro:
Output:
Expected behavior:
I saw that raw string literal formatting was implemented in #975 / #977, but for some reason it breaks when there are nested raw literals like in the example above (those are fairly common in complex codebase).
I'd expect those strings to be reindented just like they're when no nesting occurs, probably to something like this:
The text was updated successfully, but these errors were encountered: