rbs-trace 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +12 -1
  3. data/CHANGELOG.md +34 -0
  4. data/README.md +44 -24
  5. data/Rakefile +7 -0
  6. data/exe/rbs-trace +8 -0
  7. data/lib/rbs/trace/builder.rb +136 -0
  8. data/lib/rbs/trace/cli/inline.rb +62 -0
  9. data/lib/rbs/trace/cli/merge.rb +102 -0
  10. data/lib/rbs/trace/cli.rb +40 -0
  11. data/lib/rbs/trace/file.rb +66 -21
  12. data/lib/rbs/trace/helpers.rb +67 -0
  13. data/lib/rbs/trace/inline_comment_visitor.rb +63 -0
  14. data/lib/rbs/trace/overload_compact.rb +93 -0
  15. data/lib/rbs/trace/return_value_visitor.rb +66 -0
  16. data/lib/rbs/trace/version.rb +2 -2
  17. data/lib/rbs/trace.rb +156 -4
  18. data/rbs_collection.lock.yaml +0 -4
  19. data/sig/generated/rbs/trace/builder.rbs +40 -0
  20. data/sig/generated/rbs/trace/cli/inline.rbs +19 -0
  21. data/sig/generated/rbs/trace/cli/merge.rbs +24 -0
  22. data/sig/generated/rbs/trace/cli.rbs +17 -0
  23. data/sig/generated/rbs/trace/file.rbs +20 -9
  24. data/sig/generated/rbs/trace/helpers.rbs +28 -0
  25. data/sig/generated/rbs/trace/inline_comment_visitor.rbs +27 -0
  26. data/sig/generated/rbs/trace/overload_compact.rbs +24 -0
  27. data/sig/generated/rbs/trace/return_value_visitor.rbs +27 -0
  28. data/sig/generated/rbs/trace/version.rbs +1 -1
  29. data/sig/generated/rbs/trace.rbs +63 -1
  30. data/tmp/.keep +0 -0
  31. metadata +38 -11
  32. data/lib/rbs/trace/declaration.rb +0 -107
  33. data/lib/rbs/trace/definition.rb +0 -33
  34. data/lib/rbs/trace/method_tracing.rb +0 -182
  35. data/sig/generated/rbs/trace/declaration.rbs +0 -36
  36. data/sig/generated/rbs/trace/definition.rbs +0 -25
  37. data/sig/generated/rbs/trace/method_tracing.rbs +0 -63
@@ -1,36 +0,0 @@
1
- # Generated from lib/rbs/trace/declaration.rb with RBS::Inline
2
-
3
- module RBS
4
- module Trace
5
- class Declaration
6
- METHOD_KINDS: Array[Symbol]
7
-
8
- attr_reader parameters: Array[untyped]
9
-
10
- attr_reader void: bool
11
-
12
- attr_accessor return_type: Array[Object]
13
-
14
- # @rbs (Array[untyped], ?void: bool) -> void
15
- def initialize: (Array[untyped], ?void: bool) -> void
16
-
17
- # @rbs () -> String
18
- def to_rbs: () -> String
19
-
20
- # @rbs (Declaration) -> Declaration
21
- def merge: (Declaration) -> Declaration
22
-
23
- private
24
-
25
- # TODO: support block argument
26
- # @rbs () -> String
27
- def parameters_rbs: () -> String
28
-
29
- # @rbs (Symbol, Symbol, Array[Object]) -> String?
30
- def convert: (Symbol, Symbol, Array[Object]) -> String?
31
-
32
- # @rbs (Array[Object]) -> String
33
- def convert_type: (Array[Object]) -> String
34
- end
35
- end
36
- end
@@ -1,25 +0,0 @@
1
- # Generated from lib/rbs/trace/definition.rb with RBS::Inline
2
-
3
- module RBS
4
- module Trace
5
- class Definition
6
- attr_reader klass: Class
7
-
8
- attr_reader name: Symbol
9
-
10
- attr_reader lineno: Integer
11
-
12
- # @rbs (klass: Object, name: Symbol, lineno: Integer) -> void
13
- def initialize: (klass: Object, name: Symbol, lineno: Integer) -> void
14
-
15
- # @rbs () -> Array[Declaration]
16
- def decls: () -> Array[Declaration]
17
-
18
- # @rbs (?Integer) -> String
19
- def rbs_comment: (?Integer) -> String
20
-
21
- # @rbs () -> String
22
- def rbs: () -> String
23
- end
24
- end
25
- end
@@ -1,63 +0,0 @@
1
- # Generated from lib/rbs/trace/method_tracing.rb with RBS::Inline
2
-
3
- module RBS
4
- module Trace
5
- class MethodTracing
6
- # rubocop:disable Metrics/ClassLength
7
- ASSIGNED_NODE_TYPES: Array[Symbol]
8
-
9
- # @rbs [T] () { () -> T } -> T
10
- def enable: [T] () { () -> T } -> T
11
-
12
- # @rbs () -> void
13
- def disable: () -> void
14
-
15
- # @rbs () -> Hash[String, File]
16
- def files: () -> Hash[String, File]
17
-
18
- # @rbs () -> void
19
- def insert_rbs: () -> void
20
-
21
- private
22
-
23
- # @rbs () -> TracePoint
24
- def trace: () -> TracePoint
25
-
26
- # @rbs () -> Logger
27
- def logger: () -> Logger
28
-
29
- # @rbs () -> Array[Declaration]
30
- def stack_traces: () -> Array[Declaration]
31
-
32
- # @rbs (String) -> File
33
- def find_or_new_file: (String) -> File
34
-
35
- # @rbs (File, TracePoint) -> Definition
36
- def find_or_new_definition: (File, TracePoint) -> Definition
37
-
38
- # @rbs (TracePoint) -> void
39
- def record: (TracePoint) -> void
40
-
41
- # @rbs (TracePoint) -> void
42
- def call_event: (TracePoint) -> void
43
-
44
- # @rbs (TracePoint, Definition) -> void
45
- def return_event: (TracePoint, Definition) -> void
46
-
47
- # @rbs (BasicObject) -> Class
48
- def obj_to_class: (BasicObject) -> Class
49
-
50
- # @rbs (String) -> bool
51
- def ignore_path?: (String) -> bool
52
-
53
- # @rbs (String, Symbol) -> bool
54
- def assign_return_value?: (String, Symbol) -> bool
55
-
56
- # @rbs (Prism::Node, method_name: Symbol, lineno: Integer, ?parents: Array[Prism::Node]) -> Array[Prism::Node]?
57
- def find_parents: (Prism::Node, method_name: Symbol, lineno: Integer, ?parents: Array[Prism::Node]) -> Array[Prism::Node]?
58
-
59
- # @rbs (String) -> Prism::ProgramNode?
60
- def parsed_nodes: (String) -> Prism::ProgramNode?
61
- end
62
- end
63
- end