warp icon indicating copy to clipboard operation
warp copied to clipboard

Autocomplete for make doesn't work when Makefile uses `include`

Open sarvesh4396 opened this issue 6 months ago • 3 comments

Pre-submit Checks

Describe the bug

When a Makefile splits targets across multiple files using include, Warp's autocomplete only shows targets defined directly in the root Makefile. Targets in included files are invisible to it.

Same setup in VS Code terminal (zsh): Tab completion correctly shows all targets including from included files. It works.

To reproduce

Root Makefile:

include makefiles/main.mk
include makefiles/experiment.mk

help:
    @echo "root"

makefiles/main.mk


up-main:
    docker compose up -d

down-main:
    docker compose down

Type make + Tab in Warp → only help is suggested, not up-main or down-main.

Expected behavior

All targets from included files should appear, since make treats them as one unified ruleset.

Screenshots, videos, and logs

No response

Operating system (OS)

macOS

Operating system and version

Tahoe - Version 26.3.1

Shell Version

zsh 5.9 (arm64-apple-darwin25.0)

Current Warp version

v0.2026.05.06.15.42.stable_05

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

No

Is this an issue only in Warp?

Yes, I confirmed that this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

sarvesh4396 avatar May 26 '26 19:05 sarvesh4396

@sarvesh4396

Here's what I found while triaging this issue:

Thanks for the detailed repro. The current make target completion path appears to scan only the top-level Makefile, so targets defined only in included files would be missed.

Maintainer details

I concluded that warp's make target autocomplete appears to miss targets declared in Makefile files reached through include directives because its target generator scans only the top-level Makefile content..

Triage summary

This looks like a reproducible completions bug for make target suggestions when a project splits targets across files with Makefile include directives. The reporter provided a minimal layout where help is in the root Makefile and up-main / down-main are in an included makefiles/main.mk; Warp only suggests the root target.

Reproducibility

High. The report includes concrete repro files, the exact completion action, macOS + zsh environment details, a current Warp stable version, and confirmation that shell completion in another terminal sees the included targets.

Likely root cause

Warp's Rust completer executes command-signature generators at the session working directory and post-processes their output. The embedded make command signature maps target completion to the external command-signatures list_targets generator, whose implementation runs cat [Mm]akefile and regex-parses that single file. Because this path reads only the root Makefile content, it never follows include makefiles/main.mk / include makefiles/experiment.mk, so targets defined only in those files cannot be suggested.

A likely fix should update the make target generator to derive targets from GNU make's resolved database (for example, a safe make query mode) or recursively parse supported include directives with the same working-directory semantics as make, rather than scanning only [Mm]akefile.

Duplicate check

I searched open issues and recently closed issues for Makefile / make target autocomplete and include-related reports. I did not find two or more likely duplicates, so this should remain a standalone issue.

This is my automated analysis and may be incorrect. A maintainer will verify the details.

Powered by Oz

warp-for-oss[bot] avatar May 26 '26 19:05 warp-for-oss[bot]

This issue has been labeled ready-to-implement and is open for contributions involving code changes. If you'd like to tackle it, feel free to open a pull request against this issue. You can also comment @oz-agent on this issue to have the bot draft an implementation PR automatically.

warp-for-oss[bot] avatar May 27 '26 03:05 warp-for-oss[bot]

Thanks for the report. This is ready to implement.

kevinchevalier avatar May 27 '26 03:05 kevinchevalier

Picking this up. The fix lives in the warpdotdev/command-signatures repo rather than here — the make list_targets generator (command-signatures/src/generators/make.rs) runs cat [Mm]akefile, which only reads the top-level Makefile and never follows include directives. I'm preparing a PR there that resolves include/-include/sinclude (recursively, with cycle protection) so targets defined in included files show up. Will link it here once it's open.

maxmilian avatar May 29 '26 03:05 maxmilian

Opened the fix in the command-signatures repo: warpdotdev/command-signatures#275. It follows include/-include/sinclude (recursively, with cycle protection) so targets from included files are completed, and keeps the parsing inside a single awk program so behavior is consistent across shells. Local fmt/clippy/test pass; the PR's own CI is currently waiting on a maintainer to approve the workflow run (first-time contributor).

maxmilian avatar May 29 '26 03:05 maxmilian