-
Notifications
You must be signed in to change notification settings - Fork 636
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
Rule to indent multiline strings #243
Comments
@hartbit sorry for not responding earlier. Seems like a reasonable feature - would you be interested in creating a PR? |
I have very little left for Open Source contributions :-( I'll have a look but I can't promise anything. |
Also note that indentation inside the multiline string should be preserved. For example: let sql = """
SELECT *
FROM authors,
books
WHERE authors.name LIKE '%David%'
AND pubdate < $1
""" |
@neilt yes, that logic is already in place. The SwiftFormat tokenizer actually bakes the relative indent into the string tokens themselves, so as long as the string lines are all given the same indent, the relative indent will be correctly preserved. |
Hello there 👋
+++ let sql = """
--- let sql =
--- """
SELECT *
FROM authors,
books
WHERE authors.name LIKE '%David%'
AND pubdate < $1
""" |
@facumenzella my understanding of the feature request was that it should convert: let sql = """
SELECT *
FROM authors,
books
WHERE authors.name LIKE '%David%'
AND pubdate < $1
""" to: let sql = """
SELECT *
FROM authors,
books
WHERE authors.name LIKE '%David%'
AND pubdate < $1
""" Which I think should not be a new rule, but a configuration option like Unwrapping the |
@hartbit implemented in 0.49.0 |
It would be nice to have a rule to indent multiline strings from:
into
It seems to be the style most often used in the community too.
The text was updated successfully, but these errors were encountered: