ruby-lsp-rails 0.3.18 → 0.3.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 159bd26f9edd1f611d7f13cb5864e63d8ecc1c6180bbf5a426b9e40a98ce25ba
4
- data.tar.gz: 5266ed45904e0d62f074684a3a943ac1ef66b7827c4177ee7631d5ae46118553
3
+ metadata.gz: 68571fad74f7aaf4caf243921b544515d55a0121dfcb4edf012ec39cdb77edf7
4
+ data.tar.gz: 2b703f0d4c79171e186722f77b779036df5ca9e40c8025b0ed62688c546871b2
5
5
  SHA512:
6
- metadata.gz: ab185650a7d5d24f1d7e7faf29cea5eabc99d905525ea840b2000003059393c60be8b79ef9f97ef3a78bf58ae695a5d5f19aa5bbecc9ea367d48090c9614538c
7
- data.tar.gz: ef04db908af2f8ce9ee58a0059e51736f969f487b769a421d7df141cfc0518f31c2aa503eace5cc5ad24db36f56a1855ba55ffc4d5990f1eccc5d8cea1a4931c
6
+ metadata.gz: 33f5e99f7c2dd576ef8cc98d5e33f99909fee41adfe1ea9aa5692c0b4a24e31d3dec55080cc791a3f5e500e0fcba3aa4596a26350fc12c990b030cf51fe7ffde
7
+ data.tar.gz: 040b46b1fe55910199605c39b3193227ba634d9ff6adaf06a334036c05430b38a2ccfb593748752fbe0cbac3aa7a6a8c3e81192b4c3e4258e8a1ad90a6abfb53
@@ -13,9 +13,13 @@ module RubyLsp
13
13
  owner: T.nilable(RubyIndexer::Entry::Namespace),
14
14
  node: Prism::CallNode,
15
15
  file_path: String,
16
+ code_units_cache: T.any(
17
+ T.proc.params(arg0: Integer).returns(Integer),
18
+ Prism::CodeUnitsCache,
19
+ ),
16
20
  ).void
17
21
  end
18
- def on_call_node(index, owner, node, file_path)
22
+ def on_call_node(index, owner, node, file_path, code_units_cache)
19
23
  return unless owner
20
24
 
21
25
  name = node.name
@@ -24,7 +28,7 @@ module RubyLsp
24
28
  when :extend
25
29
  handle_concern_extend(index, owner, node)
26
30
  when :has_one, :has_many, :belongs_to, :has_and_belongs_to_many
27
- handle_association(index, owner, node, file_path)
31
+ handle_association(index, owner, node, file_path, code_units_cache)
28
32
  end
29
33
  end
30
34
 
@@ -36,9 +40,13 @@ module RubyLsp
36
40
  owner: RubyIndexer::Entry::Namespace,
37
41
  node: Prism::CallNode,
38
42
  file_path: String,
43
+ code_units_cache: T.any(
44
+ T.proc.params(arg0: Integer).returns(Integer),
45
+ Prism::CodeUnitsCache,
46
+ ),
39
47
  ).void
40
48
  end
41
- def handle_association(index, owner, node, file_path)
49
+ def handle_association(index, owner, node, file_path, code_units_cache)
42
50
  arguments = node.arguments&.arguments
43
51
  return unless arguments
44
52
 
@@ -53,14 +61,15 @@ module RubyLsp
53
61
 
54
62
  return unless name
55
63
 
64
+ loc = RubyIndexer::Location.from_prism_location(name_arg.location, code_units_cache)
65
+
56
66
  # Reader
57
67
  index.add(RubyIndexer::Entry::Method.new(
58
68
  name,
59
69
  file_path,
60
- name_arg.location,
61
- name_arg.location,
70
+ loc,
71
+ loc,
62
72
  nil,
63
- index.configuration.encoding,
64
73
  [RubyIndexer::Entry::Signature.new([])],
65
74
  RubyIndexer::Entry::Visibility::PUBLIC,
66
75
  owner,
@@ -70,10 +79,9 @@ module RubyLsp
70
79
  index.add(RubyIndexer::Entry::Method.new(
71
80
  "#{name}=",
72
81
  file_path,
73
- name_arg.location,
74
- name_arg.location,
82
+ loc,
83
+ loc,
75
84
  nil,
76
- index.configuration.encoding,
77
85
  [RubyIndexer::Entry::Signature.new([RubyIndexer::Entry::RequiredParameter.new(name: name.to_sym)])],
78
86
  RubyIndexer::Entry::Visibility::PUBLIC,
79
87
  owner,
@@ -3,6 +3,6 @@
3
3
 
4
4
  module RubyLsp
5
5
  module Rails
6
- VERSION = "0.3.18"
6
+ VERSION = "0.3.19"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.18
4
+ version: 0.3.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-07 00:00:00.000000000 Z
11
+ date: 2024-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-lsp
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.19.0
19
+ version: 0.20.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 0.20.0
22
+ version: 0.21.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.19.0
29
+ version: 0.20.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 0.20.0
32
+ version: 0.21.0
33
33
  description: A Ruby LSP addon that adds extra editor functionality for Rails applications
34
34
  email:
35
35
  - ruby@shopify.com
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  requirements: []
83
- rubygems_version: 3.5.20
83
+ rubygems_version: 3.5.21
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: A Ruby LSP addon for Rails