ruby-lsp 0.18.0 → 0.18.1

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: 407c26b9ad43a3992fc5b007456dba7c370f4ba6bf398a68bebdfaaafc58ba81
4
- data.tar.gz: b890b6762b8d1b4fe43632d6d74e3b0fc1e83168f8d51ccbd2b659df389bff42
3
+ metadata.gz: 42aef038c33d8c03d661dc1c39c745df320399ab86e6c558504c79c93bac4952
4
+ data.tar.gz: ff4ce59697e498c965a0db7b8df44de12e4c81cebb6ef84d50cc54664647f913
5
5
  SHA512:
6
- metadata.gz: 75a2a425311f1b07969fea0849b7b214babd8b455d1a93a4c1883a75df7f26ec9d7c7e2748a7499a404313eb93ec3391a19d22102bc0658d9eb296f4ceaf48a4
7
- data.tar.gz: 536fd4d95c63b493f83a1620307d21f8aa2c96b71bc3782975f55173bc5c7027be5399928a19508bb2ed08f222ae86d075d721e30b334dae7fa097caf71fb558
6
+ metadata.gz: 1a88854595b50bab0ede9aaaa40fe8d765afb6f8744246c8d3407769ad981d00579b20a52f61c4f2c929d8ecdd3578625093b41cf30f6c7224ac64117a201b39
7
+ data.tar.gz: 9093a75fbecd3349e0b6bd80bc899928ea40a4afb2c2a1ae64a5be1bde84bf800280a24910a35ff7eac3b7e470785a649a370214f9f51b8bbd898ede81e09903
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.18.0
1
+ 0.18.1
@@ -98,8 +98,13 @@ module RubyIndexer
98
98
  # object is dropped, so this will not prevent updates
99
99
  if correct_group
100
100
  correct_group.filter_map do |comment|
101
- content = comment.slice
102
- content if content.valid_encoding?
101
+ content = comment.slice.chomp
102
+
103
+ if content.valid_encoding?
104
+ content.delete_prefix!("#")
105
+ content.delete_prefix!(" ")
106
+ content
107
+ end
103
108
  end.join("\n")
104
109
  else
105
110
  ""
@@ -605,5 +605,19 @@ module RubyIndexer
605
605
  assert_entry("Foo::Bar", Entry::Class, "/fake/path/foo.rb:2-4:3-7")
606
606
  assert_entry("Qux", Entry::Class, "/fake/path/foo.rb:5-4:6-7")
607
607
  end
608
+
609
+ def test_lazy_comment_fetching_uses_correct_line_breaks_for_rendering
610
+ path = "lib/ruby_lsp/node_context.rb"
611
+ indexable = IndexablePath.new("#{Dir.pwd}/lib", path)
612
+
613
+ @index.index_single(indexable, collect_comments: false)
614
+
615
+ entry = @index["RubyLsp::NodeContext"].first
616
+
617
+ assert_equal(<<~COMMENTS.chomp, entry.comments)
618
+ This class allows listeners to access contextual information about a node in the AST, such as its parent,
619
+ its namespace nesting, and the surrounding CallNode (e.g. a method call).
620
+ COMMENTS
621
+ end
608
622
  end
609
623
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-lsp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-19 00:00:00.000000000 Z
11
+ date: 2024-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: language_server-protocol