microsoft / microsoft/vscode-java-debug

Populate mainClass only from source folders

Open
#418 1 comment 0 reactions 1 assignee View on GitHub

@andxu is already working on this.

Since Sep 20, 2018.

ai-triaged enhancement launch
Dominant language
TypeScript
Stars
591
Forks
429
Avg merge
1d 9h
Merged PRs (30d)
19

Description

List main class from third-party jars is time-consuming and not very useful, consider to remove the logic like

      int constraints = IJavaSearchScope.SOURCES;
        constraints |= IJavaSearchScope.APPLICATION_LIBRARIES;
        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        List<IJavaElement> ret = new ArrayList<IJavaElement>();
        for(IProject proj : root.getProjects()) {
            IJavaProject javaProject = JavaCore.create(proj);
            try {
                IPackageFragmentRoot[] packageFragmentRoot = javaProject.getPackageFragmentRoots();

                for (int i = 0; i < packageFragmentRoot.length; i++) {
                    if (packageFragmentRoot[i].getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT && packageFragmentRoot[i].getKind() == IPackageFragmentRoot.K_SOURCE)
                        ret.add(packageFragmentRoot[i]);
                }
            } catch (JavaModelException e) {
                // ignore
            }

        }

        IJavaSearchScope scope = SearchEngine.createJavaSearchScope(ret.toArray(new IJavaElement[0]), constraints);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.