"auto-detect" language (basically iterate project files of all recognized types and try parsing them against the query and don't hard-fail if some of the languages can't parse that query)
add tree-sitter language/parser for Javascript
print legitimate errors for a few failure cases
To test:
Existing behavior should continue to work
If you try omitting the --language command-line option in a project with only a single supported file-type (eg a Rust project) then you should see the same matches as with --language rust. And hopefully performance (of a release build) is relatively comparable (it looked a bit slower when running against the Typescript compiler in Rust codebase but when running against a smaller Typescript codebase it seemed indistinguishable, I'm not going to worry about it too much for now)
If you try running in a directory with multiple types of supported files (Rust/Typescript/JS) (eg the newly added tests/fixtures/mixed_project/ directory) with a query that should only be parseable by one of those language's tree-sitter grammars then you should see the expected results for those files but not see any errors related to trying to parse for the other encountered supported file types
If you try running in a directory with multiple types of supported files with a query that should be parseable by more than one of those language's tree-sitter grammars (eg (arrow_function) @a for Typescript/JS) then you should see the expected results for files of all of those file types
In this PR:
To test: Existing behavior should continue to work If you try omitting the
--language
command-line option in a project with only a single supported file-type (eg a Rust project) then you should see the same matches as with--language rust
. And hopefully performance (of a release build) is relatively comparable (it looked a bit slower when running against the Typescript compiler in Rust codebase but when running against a smaller Typescript codebase it seemed indistinguishable, I'm not going to worry about it too much for now) If you try running in a directory with multiple types of supported files (Rust/Typescript/JS) (eg the newly addedtests/fixtures/mixed_project/
directory) with a query that should only be parseable by one of those language's tree-sitter grammars then you should see the expected results for those files but not see any errors related to trying to parse for the other encountered supported file types If you try running in a directory with multiple types of supported files with a query that should be parseable by more than one of those language's tree-sitter grammars (eg(arrow_function) @a
for Typescript/JS) then you should see the expected results for files of all of those file typesCloses #22
Based on
specify-files