Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bartelmarkus opened this issue Jan 10, 2025 · 0 comments

Comments

@bartelmarkus
Copy link

bartelmarkus commented Jan 10, 2025

The advice compilation-find-file-projectile-find-compilation-buffer tries to add all directories inside of the project to the compilation-search-path if compilation-find-file did not yield a result by its native implementation.
It does so by indirectly calling projectile-project-dirs:

https://github.com/bbatsov/projectile/blob/0404b9b6eeb0c6504337749a366fffd97de2bfbe/projectile.el#L2180C8-L2185

But the issue is this:
Mapping file-name-directory onto all project files that are actual files and no directories logically implies that directories not containing true files by themselves are not found and hence not added to the compilation-search-path.

Expected behavior

When I go into a compilation buffer and I click onto a file path that needs to be found inside a directory that by itself only contains other directories and no files, the file is found.

Actual behavior

When I go into a compilation buffer and I click onto a file path that needs to be found inside a directory that by itself only contains other directories and no files, the file is unfortunately not found by projectile and compilation-find-file falls back to prompting the user.

Steps to reproduce the problem

  • Open a project that contains program files nested inside a directory only containing other directories
  • Open a compilation buffer while the aforementioned project is being set as the projectile root (or opening a ficticious compilation output and setting M-x compilation-mode)
  • Click on a file path that is displayed relative to the directory that doesn't contain files, only other directories

Environment & Version information

  • Doom Emacs v3.0.0-pre
  • fd 10.2.0

Projectile version information

Projectile version: 2.9.0-snapshot

Emacs version

GNU Emacs 29.4 (build 2, x86_64-w64-mingw32) of 2024-07-05

Operating system

Windows 11

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

No branches or pull requests

1 participant