Skip to content

Issues not Reported after Import #4230

Description

@tsmaeder

I suspect that we're underreporting issues with project imports via telemetry. Here's a scenario:

  1. Clone the Apache Maven repo: https://github.com/apache/maven
  2. Open VS Code on the resulting folder
  3. Wait until project import has finished
  4. Observe: you get some problems reported in pom.xml files, but no "unresolved imports" in Java files
  5. Execute "Java: Rebuild Projects" and select all projects when asked
  6. Wait until the rebuild has finished
  7. Observe: you now get thousands of errors in Java files about imports that cannot be found. For example org.apache.maven.api.model.Plugin cannot be found in LifeCycle.java

Note that the import errors are correct: the problem I'm reporting is that when we report the telemetry event java.workspace.initialized, the problems are not yet present. This makes our numbers for successful import unreliable. In particular, they are probably worse than what we think.

Activity

  1. tsmaeder commented on Nov 4, 2025

    @tsmaeder
    ContributorAuthor
  2. rgrunber commented on Nov 4, 2025

    @rgrunber
    Member

    I see the 11k problems/error once the import finishes, without the need to do any additional builds. My autobuild is enabled (that's the default), but the only thing I can think of is I have java.configuration.updateBuildConfiguration set to automatic.

    The strange part (other than why isn't the import reporting everything the first time) is Lifecycle and Plugin are in the same source package. One can even go to the definition of Plugin from Lifecycle yet the diagnostics still report that the import cannot be resolved.

  3. fbricon commented on Nov 4, 2025

    @fbricon
    Collaborator

    Same here, problems are reported immediately after import. Most likely, the errors are caused by the missing m2eclipse-modello plugin, that would generate the missing classes via modello, during the build.

  4. fbricon commented on Nov 4, 2025

    @fbricon
    Collaborator

    @rgrunber are the telemetry-reported errors supposed to include project compilation errors?

  5. rgrunber commented on Nov 4, 2025

    @rgrunber
    Member

    Looking at the code, I think we count all unresolved imports anywhere in the discovered Java projects, as well as any errors on the "project folder" itself. We don't currently report the error message/trace (though maybe we'd want to). I think the build systems tend to report serious build errors on folders as well as on the build files (we don't count there currently) (pom.xml, build.gradle, etc.)

  6. tsmaeder commented on Nov 6, 2025

    @tsmaeder
    ContributorAuthor

    It seems that with autobuild on, the errors get reported eventually, However, the telemetry event still seems to report no import problems.

    When I run the attached extensions, I get the following telemetry report for the "maven" project:

    {
        "name": "java.workspace.initialized",
        "properties": {
            "project.projectErrorCount": "0",
            "project.unresolvedImportErrorCount": "0",
            "project.autobuild": "true",
            "project.jdkMismatch": "false",
            "buildToolNames": [
                "Maven"
            ],
            "javaProjectCount": 81,
            "javac.enabled": "false",
            "compiler.source.min": "17.0",
            "compiler.source.max": "17.0",
            "time.projectsinitialized": "2955",
            "time.serviceready": "3141",
            "time.buildFinished": "233904",
            "initialization.first": "false",
            "dependency.count": "146",
            "dependency.size": "51488316"
        }
    }
    
  7. tsmaeder commented on Nov 6, 2025

    @tsmaeder
    ContributorAuthor

    Here's the extension source:

    test-java-import.zip

  8. tsmaeder commented on Nov 10, 2025

    @tsmaeder
    ContributorAuthor

    @fbricon this PR (eclipse-jdtls/eclipse.jdt.ls#3589) delays reporting until the initial build is really finished for me.

  9. added this to the End November 2025 milestone on Nov 10, 2025
  10. fbricon commented on Nov 10, 2025

    @fbricon
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions