Skip to content

Add IncrementalContextNoop #3028

Open

Description

@jaschdoc

This class should be used whenever KSP is not run in incremental mode. Doing so removes the need to check for isIncremental in a lot of functions which is error prone. This same could probably be done for the incremental logging functions.

This issue is somewhat related to the fact that the internal functions used in KSP to record lookups for incremental compilation / processing all directly reference the Resolver instance instead of carrying the Resolver as a (context) parameter. Additionally, the resolver should not be the globally reference class / object, and instead there should be a configuration parameter passed around (again, context parameters would be ideal for this). This might also solve some of the multi-threading issues or make them easier for fix.

Not related to this issue, but would it be worth creating a IncrementalContextNoop implementation for when isIncremental is false, rather than including this at the top of every function?

Originally posted by @bcorso in #3013

Activity

  1. added theissue type on Jul 9, 2026
  2. added
    enhancementNew feature or request
    P4lower priority; no milestone yet
    apiAPI changes may be involved
    coreIssues related to the core implementation of KSP API.
    incrementalIssues around incremental processing
    on Jul 9, 2026
  3. RotBolt commented on Oct 12, 2026

    @RotBolt

    Hi, I would like to contribute a solution to this issue. Could you please assign it to @RotBolt if it is available? Before implementing, I would like to agree on the scope: introduce a no-op incremental context for non-incremental runs, preserve existing behavior, and add coverage for incremental and non-incremental processing. Should the resolver/context-parameter and logging refactors be kept as separate follow-ups?

  4. RotBolt commented on Oct 15, 2026

    @RotBolt

    Following up on my earlier request: I am still available to take this on. Could a maintainer assign #3028 to @RotBolt and confirm the proposed scope (a no-op context for non-incremental runs, with resolver/logging refactors deferred separately)? Happy to proceed once the direction is confirmed.

  5. jaschdoc commented on Oct 16, 2026

    @jaschdoc
    CollaboratorAuthor

    Hi @RotBolt that sounds great! Let's start by extracting the public API of IncrementalContextAA and IncrementalContextBase into an interface and replacing references to either of those with the interface.

  6. RotBolt commented on Oct 29, 2026

    @RotBolt

    Thanks @jaschdoc will work on this

  7. RotBolt commented on Oct 29, 2026

    @RotBolt

    @jaschdoc Opened #3284 with the interface extraction you requested: lifecycle and lookup APIs now use IncrementalContext, while the AA implementation and incremental behavior remain unchanged. Existing lookup tracing is preserved pending #3019. Added interface-level lifecycle/exception tests; the full kotlin-analysis-api test task passes (659 passed, 8 skipped). Could you please review this first step before I proceed with the no-op implementation?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4lower priority; no milestone yetapiAPI changes may be involvedcoreIssues related to the core implementation of KSP API.enhancementNew feature or requestincrementalIssues around incremental processing

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions