OutermostExprAtPos attempts to find an expression in the receiving file that contains the given position. This is a best-effort method that may not be able to produce a result for all positions or for all HCL syntaxes. Since expressions are often nested inside one another, this method returns the o
(pos Pos)
| 87 | // |
| 88 | // The result is nil if no single expression could be selected for any reason. |
| 89 | func (f *File) OutermostExprAtPos(pos Pos) Expression { |
| 90 | // The root body of the file must implement this interface in order |
| 91 | // to support OutermostExprAtPos. |
| 92 | type Interface interface { |
| 93 | OutermostExprAtPos(pos Pos) Expression |
| 94 | } |
| 95 | |
| 96 | impl, ok := f.Body.(Interface) |
| 97 | if !ok { |
| 98 | return nil |
| 99 | } |
| 100 | return impl.OutermostExprAtPos(pos) |
| 101 | } |
| 102 | |
| 103 | // AttributeAtPos attempts to find an attribute definition in the receiving |
| 104 | // file that contains the given position. This is a best-effort method that may |
nothing calls this directly
no test coverage detected