Skip to content
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

Debug Console in VS Code with Java support erroneously splits lines in output for sysout.printf/format #872

Closed
vitrums opened this issue Apr 9, 2019 · 1 comment

Comments

@vitrums
Copy link

vitrums commented Apr 9, 2019

The question is already on stackoverflow: https://stackoverflow.com/questions/55588019/debug-console-in-vs-code-with-java-support-erroneously-splits-lines-in-output-fo. However this looks more like an issue with RedHat's language support for Java and therefore the question might as well belong here.

Basically System.out.format() and System.out.printf() split lines in unexpected positions and also treat %n inconsistently. From run to run it produces different results. Therefore notice, that the Current Result provided here is just one of many possible random outcomes.

Environment
  • Operating System: Windows 10 x64
  • JDK version: 1.8.0_181
  • Visual Studio Code version: 1.33.0 (user setup)
    Commit: 0dd516dd412d42323fc3464531b1c715d51c4c1a
    Date: 2019-04-04T15:14:28.026Z
    Electron: 3.1.6
    Chrome: 66.0.3359.181
    Node.js: 10.2.0
    V8: 6.6.346.32
    OS: Windows_NT x64 10.0.17134
  • Java extension version: Version: 0.6.0 (according to changelog)
Steps To Reproduce
  1. Create a file PrintfTest.java and open it with VS Code
  2. Run

PrintfTest.java:
import java.util.stream.IntStream;

public class PrintfTest {
public static void main(String[] args) {
IntStream.range(0, 10).forEach(it ->
System.out.format("This is iteration %d. Hello VS Code! Hello RedHat!%n", it));
}
}

Current Result

This is iteration
0. Hello VS Code! Hello RedHat!
This is iteration 1. Hello VS Code! Hello RedHat!
This is iteration 2. Hello VS Code! Hello RedHat!
This is iteration 3. Hello VS Code! Hello RedHat!
This is iteration
4. Hello VS Code! Hello RedHat!
This is iteration
5
. Hello VS Code! Hello RedHat!
This is iteration
6. Hello VS Code! Hello RedHat!
This is iteration
6. Hello VS Code! Hello RedHat!
This is iteration
7
. Hello VS Code! Hello RedHat!
This is iteration 8. Hello VS Code! Hello RedHat!
This is iteration
9. Hello VS Code! Hello RedHat!

Expected Result

Just 10 solid lines like in any observable terminal or IDE's console?

Additional Informations

none

@fbricon
Copy link
Collaborator

fbricon commented Apr 9, 2019

Sorry but vscode-java is not providing launching/debugging support itself. This done by the Microsoft's vscode-java-debug extension. Please open a ticket in https://github.com/Microsoft/vscode-java-debug/issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants