GetDeclaringPath finds the path of nested AST nodes beginning with the passed interval `[start, end]`
(pass *analysishelper.EnhancedPass, start, end token.Pos)
| 42 | |
| 43 | // GetDeclaringPath finds the path of nested AST nodes beginning with the passed interval `[start, end]` |
| 44 | func GetDeclaringPath(pass *analysishelper.EnhancedPass, start, end token.Pos) ([]ast.Node, bool) { |
| 45 | astFile := lookupAstFromFile(pass, pass.Fset.File(start)) |
| 46 | if astFile == nil { |
| 47 | astFile = lookupAstFromFilename(pass, pass.Fset.Position(start).Filename) |
| 48 | } |
| 49 | if astFile != nil { |
| 50 | path, _ := astutil.PathEnclosingInterval(astFile, start, end) |
| 51 | return path, true |
| 52 | } |
| 53 | return nil, false |
| 54 | } |
| 55 | |
| 56 | // each of the following deepNilabilityOf... functions serves to inspect an object for possible sites |
| 57 | // that could grant it a deep nilability annotation. Every case defaults to just introspecting the |
no test coverage detected