rubydex 0.2.1-x86_64-linux → 0.2.3-x86_64-linux
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.
- checksums.yaml +4 -4
- data/ext/rubydex/definition.c +51 -0
- data/ext/rubydex/rubydex.c +2 -0
- data/ext/rubydex/signature.c +83 -0
- data/ext/rubydex/signature.h +23 -0
- data/lib/rubydex/3.2/rubydex.so +0 -0
- data/lib/rubydex/3.3/rubydex.so +0 -0
- data/lib/rubydex/3.4/rubydex.so +0 -0
- data/lib/rubydex/4.0/rubydex.so +0 -0
- data/lib/rubydex/librubydex_sys.so +0 -0
- data/lib/rubydex/reference.rb +10 -0
- data/lib/rubydex/signature.rb +130 -0
- data/lib/rubydex/version.rb +1 -1
- data/lib/rubydex.rb +2 -0
- data/rbi/rubydex.rbi +15 -0
- data/rust/rubydex/src/indexing/ruby_indexer.rs +172 -16
- data/rust/rubydex/src/indexing/ruby_indexer_tests.rs +2976 -2656
- data/rust/rubydex/src/model/definitions.rs +23 -0
- data/rust/rubydex/src/model/graph.rs +40 -12
- data/rust/rubydex/src/query.rs +598 -1
- data/rust/rubydex/src/resolution.rs +30 -11
- data/rust/rubydex/src/resolution_tests.rs +196 -1
- data/rust/rubydex-sys/src/declaration_api.rs +10 -33
- data/rust/rubydex-sys/src/definition_api.rs +26 -0
- data/rust/rubydex-sys/src/lib.rs +1 -0
- data/rust/rubydex-sys/src/signature_api.rs +209 -0
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4aa89b9ebd052a79e8e4d9c59e8692785b09068ff185362fcfad152b1744db4d
|
|
4
|
+
data.tar.gz: b19d59ff132c8382047e6d538e9d8894d613c7f52623d1aecec524ed87d5e7c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ebf4a08fc65b9825998e48afdd8a19ea787978116622e69f1b9f26a18237333ed680b07b3c8d1ef65817577e14413960223ba3d281e4fa4651c4d62f84d6e826
|
|
7
|
+
data.tar.gz: b0716909fff42f12ad084a25f642651e147c76ec49f810b6191f409203b4ca9a6ecc99db71e0e83c324976ecafb6307ac8e7216678fc65e5758eb3e92a680d81
|
data/ext/rubydex/definition.c
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#include "definition.h"
|
|
2
|
+
#include "declaration.h"
|
|
2
3
|
#include "graph.h"
|
|
3
4
|
#include "handle.h"
|
|
4
5
|
#include "location.h"
|
|
5
6
|
#include "reference.h"
|
|
7
|
+
#include "signature.h"
|
|
6
8
|
#include "ruby/internal/scan_args.h"
|
|
7
9
|
#include "rustbindings.h"
|
|
8
10
|
|
|
@@ -171,6 +173,28 @@ static VALUE rdxr_definition_name_location(VALUE self) {
|
|
|
171
173
|
return location;
|
|
172
174
|
}
|
|
173
175
|
|
|
176
|
+
// Definition#declaration -> Rubydex::Declaration?
|
|
177
|
+
// Returns the declaration this definition belongs to or nil when it cannot be located (for example, before
|
|
178
|
+
// `Graph#resolve` has run).
|
|
179
|
+
static VALUE rdxr_definition_declaration(VALUE self) {
|
|
180
|
+
HandleData *data;
|
|
181
|
+
TypedData_Get_Struct(self, HandleData, &handle_type, data);
|
|
182
|
+
|
|
183
|
+
void *graph;
|
|
184
|
+
TypedData_Get_Struct(data->graph_obj, void *, &graph_type, graph);
|
|
185
|
+
|
|
186
|
+
const struct CDeclaration *decl = rdx_definition_declaration(graph, data->id);
|
|
187
|
+
if (decl == NULL) {
|
|
188
|
+
return Qnil;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
VALUE decl_class = rdxi_declaration_class_for_kind(decl->kind);
|
|
192
|
+
VALUE argv[] = {data->graph_obj, ULL2NUM(decl->id)};
|
|
193
|
+
free_c_declaration(decl);
|
|
194
|
+
|
|
195
|
+
return rb_class_new_instance(2, argv, decl_class);
|
|
196
|
+
}
|
|
197
|
+
|
|
174
198
|
static VALUE rdxi_build_constant_reference(VALUE graph_obj, const CConstantReference *cref) {
|
|
175
199
|
VALUE ref_class = (cref->declaration_id == 0)
|
|
176
200
|
? cUnresolvedConstantReference
|
|
@@ -239,6 +263,30 @@ static VALUE rdxr_definition_mixins(VALUE self) {
|
|
|
239
263
|
return ary;
|
|
240
264
|
}
|
|
241
265
|
|
|
266
|
+
// MethodDefinition#signatures -> [Rubydex::Signature]
|
|
267
|
+
static VALUE rdxr_method_definition_signatures(VALUE self) {
|
|
268
|
+
HandleData *data;
|
|
269
|
+
TypedData_Get_Struct(self, HandleData, &handle_type, data);
|
|
270
|
+
|
|
271
|
+
void *graph;
|
|
272
|
+
TypedData_Get_Struct(data->graph_obj, void *, &graph_type, graph);
|
|
273
|
+
|
|
274
|
+
SignatureArray *arr = rdx_definition_signatures(graph, data->id);
|
|
275
|
+
return rdxi_signatures_to_ruby(arr);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// MethodAliasDefinition#signatures -> [Rubydex::Signature]
|
|
279
|
+
static VALUE rdxr_method_alias_definition_signatures(VALUE self) {
|
|
280
|
+
HandleData *data;
|
|
281
|
+
TypedData_Get_Struct(self, HandleData, &handle_type, data);
|
|
282
|
+
|
|
283
|
+
void *graph;
|
|
284
|
+
TypedData_Get_Struct(data->graph_obj, void *, &graph_type, graph);
|
|
285
|
+
|
|
286
|
+
SignatureArray *arr = rdx_method_alias_definition_signatures(graph, data->id);
|
|
287
|
+
return rdxi_signatures_to_ruby(arr);
|
|
288
|
+
}
|
|
289
|
+
|
|
242
290
|
void rdxi_initialize_definition(VALUE mod) {
|
|
243
291
|
mRubydex = mod;
|
|
244
292
|
|
|
@@ -257,6 +305,7 @@ void rdxi_initialize_definition(VALUE mod) {
|
|
|
257
305
|
rb_define_method(cDefinition, "name", rdxr_definition_name, 0);
|
|
258
306
|
rb_define_method(cDefinition, "deprecated?", rdxr_definition_deprecated, 0);
|
|
259
307
|
rb_define_method(cDefinition, "name_location", rdxr_definition_name_location, 0);
|
|
308
|
+
rb_define_method(cDefinition, "declaration", rdxr_definition_declaration, 0);
|
|
260
309
|
|
|
261
310
|
cClassDefinition = rb_define_class_under(mRubydex, "ClassDefinition", cDefinition);
|
|
262
311
|
rb_define_method(cClassDefinition, "superclass", rdxr_class_definition_superclass, 0);
|
|
@@ -273,6 +322,7 @@ void rdxi_initialize_definition(VALUE mod) {
|
|
|
273
322
|
cConstantVisibilityDefinition = rb_define_class_under(mRubydex, "ConstantVisibilityDefinition", cDefinition);
|
|
274
323
|
cMethodVisibilityDefinition = rb_define_class_under(mRubydex, "MethodVisibilityDefinition", cDefinition);
|
|
275
324
|
cMethodDefinition = rb_define_class_under(mRubydex, "MethodDefinition", cDefinition);
|
|
325
|
+
rb_define_method(cMethodDefinition, "signatures", rdxr_method_definition_signatures, 0);
|
|
276
326
|
cAttrAccessorDefinition = rb_define_class_under(mRubydex, "AttrAccessorDefinition", cDefinition);
|
|
277
327
|
cAttrReaderDefinition = rb_define_class_under(mRubydex, "AttrReaderDefinition", cDefinition);
|
|
278
328
|
cAttrWriterDefinition = rb_define_class_under(mRubydex, "AttrWriterDefinition", cDefinition);
|
|
@@ -280,5 +330,6 @@ void rdxi_initialize_definition(VALUE mod) {
|
|
|
280
330
|
cInstanceVariableDefinition = rb_define_class_under(mRubydex, "InstanceVariableDefinition", cDefinition);
|
|
281
331
|
cClassVariableDefinition = rb_define_class_under(mRubydex, "ClassVariableDefinition", cDefinition);
|
|
282
332
|
cMethodAliasDefinition = rb_define_class_under(mRubydex, "MethodAliasDefinition", cDefinition);
|
|
333
|
+
rb_define_method(cMethodAliasDefinition, "signatures", rdxr_method_alias_definition_signatures, 0);
|
|
283
334
|
cGlobalVariableAliasDefinition = rb_define_class_under(mRubydex, "GlobalVariableAliasDefinition", cDefinition);
|
|
284
335
|
}
|
data/ext/rubydex/rubydex.c
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
#include "graph.h"
|
|
6
6
|
#include "location.h"
|
|
7
7
|
#include "reference.h"
|
|
8
|
+
#include "signature.h"
|
|
8
9
|
|
|
9
10
|
VALUE mRubydex;
|
|
10
11
|
|
|
@@ -19,4 +20,5 @@ void Init_rubydex(void) {
|
|
|
19
20
|
rdxi_initialize_location(mRubydex);
|
|
20
21
|
rdxi_initialize_diagnostic(mRubydex);
|
|
21
22
|
rdxi_initialize_reference(mRubydex);
|
|
23
|
+
rdxi_initialize_signature(mRubydex);
|
|
22
24
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#include "signature.h"
|
|
2
|
+
#include "location.h"
|
|
3
|
+
|
|
4
|
+
static VALUE empty_params = Qundef;
|
|
5
|
+
|
|
6
|
+
VALUE cSignature;
|
|
7
|
+
VALUE cParameter;
|
|
8
|
+
VALUE cPositionalParameter;
|
|
9
|
+
VALUE cOptionalPositionalParameter;
|
|
10
|
+
VALUE cRestPositionalParameter;
|
|
11
|
+
VALUE cPostParameter;
|
|
12
|
+
VALUE cKeywordParameter;
|
|
13
|
+
VALUE cOptionalKeywordParameter;
|
|
14
|
+
VALUE cRestKeywordParameter;
|
|
15
|
+
VALUE cForwardParameter;
|
|
16
|
+
VALUE cBlockParameter;
|
|
17
|
+
|
|
18
|
+
static VALUE parameter_class_for_kind(ParameterKind kind) {
|
|
19
|
+
switch (kind) {
|
|
20
|
+
case ParameterKind_RequiredPositional: return cPositionalParameter;
|
|
21
|
+
case ParameterKind_OptionalPositional: return cOptionalPositionalParameter;
|
|
22
|
+
case ParameterKind_RestPositional: return cRestPositionalParameter;
|
|
23
|
+
case ParameterKind_Post: return cPostParameter;
|
|
24
|
+
case ParameterKind_RequiredKeyword: return cKeywordParameter;
|
|
25
|
+
case ParameterKind_OptionalKeyword: return cOptionalKeywordParameter;
|
|
26
|
+
case ParameterKind_RestKeyword: return cRestKeywordParameter;
|
|
27
|
+
case ParameterKind_Forward: return cForwardParameter;
|
|
28
|
+
case ParameterKind_Block: return cBlockParameter;
|
|
29
|
+
default: rb_raise(rb_eRuntimeError, "Unknown ParameterKind: %d", kind);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
VALUE rdxi_signatures_to_ruby(SignatureArray *arr) {
|
|
34
|
+
VALUE signatures = rb_ary_new_capa((long)arr->len);
|
|
35
|
+
|
|
36
|
+
for (size_t i = 0; i < arr->len; i++) {
|
|
37
|
+
SignatureEntry sig_entry = arr->items[i];
|
|
38
|
+
|
|
39
|
+
VALUE signature;
|
|
40
|
+
if (sig_entry.parameters_len == 0) {
|
|
41
|
+
signature = rb_class_new_instance(1, &empty_params, cSignature);
|
|
42
|
+
} else {
|
|
43
|
+
VALUE parameters = rb_ary_new_capa((long)sig_entry.parameters_len);
|
|
44
|
+
for (size_t j = 0; j < sig_entry.parameters_len; j++) {
|
|
45
|
+
ParameterEntry param_entry = sig_entry.parameters[j];
|
|
46
|
+
|
|
47
|
+
VALUE param_class = parameter_class_for_kind(param_entry.kind);
|
|
48
|
+
VALUE name_sym = rb_str_intern(rb_utf8_str_new_cstr(param_entry.name));
|
|
49
|
+
VALUE location = rdxi_build_location_value(param_entry.location);
|
|
50
|
+
VALUE param_argv[] = {name_sym, location};
|
|
51
|
+
VALUE param = rb_class_new_instance(2, param_argv, param_class);
|
|
52
|
+
|
|
53
|
+
rb_ary_push(parameters, param);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
signature = rb_class_new_instance(1, ¶meters, cSignature);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
rb_ary_push(signatures, signature);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
rdx_definition_signatures_free(arr);
|
|
63
|
+
return signatures;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
void rdxi_initialize_signature(VALUE mRubydex) {
|
|
67
|
+
cSignature = rb_define_class_under(mRubydex, "Signature", rb_cObject);
|
|
68
|
+
|
|
69
|
+
cParameter = rb_define_class_under(cSignature, "Parameter", rb_cObject);
|
|
70
|
+
cPositionalParameter = rb_define_class_under(cSignature, "PositionalParameter", cParameter);
|
|
71
|
+
cOptionalPositionalParameter = rb_define_class_under(cSignature, "OptionalPositionalParameter", cParameter);
|
|
72
|
+
cRestPositionalParameter = rb_define_class_under(cSignature, "RestPositionalParameter", cParameter);
|
|
73
|
+
cPostParameter = rb_define_class_under(cSignature, "PostParameter", cParameter);
|
|
74
|
+
cKeywordParameter = rb_define_class_under(cSignature, "KeywordParameter", cParameter);
|
|
75
|
+
cOptionalKeywordParameter = rb_define_class_under(cSignature, "OptionalKeywordParameter", cParameter);
|
|
76
|
+
cRestKeywordParameter = rb_define_class_under(cSignature, "RestKeywordParameter", cParameter);
|
|
77
|
+
cForwardParameter = rb_define_class_under(cSignature, "ForwardParameter", cParameter);
|
|
78
|
+
cBlockParameter = rb_define_class_under(cSignature, "BlockParameter", cParameter);
|
|
79
|
+
|
|
80
|
+
empty_params = rb_ary_new();
|
|
81
|
+
OBJ_FREEZE(empty_params);
|
|
82
|
+
rb_gc_register_mark_object(empty_params);
|
|
83
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#ifndef RUBYDEX_SIGNATURE_H
|
|
2
|
+
#define RUBYDEX_SIGNATURE_H
|
|
3
|
+
|
|
4
|
+
#include "ruby.h"
|
|
5
|
+
#include "rustbindings.h"
|
|
6
|
+
|
|
7
|
+
extern VALUE cSignature;
|
|
8
|
+
extern VALUE cParameter;
|
|
9
|
+
extern VALUE cPositionalParameter;
|
|
10
|
+
extern VALUE cOptionalPositionalParameter;
|
|
11
|
+
extern VALUE cRestPositionalParameter;
|
|
12
|
+
extern VALUE cPostParameter;
|
|
13
|
+
extern VALUE cKeywordParameter;
|
|
14
|
+
extern VALUE cOptionalKeywordParameter;
|
|
15
|
+
extern VALUE cRestKeywordParameter;
|
|
16
|
+
extern VALUE cForwardParameter;
|
|
17
|
+
extern VALUE cBlockParameter;
|
|
18
|
+
|
|
19
|
+
void rdxi_initialize_signature(VALUE mRubydex);
|
|
20
|
+
|
|
21
|
+
VALUE rdxi_signatures_to_ruby(SignatureArray *arr);
|
|
22
|
+
|
|
23
|
+
#endif // RUBYDEX_SIGNATURE_H
|
data/lib/rubydex/3.2/rubydex.so
CHANGED
|
Binary file
|
data/lib/rubydex/3.3/rubydex.so
CHANGED
|
Binary file
|
data/lib/rubydex/3.4/rubydex.so
CHANGED
|
Binary file
|
data/lib/rubydex/4.0/rubydex.so
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Rubydex
|
|
4
|
+
class Signature
|
|
5
|
+
class Parameter
|
|
6
|
+
#: Symbol
|
|
7
|
+
attr_reader :name
|
|
8
|
+
|
|
9
|
+
#: Location
|
|
10
|
+
attr_reader :location
|
|
11
|
+
|
|
12
|
+
#: (Symbol, Location) -> void
|
|
13
|
+
def initialize(name, location)
|
|
14
|
+
@name = name
|
|
15
|
+
@location = location
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class PositionalParameter < Parameter; end
|
|
20
|
+
class OptionalPositionalParameter < Parameter; end
|
|
21
|
+
class RestPositionalParameter < Parameter; end
|
|
22
|
+
class PostParameter < Parameter; end
|
|
23
|
+
class KeywordParameter < Parameter; end
|
|
24
|
+
class OptionalKeywordParameter < Parameter; end
|
|
25
|
+
class RestKeywordParameter < Parameter; end
|
|
26
|
+
class ForwardParameter < Parameter; end
|
|
27
|
+
class BlockParameter < Parameter; end
|
|
28
|
+
|
|
29
|
+
#: Array[Parameter]
|
|
30
|
+
attr_reader :parameters
|
|
31
|
+
|
|
32
|
+
#: (Array[Parameter]) -> void
|
|
33
|
+
def initialize(parameters)
|
|
34
|
+
@parameters = parameters
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
#: () -> [Array[PositionalParameter], Array[OptionalPositionalParameter], RestPositionalParameter?, Array[PostParameter], Array[KeywordParameter], Array[OptionalKeywordParameter], RestKeywordParameter?, ForwardParameter?, BlockParameter?]
|
|
38
|
+
def deconstruct
|
|
39
|
+
positionals = [] #: Array[PositionalParameter]
|
|
40
|
+
optional_positionals = [] #: Array[OptionalPositionalParameter]
|
|
41
|
+
rest_positional = nil #: RestPositionalParameter?
|
|
42
|
+
posts = [] #: Array[PostParameter]
|
|
43
|
+
keywords = [] #: Array[KeywordParameter]
|
|
44
|
+
optional_keywords = [] #: Array[OptionalKeywordParameter]
|
|
45
|
+
rest_keyword = nil #: RestKeywordParameter?
|
|
46
|
+
forward = nil #: ForwardParameter?
|
|
47
|
+
block = nil #: BlockParameter?
|
|
48
|
+
|
|
49
|
+
parameters.each do |param|
|
|
50
|
+
case param
|
|
51
|
+
when PositionalParameter then positionals << param
|
|
52
|
+
when OptionalPositionalParameter then optional_positionals << param
|
|
53
|
+
when RestPositionalParameter then rest_positional = param
|
|
54
|
+
when PostParameter then posts << param
|
|
55
|
+
when KeywordParameter then keywords << param
|
|
56
|
+
when OptionalKeywordParameter then optional_keywords << param
|
|
57
|
+
when RestKeywordParameter then rest_keyword = param
|
|
58
|
+
when ForwardParameter then forward = param
|
|
59
|
+
when BlockParameter then block = param
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
[positionals, optional_positionals, rest_positional, posts, keywords, optional_keywords, rest_keyword, forward, block]
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
DECONSTRUCT_KEYS = [
|
|
67
|
+
:positional_parameters,
|
|
68
|
+
:optional_positional_parameters,
|
|
69
|
+
:rest_positional_parameter,
|
|
70
|
+
:post_parameters,
|
|
71
|
+
:keyword_parameters,
|
|
72
|
+
:optional_keyword_parameters,
|
|
73
|
+
:rest_keyword_parameter,
|
|
74
|
+
:forward_parameter,
|
|
75
|
+
:block_parameter,
|
|
76
|
+
].freeze #: Array[Symbol]
|
|
77
|
+
private_constant :DECONSTRUCT_KEYS
|
|
78
|
+
|
|
79
|
+
#: (Array[Symbol]?) -> Hash[Symbol, untyped]
|
|
80
|
+
def deconstruct_keys(keys)
|
|
81
|
+
keys = DECONSTRUCT_KEYS if keys.nil?
|
|
82
|
+
|
|
83
|
+
positionals, optional_positionals, rest_positional, posts,
|
|
84
|
+
keywords, optional_keywords, rest_keyword, forward, block = deconstruct
|
|
85
|
+
|
|
86
|
+
result = {} #: Hash[Symbol, untyped]
|
|
87
|
+
keys.each do |key|
|
|
88
|
+
case key
|
|
89
|
+
when :positional_parameters then result[key] = positionals
|
|
90
|
+
when :optional_positional_parameters then result[key] = optional_positionals
|
|
91
|
+
when :rest_positional_parameter then result[key] = rest_positional
|
|
92
|
+
when :post_parameters then result[key] = posts
|
|
93
|
+
when :keyword_parameters then result[key] = keywords
|
|
94
|
+
when :optional_keyword_parameters then result[key] = optional_keywords
|
|
95
|
+
when :rest_keyword_parameter then result[key] = rest_keyword
|
|
96
|
+
when :forward_parameter then result[key] = forward
|
|
97
|
+
when :block_parameter then result[key] = block
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
result
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
#: () -> Array[PositionalParameter]
|
|
104
|
+
def positional_parameters = deconstruct[0]
|
|
105
|
+
|
|
106
|
+
#: () -> Array[OptionalPositionalParameter]
|
|
107
|
+
def optional_positional_parameters = deconstruct[1]
|
|
108
|
+
|
|
109
|
+
#: () -> RestPositionalParameter?
|
|
110
|
+
def rest_positional_parameter = deconstruct[2]
|
|
111
|
+
|
|
112
|
+
#: () -> Array[PostParameter]
|
|
113
|
+
def post_parameters = deconstruct[3]
|
|
114
|
+
|
|
115
|
+
#: () -> Array[KeywordParameter]
|
|
116
|
+
def keyword_parameters = deconstruct[4]
|
|
117
|
+
|
|
118
|
+
#: () -> Array[OptionalKeywordParameter]
|
|
119
|
+
def optional_keyword_parameters = deconstruct[5]
|
|
120
|
+
|
|
121
|
+
#: () -> RestKeywordParameter?
|
|
122
|
+
def rest_keyword_parameter = deconstruct[6]
|
|
123
|
+
|
|
124
|
+
#: () -> ForwardParameter?
|
|
125
|
+
def forward_parameter = deconstruct[7]
|
|
126
|
+
|
|
127
|
+
#: () -> BlockParameter?
|
|
128
|
+
def block_parameter = deconstruct[8]
|
|
129
|
+
end
|
|
130
|
+
end
|
data/lib/rubydex/version.rb
CHANGED
data/lib/rubydex.rb
CHANGED
data/rbi/rubydex.rbi
CHANGED
|
@@ -15,6 +15,8 @@ class Rubydex::Comment
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
class Rubydex::ConstantReference < Rubydex::Reference
|
|
18
|
+
abstract!
|
|
19
|
+
|
|
18
20
|
sig { returns(Rubydex::Location) }
|
|
19
21
|
def location; end
|
|
20
22
|
|
|
@@ -36,6 +38,8 @@ class Rubydex::ResolvedConstantReference < Rubydex::ConstantReference
|
|
|
36
38
|
end
|
|
37
39
|
|
|
38
40
|
class Rubydex::Declaration
|
|
41
|
+
abstract!
|
|
42
|
+
|
|
39
43
|
sig { returns(T::Enumerable[Rubydex::Definition]) }
|
|
40
44
|
def definitions; end
|
|
41
45
|
|
|
@@ -92,6 +96,8 @@ class Rubydex::Method < Rubydex::Declaration
|
|
|
92
96
|
end
|
|
93
97
|
|
|
94
98
|
class Rubydex::Namespace < Rubydex::Declaration
|
|
99
|
+
abstract!
|
|
100
|
+
|
|
95
101
|
sig { returns(T::Enumerable[Rubydex::ConstantReference]) }
|
|
96
102
|
def references; end
|
|
97
103
|
|
|
@@ -119,6 +125,8 @@ class Rubydex::Module < Rubydex::Namespace; end
|
|
|
119
125
|
class Rubydex::SingletonClass < Rubydex::Namespace; end
|
|
120
126
|
|
|
121
127
|
class Rubydex::Definition
|
|
128
|
+
abstract!
|
|
129
|
+
|
|
122
130
|
sig { returns(T::Array[Rubydex::Comment]) }
|
|
123
131
|
def comments; end
|
|
124
132
|
|
|
@@ -134,6 +142,9 @@ class Rubydex::Definition
|
|
|
134
142
|
sig { returns(T.nilable(Rubydex::Location)) }
|
|
135
143
|
def name_location; end
|
|
136
144
|
|
|
145
|
+
sig { returns(T.nilable(Rubydex::Declaration)) }
|
|
146
|
+
def declaration; end
|
|
147
|
+
|
|
137
148
|
class << self
|
|
138
149
|
private
|
|
139
150
|
|
|
@@ -172,6 +183,8 @@ class Rubydex::ClassDefinition < Rubydex::Definition
|
|
|
172
183
|
end
|
|
173
184
|
|
|
174
185
|
class Rubydex::Mixin
|
|
186
|
+
abstract!
|
|
187
|
+
|
|
175
188
|
sig { returns(Rubydex::ConstantReference) }
|
|
176
189
|
attr_reader :constant_reference
|
|
177
190
|
|
|
@@ -454,6 +467,8 @@ class Rubydex::MethodReference < Rubydex::Reference
|
|
|
454
467
|
end
|
|
455
468
|
|
|
456
469
|
class Rubydex::Reference
|
|
470
|
+
abstract!
|
|
471
|
+
|
|
457
472
|
class << self
|
|
458
473
|
private
|
|
459
474
|
|