ruby-lsp-ree 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 350bb1ae1a376f2a8594e3945c396c49d01907b1c840d36311e28761c2fe9d8e
4
- data.tar.gz: dfa9bc947cf5f951d62e2686290a7ac603c5dfa34652cb21be4b1547d2e3b5e1
3
+ metadata.gz: a1104f2c78afb874d9277a4e2d1c8b5adaf925bdb4fb9abb23b08a9e5a27aff9
4
+ data.tar.gz: 061f2b31a9aac045d279797b7561597db1825e396547b5afd94d6bfc4015af1e
5
5
  SHA512:
6
- metadata.gz: eaaa38d222082eb2a55f73a977114a2632d2db2a2b7d10a0d96d2284b87fbd2c02bcab43e45ec617afa63e5c9fd4f9e64339f7cb919ba23365a5deae1aa3df4e
7
- data.tar.gz: 64e7ce28fdb802eadbe27c6f7fd5d5e156c9c3d39627c9a7e191bf808fc9519eb26befa49182cc62bda12941c8e6fd4f478060ec61e33d38035aa10726c087d1
6
+ metadata.gz: 7f29b69bb720eadc44261c63719ca950cec24db996d0d4d83117c20c3a145bb6be8934420acb850ba92841feefe4985f0e0c1caa7129cd50a41a4419f3a2ca1e
7
+ data.tar.gz: fea1f33dd0bcdfe401afe15304797fca57c254cf8472b34a8ef40d7f011d2bb60edb1010177129671fcbfc0f7ca69b212832c2c70ef8b8f125025a20be0ca17a
data/CHANGELOG.md CHANGED
@@ -19,4 +19,14 @@
19
19
  - Add Link for ree actions
20
20
  - sort links in ree actions
21
21
  - autocomplete for ree dao
