Class: RuboCop::Cop::SketchupDeprecations::OperationNextTransparent

Inherits:
SketchUp::Cop
  • Object
show all
Defined in:
lib/rubocop/sketchup/cop/deprecations/operation_next_transparent.rb

Overview

If set to true, then whatever operation comes after this one will be appended into one combined operation, allowing the user the undo both actions with a single undo command.

This flag is a highly difficult one, since there are so many ways that a SketchUp user can interrupt a given operation with one of their own.

Only use this flag if you have no other option, for instance to work around bug in how ‘Sketchup::Model#place_component` starts operations.

Constant Summary collapse

MSG =
'Third argument is deprecated.'

Constants inherited from SketchUp::Cop

SketchUp::Cop::SKETCHUP_DEPARTMENT_SEVERITY

Constants included from SketchUp::Config

SketchUp::Config::DEFAULT_CONFIGURATION

Instance Method Summary collapse

Methods inherited from SketchUp::Cop

inherited, #relevant_file?

Instance Method Details

#on_send(node) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/rubocop/sketchup/cop/deprecations/operation_next_transparent.rb', line 18

def on_send(node)
  _, method_name, *args = *node
  return unless method_name == :start_operation
  return if args.size < 3

  argument = args[2]
  next_transparent = (argument.type == :true)
  add_offense(argument, location: :expression) if next_transparent
end