vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Fix indentation rules

Open fbricon opened this issue 7 years ago • 4 comments

... by copying the ones used for js/ts.

Fixes #692

fbricon avatar Oct 29 '18 22:10 fbricon

mmm that sucks. Seems like this works with vscode insiders but not the last official release. @snjeza can you double check that please?

fbricon avatar Oct 30 '18 15:10 fbricon

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.

fbricon avatar Oct 30 '18 15:10 fbricon

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 avatar Oct 30 '18 16:10 snjeza

@snjeza FYI I opened https://github.com/Microsoft/vscode/issues/62198 upstream

fbricon avatar Oct 30 '18 20:10 fbricon

@snjeza I'm taking another shot at this old issue, it seems to work now. Please review.

fbricon avatar Nov 10 '25 10:11 fbricon

@snjeza let me know if you can't review this PR, I'll ask someone else

fbricon avatar Nov 18 '25 15:11 fbricon

I still can reproduce the problem.

https://github.com/user-attachments/assets/3ccfca01-0de7-402c-b601-525af14b8841

snjeza avatar Nov 18 '25 17:11 snjeza

damn, works for me move-lines

fbricon avatar Nov 18 '25 17:11 fbricon

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 avatar Nov 18 '25 17:11 fbricon

@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

snjeza avatar Nov 18 '25 17:11 snjeza

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

fbricon avatar Nov 18 '25 18:11 fbricon