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

When there are many lines of code, the button doesn't react. #172

Open
2catycm opened this issue Apr 15, 2022 · 7 comments
Open

When there are many lines of code, the button doesn't react. #172

2catycm opened this issue Apr 15, 2022 · 7 comments

Comments

@2catycm
Copy link

2catycm commented Apr 15, 2022

Example code I want to capture:

import java.util.Scanner;

public class HilbertCurve {
    public static int w[][] = {{0,0,0},
                               {0,1,4},
                               {0,2,3}};

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int x = in.nextInt();
        int y = in.nextInt();

        System.out.println(HilbertNumber(n, x, y));
        in.close();
    }

    public static long HilbertNumber(int n, int x, int y) {
        if (n == 1)
            return w[x][y];

        /*base code:
        * if (n == 0) return 1;
        * is better. because w1 can be divided to 1*1 squares */

        int m = 1 << (n - 1);
        if (x <= m) {
            if (y <= m) {
                return HilbertNumber(n - 1, y, x);//Part 1,coordinates offset:0; flip: x’ = y  y’=x�
            } else {
                return m * m + HilbertNumber(n - 1, x, y - m);//Part 2, coordinates offset: y-m �
            }
        } else {
            if (y > m) {
                return 2 * m * m + HilbertNumber(n - 1, x - m, y - m);//Part 3, coordinates offset: x-m y-m
            } else {
                return 3 * m * m + HilbertNumber(n - 1, m + 1 - y, m + 1 - (x - m));//Part4, coordinates offset: x=x-m; flip: x’ = m+1-y,  y’ = m+1-x�
            }
        }

    }
}

When I try to use the plugin, it does not react with the code above.
However, if I just select

public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int x = in.nextInt();
        int y = in.nextInt();

        System.out.println(HilbertNumber(n, x, y));
        in.close();
    }

It works.
VSCode settings:

Font size: 18
Font Family: Consolas, 'Courier New', monospace
theme: cyberpunk

VSCode version:

版本: 1.66.2 (user setup)
提交: dfd34e8260c270da74b5c2d86d61aee4b6d56977
日期: 2022-04-11T07:46:01.075Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Windows_NT x64 10.0.22000
@2catycm
Copy link
Author

2catycm commented Apr 15, 2022

image

@2catycm
Copy link
Author

2catycm commented Apr 15, 2022

image

@2catycm
Copy link
Author

2catycm commented Apr 15, 2022

I didn't see a issue like this, and I didn't see a documentation that says too many lines of code is not supported, so I wonder if this is a bug.

@rictt
Copy link

rictt commented May 19, 2022

i have the same problem.

@SlavenDj
Copy link

I was testing something, and found out %10.2 makes that bug in print fun. Try deleting line by line to see what the problem is. Taking a screenshot of the preview is the only solution right now. I feel like this extension is discontinued.

@2catycm
Copy link
Author

2catycm commented Aug 23, 2022 via email

@SlavenDj
Copy link

SlavenDj commented Aug 23, 2022

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

No branches or pull requests

3 participants