Skip to content

Fix compilation-find-file advice for dirs without direct files#1982

Merged
bbatsov merged 1 commit intomasterfrom
feature/1923-compilation-search-path
Mar 5, 2026
Merged

Fix compilation-find-file advice for dirs without direct files#1982
bbatsov merged 1 commit intomasterfrom
feature/1923-compilation-search-path

Conversation

@bbatsov
Copy link
Copy Markdown
Owner

@bbatsov bbatsov commented Feb 15, 2026

  • The compilation-find-file advice now also resolves filenames relative to the project root, adding the parent directory to the search path when found
  • This fixes the edge case where a directory contains only subdirectories (no files directly), so it wasn't included in the file-derived directory list from projectile-current-project-dirs
  • The fix is lightweight — a single file-exists-p check — avoiding the performance cost of a full recursive directory scan

Fixes #1923

Fixes #1923

When compilation output references a file via a relative path, the
advice now also checks if the file exists relative to the project root
and adds its parent directory to the search path. This handles the
edge case where a directory only contains subdirectories (no files
directly) and therefore was not included in the file-derived directory
list from projectile-current-project-dirs.
@bbatsov bbatsov merged commit 136a1e6 into master Mar 5, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compilation buffer edge case not covered by "compilation-find-file-projectile-find-compilation-buffer" advice

1 participant