MoveRangePastModifiers returns a text range that starts past any modifiers on the node.
(node *ast.Node)
| 306 | |
| 307 | // MoveRangePastModifiers returns a text range that starts past any modifiers on the node. |
| 308 | func MoveRangePastModifiers(node *ast.Node) core.TextRange { |
| 309 | if ast.IsPropertyDeclaration(node) || ast.IsMethodDeclaration(node) { |
| 310 | return core.NewTextRange(node.Name().Pos(), node.End()) |
| 311 | } |
| 312 | |
| 313 | var lastModifier *ast.Node |
| 314 | if ast.CanHaveModifiers(node) { |
| 315 | lastModifier = core.LastOrNil(node.ModifierNodes()) |
| 316 | } |
| 317 | |
| 318 | if lastModifier != nil && !ast.PositionIsSynthesized(lastModifier.End()) { |
| 319 | return core.NewTextRange(lastModifier.End(), node.End()) |
| 320 | } |
| 321 | return MoveRangePastDecorators(node) |
| 322 | } |
| 323 | |
| 324 | // MoveRangePastDecorators returns a text range that starts past any decorators on the node. |
| 325 | func MoveRangePastDecorators(node *ast.Node) core.TextRange { |
no test coverage detected