Title: Find main classes in projects whose sources are linked in by sorteam · Pull Request #633 · microsoft/java-debug · GitHub
Open Graph Title: Find main classes in projects whose sources are linked in by sorteam · Pull Request #633 · microsoft/java-debug
X Title: Find main classes in projects whose sources are linked in by sorteam · Pull Request #633 · microsoft/java-debug
Description: ResolveMainClassHandler.resolveMainClassUnderPaths builds the search scope by keeping only the projects whose own location is inside the requested folder: projects = Stream.of(ProjectUtils.getAllProjects()) .filter(p -> ProjectUtils.isJavaProject(p) && p.getLocation() != null && ResourceUtils.isContainedIn(p.getLocation(), parentPaths)) A project can instead keep its description outside that folder and reach the sources through linked folders. Such a project is dropped before the search runs, so the folder looks as if it contained no main class: Run and Debug generates no Java configuration for it (the launch configuration provider calls vscode.java.resolveMainClass(folder.uri)), and anything else that resolves a main class by folder gets an empty answer. The code already knows about this shape. acceptSearchMatch makes an exception for the invisible project: if (parentPaths.isEmpty() || ResourceUtils.isContainedIn(project.getLocation(), parentPaths) || isContainedInInvisibleProject(project, parentPaths)) { but the scope filter it depends on has no such exception, so the invisible-project branch can never fire - the project is not in the scope to begin with. Fix Check the locations of the project's source folders as well, in both places: for each source entry of the raw classpath, resolve the workspace path through IWorkspaceRoot.findMember and compare that location against the requested folders. A project belongs to the folder its sources are in rather than to the folder its description happens to live in. Reproduction Create a java project whose source folders are linked resources pointing into a workspace folder, with the project's own location elsewhere (any importer that provisions projects outside the repository does this; the invisible project is a one-link special case of it). Open the workspace folder and note that Run and Debug offers no Java configuration, while the same sources in a regular project do. Verification I compiled the modified class against the plugin jar shipped in vscjava.vscode-java-debug 0.59.0 and the jdt.ls plugins from redhat.java. I have not run the project's Maven build or test suite.
Open Graph Description: ResolveMainClassHandler.resolveMainClassUnderPaths builds the search scope by keeping only the projects whose own location is inside the requested folder: projects = Stream.of(ProjectUtils.getAllPr...
X Description: ResolveMainClassHandler.resolveMainClassUnderPaths builds the search scope by keeping only the projects whose own location is inside the requested folder: projects = Stream.of(ProjectUtils.getAllPr...
Opengraph URL: https://github.com/microsoft/java-debug/pull/633
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:335d0280-3f78-cabd-e9ee-e19ea112be63 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E52A:35FC69:10ABE:16360:6AF67586 |
| html-safe-nonce | 283fabf525564a40fc6ca24d7221c792e87f80065fa92ccff080b95ab38d6b91 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTJBOjM1RkM2OToxMEFCRToxNjM2MDo2QUY2NzU4NiIsInZpc2l0b3JfaWQiOiI2Mjc1NTI2OTY0NTI2MDg1NTEwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4812373ed56d653017e64f85b20f46a58d4519b059fc7e30ae841796004f80d9 |
| hovercard-subject-tag | pull_request:4444506801 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/microsoft/java-debug/pull/633/files |
| twitter:image | https://avatars.githubusercontent.com/u/15554297?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/15554297?s=400&v=4 |
| og:image:alt | ResolveMainClassHandler.resolveMainClassUnderPaths builds the search scope by keeping only the projects whose own location is inside the requested folder: projects = Stream.of(ProjectUtils.getAllPr... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5451898e13f81636602c8a1de0fb8d7190b7b2a473a9f8241168fd4dd110372e |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/microsoft/java-debug git https://github.com/microsoft/java-debug.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 102583752 |
| octolytics-dimension-repository_nwo | microsoft/java-debug |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 102583752 |
| octolytics-dimension-repository_network_root_nwo | microsoft/java-debug |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8ba36e600310e0a3f7f56ea2244ea1240ea62bbf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width