----------------------------------------------------------------------------- The methods in this file all have the general pattern of making a best-effort to find one or more constructs that contain a given source position. These all operate by delegating to an optional method of the same name and
(pos Pos)
| 26 | // |
| 27 | // The result is nil if no blocks at all contain the given position. |
| 28 | func (f *File) BlocksAtPos(pos Pos) []*Block { |
| 29 | // The root body of the file must implement this interface in order |
| 30 | // to support BlocksAtPos. |
| 31 | type Interface interface { |
| 32 | BlocksAtPos(pos Pos) []*Block |
| 33 | } |
| 34 | |
| 35 | impl, ok := f.Body.(Interface) |
| 36 | if !ok { |
| 37 | return nil |
| 38 | } |
| 39 | return impl.BlocksAtPos(pos) |
| 40 | } |
| 41 | |
| 42 | // OutermostBlockAtPos attempts to find a top-level block in the receiving file |
| 43 | // that contains the given position. This is a best-effort method that may not |
nothing calls this directly
no test coverage detected