-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Close parens on indented line #66
Comments
Hey @tclose, thanks for submitting an issue. Right now the code makes no distinction between function calls and other kinds of brackets ( variable = [|]
# goes to...
variable = [
|] |
This is actually related to #65 I think. If such an option were added, then we'd have to do more parsing to figure out if we were in the middle of an indent-increasing section so that we could add an extra level of indentation per PEP8. Examples adapted from PEP8: # Add 4 spaces (an extra level of indentation) to distinguish arguments from the rest
# (the next set of lines will be at a higher level of indentation).
def long_function_name(
var_one, var_two, var_three,
var_four):
print(var_one)
# Do NOT add 4 extra spaces
# (the next set of lines will be at the same level of indentation).
foo = long_function_name(
var_one, var_two,
var_three, var_four)
# Relatedly, I think we'd want to do similar behavior for things like "if"
if (
x in my_first_list_maker(arg1, arg2)
+ my_second_list_maker(arg3, arg4)):
print(x) |
Hi @tclose, there is a new option ( If you have problems, please submit a new issue. |
Thanks!
…On Wed, 26 Aug 2020 at 14:39, Kevin Rose ***@***.***> wrote:
Hi @tclose <https://github.com/tclose>, there is a new option (
keepHangingBracketOnLine) available in v1.11.0 of the extension for this
behavior. Please note that I bumped the required version of VSCode to the
most recent, so you'll have to be on an up-to-date VSCode to update the
extension.
If you have problems, please submit a new issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIBRFTQ6MXD7MXDTQXBNB3SCSGXHANCNFSM4P5X77QA>
.
--
*THOMAS G. CLOSE, PHD*
Imaging Informatics Officer
*Monash Biomedical Imaging*
Monash University
Room 139, 770 Blackburn Rd
Clayton Campus, Clayton VIC 3800
Australia
T: +61 3 9902 9804
M: +61 491 141 390
E: [email protected]
mbi.monash.edu.au
|
I cannot believe I am just discovering this setting now (because I've been using the extension pretty much since inception). But thank you! It's a game-changer for me. |
Just a matter of taste but I prefer to close parens at the end of the indented line instead of putting them on a new line, i.e.
instead of
It seems like it should be fairly easy to add a config setting to specify this (I could have a crack at it myself although I am not familiar with TS). Would this be desirable?
The text was updated successfully, but these errors were encountered: