Fix indentation rules
mmm that sucks. Seems like this works with vscode insiders but not the last official release. @snjeza can you double check that please?
Looks like the same issue exists in typescript in the last vscode release. Works with insiders (I'm using the same patterns). So I'd say, we ship it anyway. It'll be available to users on regular vscode in early November.
I can also reproduce the issue with code-insiders-1.29.0. I have tested on Windows and Linux.
Version: 1.29.0-insider (system setup) Commit: 2b06dd1ca31e407abed24f65e1804ae86180401d Date: 2018-10-30T11:12:35.070Z Electron: 2.0.12 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 Architecture: x64
The issue can't be reproduced if we exclude the Java extension.
@snjeza FYI I opened https://github.com/Microsoft/vscode/issues/62198 upstream
@snjeza I'm taking another shot at this old issue, it seems to work now. Please review.
@snjeza let me know if you can't review this PR, I'll ask someone else
I still can reproduce the problem.
https://github.com/user-attachments/assets/3ccfca01-0de7-402c-b601-525af14b8841
damn, works for me
wait your gif shows the problem is fixed on Java (yeah!), not typescript (we don't care). On the same vscode version, it also works for me on typescript.
@fbricon could you try the following code:
public class E1 {
void test() {
if (true)
System.out.println("hello");
line1;
line2;
}
}
and call moveLinesUpAction on line2
OK so if the line under the if is not indented, moving line 2 up de-increments it, which is not happening with this PR.
So we'd be swapping the bug from it's happening if line under if is incremented, to it's happening if line under it is not incremented. BUT, in the meantime we gain better (de)increment on next line after brace-less ifs:
https://github.com/user-attachments/assets/849d6162-db7f-4971-b0bd-68a519f18728
So still better than the existing IMO