Skip to content

Support for just modules (mod import/declarations) in Projectile task detection #2158

Description

@libbrfish

Problem Description

Projectile's just integration currently fails to discover tasks defined inside just modules (files matching {prefix}.just or imported via mod {prefix} statements in a justfile). See https://just.systems/man/en/modules.html

Currently, task discovery only inspects the main justfile found at the project root, ignoring any modular just files linked or included.

Steps to Reproduce

Create a project root with a main justfile:

    mod foo

    default:
        @just --list

Create a module file in the root directory named foo.just:

    bar:
        @echo "Hello from foo module"

Run projectile-run-project.

Expected Behavior

Projectile should parse or merge tasks from both the main justfile and imported modules.

Actual Behavior

Projectile only detects tasks directly defined in the primary justfile.

Technical Context & Root Cause

Task detection currently relies on projectile--first-task-file to find a single entry-point file:

(file (projectile--first-task-file
       project-root projectile--justfile-names))

Because projectile--first-task-file stops at the first matching file, secondary module files (*.just) are never parsed.

Suggested Solution / Feature Request

Parse mod declarations inside the main justfile to discover and include referenced {prefix}.just files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions