private async resolvePath()

in src/configurationProvider.ts [391:423]


    private async resolvePath(folder: vscode.WorkspaceFolder | undefined, pathArray: string[], mainClass: string,
                              projectName: string, isModulePath: boolean): Promise<string[]> {
        if (_.isEmpty(pathArray)) {
            return [];
        }

        const pathVariables: string[] = [ClasspathVariable.Auto, ClasspathVariable.Runtime, ClasspathVariable.Test];
        const containedVariables: string[] = pathArray.filter((cp: string) => pathVariables.includes(cp));
        if (_.isEmpty(containedVariables)) {
            return this.filterExcluded(folder, pathArray);
        }

        const scope: string | undefined = this.mergeScope(containedVariables);
        const response: any[] = <any[]> await lsPlugin.resolveClasspath(mainClass, projectName, scope);
        const resolvedPaths: string[] = isModulePath ? response?.[0] : response?.[1];
        if (!resolvedPaths) {
            // tslint:disable-next-line:no-console
            console.log("The Java Language Server failed to resolve the classpaths/modulepaths");
        }
        const paths: string[] = [];
        let replaced: boolean = false;
        for (const p of pathArray) {
            if (pathVariables.includes(p)) {
                if (!replaced) {
                    paths.push(...resolvedPaths);
                    replaced = true;
                }
                continue;
            }
            paths.push(p);
        }
        return this.filterExcluded(folder, paths);
    }