elm-search
Semantic AST-aware code search for Elm projects. Built on elm-ast-rs.
Unlike grep, elm-search understands Elm syntax and can answer structural questions about your code.
Query types
| Query | Description | Example |
|---|---|---|
returns <Type> |
Functions whose return type contains a type | returns Maybe |
type <Type> |
Functions mentioning a type anywhere in signature | type Decoder |
case-on <Name> |
Case expressions matching on a constructor | case-on Result |
update .<field> |
Record updates touching a field | update .name |
calls <Module> |
All qualified calls to a module | calls Http |
unused-args |
Functions with arguments never used in the body | unused-args |
lambda <N> |
Lambdas with N or more arguments | lambda 3 |
uses <name> |
All references to a function or value | uses andThen |
def <pattern> |
Definitions matching a name (substring) | def update |
expr <kind> |
Expressions by kind: let, case, if, lambda, record, list, tuple | expr let |
Usage
Defaults to src if --dir is not specified.
Examples
# Find all functions that return Maybe
# Find unused function arguments
# Find all case expressions matching on Just
# Find all record updates to the `count` field
# Find all qualified calls to the Http module
Output format is file:line:col: description, compatible with editor jump-to-location.
Build