extendingCurrentFile checks if the extends object's file attribute is pointing to the current file.
(documentPath document.DocumentPath, extendsNode *ast.MappingValueNode)
| 35 | // extendingCurrentFile checks if the extends object's file attribute is |
| 36 | // pointing to the current file. |
| 37 | func extendingCurrentFile(documentPath document.DocumentPath, extendsNode *ast.MappingValueNode) bool { |
| 38 | if extends, ok := extendsNode.Value.(*ast.MappingNode); ok { |
| 39 | for _, extendsAttribute := range extends.Values { |
| 40 | if extendsAttribute.Key.GetToken().Value == "file" { |
| 41 | _, path := types.Concatenate(documentPath.Folder, extendsAttribute.Value.GetToken().Value, documentPath.WSLDollarSignHost) |
| 42 | _, originalPath := types.Concatenate(documentPath.Folder, documentPath.FileName, documentPath.WSLDollarSignHost) |
| 43 | if !samePath(originalPath, path) { |
| 44 | return false |
| 45 | } |
| 46 | break |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | return true |
| 51 | } |
| 52 | |
| 53 | var buildTargetModifier = textEditModifier{ |
| 54 | isInterested: func(attributeName string, path []*ast.MappingValueNode) bool { |
no test coverage detected