kyu08 / fzf-make

A command line tool that executes make target using fuzzy finder with preview window.
MIT License
77 stars 10 forks source link

Subscripts detected as runnable targets #236

Closed Sigmanificient closed 6 months ago

Sigmanificient commented 6 months ago

Hi, I tried to run fzf-make on the glibc repos to get a better overview of the monster that is the Master Makefile for the GNU C library (yes this boi is 23k lines long). I was surprised that it even opened the preview window under 2s, (still very laggy but hey, that's a real stress test, to say the least)!

image

Here is a minimal example to reproduce this issue:

.PHONY: real_rule
real_rule:
    echo "good"

define my_script
#!/bin/bash

echo "this is a trap: not good"
endef

Skipping defines blocks would help to filter these lines easily image

kyu08 commented 6 months ago

@Sigmanificient

Thank you for letting me know the issue and take time to report!

For now, the extraction of the target is done by reading the contents of the Makefile line by line, but it seems that it can be avoided by excluding irrelevant lines such as defines blocks before extracting the target.

Thank you for always reporting the issue in detail!