22
- - autocomplete for dao filters
22
+ - autocomplete for dao filters
23
+
24
+ ## [0.1.2] - 2025-02-14
25
+
26
+ - support for :bean objects
27
+ - Go To Definition for imported constants
28
+ - use current (no saved) version of the document in autocomplete
29
+ - use current (no saved) version of the document in definition
30
+ - increase autocomplete list limits (affects short functions)
31
+ - improved const autocomplete
32
+ - improved ree errors handling
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-lsp-ree (0.1.1)
4
+ ruby-lsp-ree (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -9,6 +9,7 @@ GEM
9
9
  rake (13.2.1)
10
10
 
11
11
  PLATFORMS
12
+ x86_64-darwin-23
12
13
  x86_64-linux
13
14
 
14
15
  DEPENDENCIES
@@ -16,4 +17,4 @@ DEPENDENCIES
16
17
  ruby-lsp-ree!
17
18
 
18
19
  BUNDLED WITH
19
- 2.4.20
20
+ 2.6.3
@@ -29,8 +29,6 @@ module RubyLsp
29
29
  end
30
30
 
31
31
  def create_completion_listener(response_builder, node_context, dispatcher, uri)
32
- $stderr.puts("create_completion_listener")
33
-
34
32
  index = @global_state.index
35
33
  RubyLsp::Ree::Completion.new(response_builder, node_context, index, dispatcher, uri)
36
34
  end
@@ -9,8 +9,8 @@ module RubyLsp
9
9
  include RubyLsp::Ree::ReeLspUtils
10
10
  include RubyLsp::Ree::CompletionUtils
11
11
 
12
- CHARS_COUNT = 3
13
- CANDIDATES_LIMIT = 20
12
+ CHARS_COUNT = 1
13
+ CANDIDATES_LIMIT = 100
14
14
 
15
15
  def initialize(response_builder, node_context, index, dispatcher, uri)
16
16
  @response_builder = response_builder
@@ -29,10 +29,10 @@ module RubyLsp
29
29
  class_name_objects = @index.instance_variable_get(:@entries).keys.select{ _1.split('::').last[0...node_name.size] == node_name}
30
30
  return if class_name_objects.size == 0
31
31
 
32
- parsed_doc = RubyLsp::Ree::ParsedDocumentBuilder.build_from_uri(@uri)
32
+ parsed_doc = RubyLsp::Ree::ParsedDocumentBuilder.build_from_ast(@node_context.parent, @uri)
33
33
 
34
34
  completion_items = get_class_name_completion_items(class_name_objects, parsed_doc, node, @index, CANDIDATES_LIMIT)
35
- puts_items_into_response(completion_items)
35
+ put_items_into_response(completion_items)
36
36
  end
37
37
 
38
38
  def on_call_node_enter(node)
@@ -44,16 +44,21 @@ module RubyLsp
44
44
  return dao_filter_completion(node)
45
45
  end
46
46
 
47
+ if receiver_is_bean?(node)
48
+ return bean_method_completion(node)
49
+ end
50
+
47
51
  return if node.receiver
48
52
  return if node.name.to_s.size < CHARS_COUNT
49
53
 
50
54
  ree_objects = ReeObjectFinder.search_objects(@index, node.name.to_s, CANDIDATES_LIMIT)
55
+
51
56
  return if ree_objects.size == 0
52
57
 
53
- parsed_doc = RubyLsp::Ree::ParsedDocumentBuilder.build_from_uri(@uri)
58
+ parsed_doc = RubyLsp::Ree::ParsedDocumentBuilder.build_from_ast(@node_context.parent, @uri)
54
59
 
55
60
  completion_items = get_ree_objects_completions_items(ree_objects, parsed_doc, node)
56
- puts_items_into_response(completion_items)
61
+ put_items_into_response(completion_items)
57
62
  end
58
63
 
59
64
  def receiver_is_enum?(node)
@@ -64,12 +69,16 @@ module RubyLsp
64
69
  node.receiver && node.receiver.is_a?(Prism::CallNode) && ReeObjectFinder.find_dao(@index, node.receiver.name.to_s)
65
70
  end
66
71
 
72
+ def receiver_is_bean?(node)
73
+ node.receiver && node.receiver.is_a?(Prism::CallNode) && ReeObjectFinder.find_bean(@index, node.receiver.name.to_s)
74
+ end
75
+
67
76
  def enum_value_completion(node)
68
77
  enum_obj = ReeObjectFinder.find_enum(@index, node.receiver.name.to_s)
69
78
  location = node.receiver.location
70
79
 
71
80
  completion_items = get_enum_values_completion_items(enum_obj, location)
72
- puts_items_into_response(completion_items)
81
+ put_items_into_response(completion_items)
73
82
  end
74
83
 
75
84
  def dao_filter_completion(node)
@@ -77,10 +86,19 @@ module RubyLsp
77
86
  location = node.receiver.location
78
87
 
79
88
  completion_items = get_dao_filters_completion_items(dao_obj, location)
80
- puts_items_into_response(completion_items)
89
+ put_items_into_response(completion_items)
90
+ end
91
+
92
+ def bean_method_completion(node)
93
+ bean_obj = ReeObjectFinder.find_bean(@index, node.receiver.name.to_s)
94
+ location = node.receiver.location
95
+
96
+ completion_items = get_bean_methods_completion_items(bean_obj, location)
97
+
98
+ put_items_into_response(completion_items)
81
99
  end
82
100
 
83
- def puts_items_into_response(items)
101
+ def put_items_into_response(items)
84
102
  items.each do |item|
85
103
  @response_builder << item
86
104
  end
@@ -6,6 +6,40 @@ module RubyLsp
6
6
  include Requests::Support::Common
7
7
  include RubyLsp::Ree::ReeLspUtils
8
8
 
9
+ def get_bean_methods_completion_items(bean_obj, location)
10
+ bean_node = RubyLsp::Ree::ParsedDocumentBuilder.build_from_uri(bean_obj.uri, :bean)
11
+
12
+ range = Interface::Range.new(
13
+ start: Interface::Position.new(line: location.start_line - 1, character: location.end_column + 1),
14
+ end: Interface::Position.new(line: location.start_line - 1, character: location.end_column + 1),
15
+ )
16
+
17
+ bean_node.bean_methods.map do |bean_method|
18
+ signature = bean_method.signatures.first
19
+
20
+ label_details = Interface::CompletionItemLabelDetails.new(
21
+ description: "method",
22
+ detail: get_detail_string(signature)
23
+ )
24
+
25
+ Interface::CompletionItem.new(
26
+ label: bean_method.name,
27
+ label_details: label_details,
28
+ filter_text: bean_method.name,
29
+ text_edit: Interface::TextEdit.new(
30
+ range: range,
31
+ new_text: get_method_string(bean_method.name, signature)
32
+ ),
33
+ kind: Constant::CompletionItemKind::METHOD,
34
+ insert_text_format: Constant::InsertTextFormat::SNIPPET,
35
+ data: {
36
+ owner_name: "Object",
37
+ guessed_type: false,
38
+ }
39
+ )
40
+ end
41
+ end
42
+
9
43
  def get_dao_filters_completion_items(dao_obj, location)
10
44
  dao_node = RubyLsp::Ree::ParsedDocumentBuilder.build_from_uri(dao_obj.uri, :dao)
11
45
 
@@ -79,10 +113,11 @@ module RubyLsp
79
113
  class_name = full_class_name.split('::').last
80
114
 
81
115
  package_name = package_name_from_uri(entry.uri)
82
-
116
+ file_name = File.basename(entry.uri.to_s)
117
+
83
118
  label_details = Interface::CompletionItemLabelDetails.new(
84
119
  description: "from: :#{package_name}",
85
- detail: ""
120
+ detail: " #{file_name}"
86
121
  )
87
122
 
88
123
  Interface::CompletionItem.new(
@@ -163,7 +198,6 @@ module RubyLsp
163
198
 
164
199
  def get_additional_text_edits_for_constant(parsed_doc, class_name, package_name, entry)
165
200
  if parsed_doc.includes_linked_constant?(class_name)
166
- $stderr.puts("links already include #{class_name}")
167
201
  return []
168
202
  end
169
203
 
@@ -173,7 +207,7 @@ module RubyLsp
173
207
  fn_name = File.basename(entry_uri, ".*")
174
208
  "\s\slink :#{fn_name}, import: -> { #{class_name} }"
175
209
  else
176
- path = path_from_package(entry_uri)
210
+ path = path_from_package_folder(entry_uri)
177
211
  "\s\slink \"#{path}\", import: -> { #{class_name} }"
178
212
  end
179
213
 
@@ -200,7 +234,6 @@ module RubyLsp
200
234
 
201
235
  def get_additional_text_edits_for_method(parsed_doc, fn_name, package_name)
202
236
  if parsed_doc.includes_linked_object?(fn_name)
203
- $stderr.puts("links already include #{fn_name}")
204
237
  return []
205
238
  end
206
239
 
@@ -14,17 +14,56 @@ module RubyLsp
14
14
  @index = index
15
15
  @uri = uri
16
16
 
17
- dispatcher.register(self, :on_call_node_enter, :on_symbol_node_enter, :on_string_node_enter)
17
+ dispatcher.register(self, :on_call_node_enter, :on_symbol_node_enter, :on_string_node_enter, :on_constant_read_node_enter)
18
+ end
19
+
20
+ def on_constant_read_node_enter(node)
21
+ link_nodes = if @node_context.parent.is_a?(Prism::CallNode)
22
+ # inside link node
23
+ link_node = RubyLsp::Ree::ParsedLinkNode.new(@node_context.parent)
24
+ link_node.parse_imports
25
+ [link_node]
26
+ else
27
+ parsed_doc = RubyLsp::Ree::ParsedDocumentBuilder.build_from_ast(@node_context.parent, @uri)
28
+ parsed_doc.link_nodes
29
+ end
30
+
31
+ link_nodes.each do |link_node|
32
+ if link_node.imports.include?(node.name.to_s)
33
+ uri = ''
34
+ if link_node.file_path_type?
35
+ path = find_local_file_path(link_node.name)
36
+ next unless path
37
+
38
+ uri = File.join(Dir.pwd, path)
39
+ else
40
+ package_name = link_node.link_package_name || package_name_from_uri(@uri)
41
+
42
+ method_candidates = @index[link_node.name]
43
+ next if !method_candidates || method_candidates.size == 0
44
+
45
+ method = method_candidates.detect{ package_name_from_uri(_1.uri) == package_name }
46
+ next unless method
47
+
48
+ uri = method.uri.to_s
49
+ end
50
+
51
+ @response_builder << Interface::Location.new(
52
+ uri: uri,
53
+ range: Interface::Range.new(
54
+ start: Interface::Position.new(line: 0, character: 0),
55
+ end: Interface::Position.new(line: 0, character: 0),
56
+ ),
57
+ )
58
+ end
59
+ end
18
60
  end
19
61
 
20
62
  def on_call_node_enter(node)
21
63
  message = node.message
22
- $stderr.puts("definition on_call_node_enter #{message}")
23
-
24
64
  return unless message
25
65
 
26
66
  method = @index[message].detect{ !_1.location.nil? }
27
-
28
67
  return unless method
29
68
 
30
69
  @response_builder << Interface::Location.new(
@@ -63,8 +102,7 @@ module RubyLsp
63
102
  end
64
103
 
65
104
  def on_string_node_enter(node)
66
- file_name = node.unescaped + ".rb"
67
- local_path = Dir[File.join('**', file_name)].first
105
+ local_path = find_local_file_path(node.unescaped)
68
106
 
69
107
  if local_path
70
108
  @response_builder << Interface::Location.new(
@@ -6,18 +6,19 @@ class RubyLsp::Ree::ParsedDocument
6
6
  LINK_DSL_MODULE = 'Ree::LinkDSL'
7
7
 
8
8
  attr_reader :ast, :package_name, :class_node, :fn_node, :fn_block_node, :class_includes,
9
- :link_nodes, :values, :action_node, :action_block_node, :dao_node, :dao_block_node, :filters
9
+ :link_nodes, :values, :action_node, :action_block_node, :dao_node, :dao_block_node, :filters,
10
+ :bean_node, :bean_block_node, :bean_methods
10
11
 
11
12
  def initialize(ast)
12
13
  @ast = ast
13
14
  end
14
15
 
15
16
  def links_container_node
16
- @fn_node || @action_node || @dao_node
17
+ @fn_node || @action_node || @dao_node || @bean_node
17
18
  end
18
19
 
19
20
  def links_container_block_node
20
- @fn_block_node || @action_block_node || @dao_block_node
21
+ @fn_block_node || @action_block_node || @dao_block_node || @bean_block_node
21
22
  end
22
23
 
23
24
  def includes_link_dsl?
@@ -65,6 +66,13 @@ class RubyLsp::Ree::ParsedDocument
65
66
  @dao_block_node = @dao_node&.block
66
67
  end
67
68
 
69
+ def parse_bean_node
70
+ return unless class_node
71
+
72
+ @bean_node ||= class_node.body.body.detect{ |node| node.name == :bean }
73
+ @bean_block_node = @bean_node&.block
74
+ end
75
+
68
76
  def parse_class_includes
69
77
  return unless class_node
70
78
 
@@ -113,13 +121,25 @@ class RubyLsp::Ree::ParsedDocument
113
121
 
114
122
  end
115
123
 
124
+ def parse_bean_methods
125
+ return unless class_node
126
+
127
+ @bean_methods ||= class_node.body.body
128
+ .select{ _1.is_a?(Prism::DefNode) }
129
+ .map{ OpenStruct.new(name: _1.name.to_s, signatures: parse_signatures_from_params(_1.parameters)) }
130
+ end
131
+
116
132
  def parse_filter_signature(filter_node)
117
133
  return [] unless filter_node
118
134
 
119
135
  lambda_node = filter_node.arguments&.arguments[1]
120
136
  return [] unless lambda_node
121
137
 
122
- signature_params = signature_params_from_node(lambda_node.parameters.parameters)
138
+ parse_signatures_from_params(lambda_node.parameters.parameters)
139
+ end
140
+
141
+ def parse_signatures_from_params(parameters)
142
+ signature_params = signature_params_from_node(parameters)
123
143
  [RubyIndexer::Entry::Signature.new(signature_params)]
124
144
  end
125
145
 
@@ -13,6 +13,14 @@ class RubyLsp::Ree::ParsedDocumentBuilder
13
13
  document
14
14
  end
15
15
 
16
+ def self.build_from_ast(ast, uri, type = nil)
17
+ document = build_document(ast, type)
18
+
19
+ document.set_package_name(package_name_from_uri(uri))
20
+
21
+ document
22
+ end
23
+
16
24
  def self.build_from_source(source, type = nil)
17
25
  ast = Prism.parse(source).value
18
26
  build_document(ast, type)
@@ -24,6 +32,8 @@ class RubyLsp::Ree::ParsedDocumentBuilder
24
32
  build_enum_document(ast)
25
33
  when :dao
26
34
  build_dao_document(ast)
35
+ when :bean
36
+ build_bean_document(ast)
27
37
  else
28
38
  build_regular_document(ast)
29
39
  end
@@ -35,6 +45,8 @@ class RubyLsp::Ree::ParsedDocumentBuilder
35
45
  document.parse_class_node
36
46
  document.parse_fn_node
37
47
  document.parse_action_node
48
+ document.parse_bean_node
49
+ document.parse_dao_node
38
50
  document.parse_class_includes
39
51
  document.parse_links
40
52
 
@@ -57,5 +69,14 @@ class RubyLsp::Ree::ParsedDocumentBuilder
57
69
  document.parse_filters
58
70
 
59
71
  document
60
- end
72
+ end
73
+
74
+ def self.build_bean_document(ast)
75
+ document = RubyLsp::Ree::ParsedDocument.new(ast)
76
+
77
+ document.parse_class_node
78
+ document.parse_bean_methods
79
+
80
+ document
81
+ end
61
82
  end
@@ -30,9 +30,32 @@ class RubyLsp::Ree::ParsedLinkNode
30
30
  @from_param.value.unescaped
31
31
  end
32
32
 
33
- def parse_name
34
- name_arg_node = @node.arguments.arguments.first
33
+ def name_arg_node
34
+ @node.arguments.arguments.first
35
+ end
36
+
37
+ def link_type
38
+ return @link_type if @link_type
39
+
40
+ @link_type = case name_arg_node
41
+ when Prism::SymbolNode
42
+ :object_name
43
+ when Prism::StringNode
44
+ :file_path
45
+ else
46
+ nil
47
+ end
48
+ end
49
+
50
+ def file_path_type?
51
+ link_type == :file_path
52
+ end
35
53
 
54
+ def object_name_type?
55
+ link_type == :object_name
56
+ end
57
+
58
+ def parse_name
36
59
  case name_arg_node
37
60
  when Prism::SymbolNode
38
61
  name_arg_node.value
@@ -3,33 +3,31 @@ module RubyLsp
3
3
  class ReeFormatter
4
4
  include RubyLsp::Requests::Support::Formatter
5
5
  include RubyLsp::Ree::ReeLspUtils
6
-
6
+
7
7
  def initialize
8
8
  end
9
-
9
+
10
10
  def run_formatting(uri, document)
11
- $stderr.puts("run_formating")
12
-
13
11
  source = document.source
14
12
  sort_links(source)
15
13
  end
16
-
14
+
17
15
  private
18
-
16
+
19
17
  def sort_links(source)
20
18
  parsed_doc = RubyLsp::Ree::ParsedDocumentBuilder.build_from_source(source)
21
- return source if parsed_doc.link_nodes.size == 0
22
-
19
+ return source if !parsed_doc.link_nodes&.any?
20
+
23
21
  if parsed_doc.link_nodes.any?{ _1.location.start_line != _1.location.end_line }
24
22
  $stderr.puts("multiline link definitions, don't sort")
25
23
  return source
26
24
  end
27
-
25
+
28
26
  # sort link nodes
29
27
  sorted_link_nodes = parsed_doc.link_nodes.sort{ |a, b|
30
28
  a_name = a.node.arguments.arguments.first
31
29
  b_name = b.node.arguments.arguments.first
32
-
30
+
33
31
  if a_name.is_a?(Prism::SymbolNode) && !b_name.is_a?(Prism::SymbolNode)
34
32
  -1
35
33
  elsif b_name.is_a?(Prism::SymbolNode) && !a_name.is_a?(Prism::SymbolNode)
@@ -38,25 +36,25 @@ module RubyLsp
38
36
  a_name.unescaped <=> b_name.unescaped
39
37
  end
40
38
  }
41
-
39
+
42
40
  # check if no re-order
43
41
  if parsed_doc.link_nodes.map{ _1.node.arguments.arguments.first.unescaped } == sorted_link_nodes.map{ _1.node.arguments.arguments.first.unescaped }
44
42
  return source
45
43
  end
46
-
44
+
47
45
  # insert nodes to source
48
46
  link_lines = parsed_doc.link_nodes.map{ _1.location.start_line }
49
-
47
+
50
48
  source_lines = source.lines
51
-
49
+
52
50
  sorted_lines = sorted_link_nodes.map do |sorted_link|
53
51
  source_lines[sorted_link.location.start_line - 1]
54
52
  end
55
-
53
+
56
54
  link_lines.each_with_index do |link_line, index|
57
55
  source_lines[link_line - 1] = sorted_lines[index]
58
56
  end
59
-
57
+
60
58
  source_lines.join()
61
59
  end
62
60
  end
@@ -6,7 +6,7 @@ module RubyLsp
6
6
  class ReeIndexingEnhancement < RubyIndexer::Enhancement
7
7
  include RubyLsp::Ree::ReeLspUtils
8
8
 
9
- REE_INDEXED_OBJECTS = [:fn, :enum, :action, :dao]
9
+ REE_INDEXED_OBJECTS = [:fn, :enum, :action, :dao, :bean]
10
10
 
11
11
  def on_call_node_enter(node)
12
12
  return unless @listener.current_owner
@@ -39,11 +39,11 @@ module RubyLsp
39
39
  class_node = ast.statements.body.detect{ |node| node.is_a?(Prism::ClassNode) }
40
40
  return [] unless class_node
41
41
 
42
- call_node = class_node.body.body.detect{ |node| node.name == :call }
42
+ call_node = class_node.body.body.detect{ |node| node.respond_to?(:name) && node.name == :call }
43
43
  return [] unless call_node
44
-
44
+
45
45
  signature_params = signature_params_from_node(call_node.parameters)
46
-
46
+
47
47
  [RubyIndexer::Entry::Signature.new(signature_params)]
48
48
  end
49
49
 
@@ -3,16 +3,27 @@ module RubyLsp
3
3
  module ReeLspUtils
4
4
  Entry = RubyIndexer::Entry
5
5
 
6
+ def find_local_file_path(file_path)
7
+ file_name = file_path + ".rb"
8
+ Dir[File.join('**', file_name)].first
9
+ end
10
+
6
11
  def package_name_from_uri(uri)
7
12
  uri_parts = uri.to_s.split('/')
8
- package_index = uri_parts.find_index('package') + 1
9
- uri_parts[package_index]
13
+
14
+ package_folder_index = uri_parts.find_index('package')
15
+ return unless package_folder_index
16
+
17
+ uri_parts[package_folder_index + 1]
10
18
  end
11
19
 
12
- def path_from_package(uri)
20
+ def path_from_package_folder(uri)
13
21
  uri_parts = uri.chomp(File.extname(uri)).split('/')
14
- pack_folder_index = uri_parts.index('package')
15
- uri_parts.drop(pack_folder_index+1).join('/')
22
+
23
+ package_folder_index = uri_parts.index('package')
24
+ return unless package_folder_index
25
+
26
+ uri_parts.drop(package_folder_index+1).join('/')
16
27
  end
17
28
 
18
29
  def get_ree_type(ree_object)
@@ -1,17 +1,20 @@
1
1
  module RubyLsp
2
2
  module Ree
3
3
  class ReeObjectFinder
4
- MAX_LIMIT = 100
4
+ MAX_LIMIT = 1000
5
5
 
6
6
  REE_OBJECT_STRING = 'ree_object'
7
7
  ENUM_TYPE_STRING = 'type: :enum'
8
8
  DAO_TYPE_STRING = 'type: :dao'
9
+ BEAN_TYPE_STRING = 'type: :bean'
9
10
 
10
11
  def self.search_objects(index, name, limit)
11
12
  index.prefix_search(name)
12
- .take(MAX_LIMIT).map(&:first)
13
+ .take(MAX_LIMIT)
14
+ .flatten
13
15
  .select{ _1.comments }
14
16
  .select{ _1.comments.to_s.lines.first&.chomp == REE_OBJECT_STRING }
17
+ .sort_by{ _1.name.length }
15
18
  .take(limit)
16
19
  end
17
20
 
@@ -28,6 +31,13 @@ module RubyLsp
28
31
 
29
32
  objects_by_name.detect{ _1.comments.lines[1]&.chomp == DAO_TYPE_STRING }
30
33
  end
34
+
35
+ def self.find_bean(index, name)
36
+ objects_by_name = index[name]
37
+ return unless objects_by_name
38
+
39
+ objects_by_name.detect{ _1.comments.lines[1]&.chomp == BEAN_TYPE_STRING }
40
+ end
31
41
  end
32
42
  end
33
43
  end
@@ -3,7 +3,7 @@
3
3
  module Ruby
4
4
  module Lsp
5
5
  module Ree
6
- VERSION = "0.1.1"
6
+ VERSION = "0.1.2"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp-ree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-10 00:00:00.000000000 Z
11
+ date: 2025-02-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Ruby LSP addon that adds extra editor functionality for Ree applications
14
14
  email: