-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Spike on auto indentation #5821
Comments
|
Um, what is the purpose of this issue? Is it to basically bring issue #481 back to the forefront? Is the term "spike" here the same as (or perhaps a more forceful version of) what I've often seen as "bump" on various forums? I certainly would not mind if this was moved to the front burner. In particular, the "fix" for backslash line continuation is broken. Issues #4241 and #4563 deserve more attention. I think it is a fairly simple matter, actually. The on-Enter rule that was added to address #3284 was this (in extension.ts):
It has the fatal flaw that the regex is not tied to the end of the line. I think that whoever put this in (apparently proposed by @jakebailey) probably meant the regex to be
Technically, that is still wrong, because the Python interpreter doesn't allow whitespace after the line-continuation backslash. It would be more correct as
Since this is such a simple change and would save so many people the countless small headaches of unintended autoindentation after strings that contain backslash-escapes, I implore the powers that be to please give this some attention. |
@jkyeung Spikes are basically us putting in some research into how best to try and solve the problem. |
I took at look at the existing code. Without upstream vscode changes, there isn't a lot we can do there. Here's one rule we could add that might help a little with the indent of closing brackets: {
afterText: /^\s*[)}\]]/,
action: { indentAction: IndentAction.Outdent }
} |
#481
The text was updated successfully, but these errors were encountered: