Skip to content

feat: provide a versioned IDE model and pre-build compile database #371

Description

@wellwei

Motivation

mcpp currently writes a useful compile database only after a successful build. This creates a bootstrap problem for IDE users: clangd needs accurate project, dependency and module flags while the source is still incomplete, before the first build can succeed.

A compile database alone also cannot describe workspace members, selected configuration, artifact freshness or structured failures to IDE clients.

Proposed scope

  • Add a versioned, machine-readable IDE snapshot for workspace/member discovery and diagnostics.
  • Add a configure operation that resolves the real BuildPlan and publishes a fresh CDB before ordinary project compilation or linking.
  • Include discovered test translation units and their development dependency context.
  • Publish structured NDJSON lifecycle events and stable project/configuration/snapshot identities.
  • Preserve the previous usable CDB when staging or publication fails.
  • Keep a root compile_commands.json compatibility projection for existing clangd integrations.
  • Document which lifecycle behavior belongs to IDE clients, including file watching, workspace fan-out, stale fallback and module-pending state.

Non-goals for the first version

  • Building every uncached project or dependency BMI during IDE discovery.
  • A persistent daemon, cancellation protocol or full workspace configure fan-out.
  • Replacing clangd or promising cross-toolchain BMI compatibility.

Acceptance criteria

  • mcpp ide snapshot --format json is read-only and reports schema-versioned workspace/artifact state.
  • mcpp ide configure --format ndjson can publish a usable CDB before a successful normal build.
  • Configure does not compile ordinary project translation units or link final targets.
  • CDB generation covers normal and test sources and reports actionable structured failures.
  • Publication behavior is covered by unit tests and macOS/Linux/Windows CI paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions