`:GrugFarWithin` doesn't work with astgrep-rules
Selecting a range, running `:GrugFarWithin`, and switching to astgrep-rules produces the following output:
```
error: unexpected argument '--lang' found
tip: to pass '--lang' as a value, use '-- --lang'
Usage: ast-grep scan --color <WHEN> --stdin [PATHS]...
For more information, try '--help'.
Search Command:
ast-grep 'scan' \
'--color=never' \
'--stdin' \
'--lang=lua' \
'--json=stream' \
'--inline-rules=id: my_rule_1\\nlanguage: lua\\nrule:\\n pattern: '
```
A cursory glance seems to indicate it might have something to do with... (in /lua/grug-far/engine/astgrep/search.lua)
```lua
if bufrange then
inputs.paths = ''
extraArgs = { '--stdin', '--lang=' .. M.get_language(bufrange.file_name) }
end
```
...adding the `--lang` parameter for astgrep, even though the `scan` subcommand used by astgrep-rules doesn't seem to support it.
5 条评论