Update docs for moduleNameAt

This commit is contained in:
Jeroen Engels 2021-10-03 11:06:26 +02:00
parent 2a8dbaf2a1
commit 93d401d0a4
2 changed files with 6 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -38,11 +38,11 @@ type alias ModuleNameLookupTable =
The function returns `Just []` if the type or value was defined in this module. It returns `Just moduleName` if the Node is among these kinds of AST nodes (and `Nothing` for all the others):
- `Expression.FunctionOrValue`
- `Expression.PrefixOperator`
- `Expression.OperatorApplication`
- `nodeForTheName` in `Expression.RecordUpdateExpression nodeForTheName modifiers`
- `nodeForTheName` in `TypeAnnotation.Typed nodeForTheName args`
- `Pattern.NamedPattern`
- `Expression.PrefixOperator`
- `Expression.OperatorApplication`
```elm
expressionVisitor : Node Expression -> Context -> ( List (Error {}), Context )
@ -74,7 +74,7 @@ moduleNameFor (Internal.ModuleNameLookupTable dict) (Node range _) =
Dict.get (Internal.toRangeLike range) dict
{-| Returns the name of the module the type or value referred to by this [`Node`](https://package.elm-lang.org/packages/stil4m/elm-syntax/7.2.1/Elm-Syntax-Node#Node).
{-| Returns the name of the module the type, value, or operator referred to by this [`Range`](https://package.elm-lang.org/packages/stil4m/elm-syntax/7.2.1/Elm-Syntax-Range#Range).
The function returns `Just []` if the type or value was defined in this module. It returns `Just moduleName` if the Node is among these kinds of AST nodes (and `Nothing` for all the others):
@ -82,6 +82,8 @@ The function returns `Just []` if the type or value was defined in this module.
- `nodeForTheName` in `Expression.RecordUpdateExpression nodeForTheName modifiers`
- `nodeForTheName` in `TypeAnnotation.Typed nodeForTheName args`
- `Pattern.NamedPattern`
- `Expression.PrefixOperator`
- `Expression.OperatorApplication`
```elm
expressionVisitor : Node Expression -> Context -> ( List (Error {}), Context )