如何在vscode中获得量角器或json intellisense

时间:2017-11-13 09:00:04

标签: json protractor visual-studio-code

如何将量角器智能感知到视觉工作室代码, 当我进入浏览器时,我没有得到所有可用的方法相关的量角器浏览器对象。但是当我手动输入方法时,它运行正常。 我已经安装了所有必需的包(package.json),如下所示

public class NumberSorter {

    public static void main(String[] args) throws Exception {
        double sum = 0;
        double avg = 0;
        double total = 0;
        int i = 0;
        int[] data_array = new int[12];
        java.io.File file = new java.io.File("numbers.txt");
        Scanner input = new Scanner(file);

        while (input.hasNext()) {
            data_array[i] = input.nextInt();
            //add to the sum variable to get the total value of all the numbers
            sum += data_array[i];
            total++;
            //increment the position of 'i' each time
            i++;
        }
        //only sort the array after you have all the elements
        sortArray(data_array);

        //gets the average of all elements of the array
        avg = sum / total;

        java.io.FileWriter fr = new java.io.FileWriter("dataout.txt");
        BufferedWriter br = new BufferedWriter(fr);
        try (PrintWriter output = new PrintWriter(br)) {
            for (int j = 0; j < data_array.length; j++) {
                //write each element plus a new line
                output.write(data_array[j] + "\r\n");
            }
            //write the average (to two decimal places - plus it doesn't allow
            //you to write doubles directly anyway) to the file
            output.write(String.format("%.2f", avg));
            output.close();
        }
    }

    public static void sortArray(int[] data_array) {
        Arrays.sort(data_array);
    }
}

甚至安装了一个vscode扩展程序&#34;量角器片段&#34;,但没有运气...... 需要一些指导或我需要遵循的任何具体步骤才能将量角器智能感知转换为vscode。与json解析相同的问题......

1 个答案:

答案 0 :(得分:1)

我必须创建一个global.t.ds文件,以便用intellisense装饰保护程序全局变量:

https://bitbucket.org/krewmarco/protractor-vscode-intellisense/src/master/

intellisense on browser object