solargraph 0.51.0 → 0.51.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 925e6692e134d83820ade3224a10e1e25ba8b7f65c5a8399b185574f225ad8e7
4
- data.tar.gz: 319f943451956ac714e110f48db851391cfb5c4b2ceb1e3e8d2eb2d22dc56c05
3
+ metadata.gz: 353848ebb4c6cbcd1d29568a94ca2350bcfc3278292439f20ca193ac3feebbe4
4
+ data.tar.gz: d679687c21c2749452b8f32580c5bd0d3753c2b5422a1d0e2a5789044b3892c9
5
5
  SHA512:
6
- metadata.gz: df03f1f0ed8e51f8c286395c4b87b1c254c78a897761ec71a9af896ef86c01e6d4285530ddf2e40c72f17afb6b5d87be11e219cc46859d7d7b7c2e05e24687bf
7
- data.tar.gz: dd6b4f96bc8e6361bcfd313129a4ba9d680c8db45484deea040ec5fa6ba5a8873dcefa2980af4824d26f2ecc16d68bd5b5554e4978ae71853e22df49ed427894
6
+ metadata.gz: 9ea698ddf8c609f6f912a02cd0b6b9952719c7d4f5398a68c1662004db285f1b6a0ee2ad2bedb60fecff61cd559ed9f685bb19a3594f59de591c4f8f659c2622
7
+ data.tar.gz: '020828068d62bded6d4ed1f205fdcc7cc961d108df8c6e2060d429c69a02e53652b1dd8587d6c697ae81109d50b7f8de2abf84240606a76c30bce24cbf0d43ab'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.51.1 - January 23, 2025
2
+ - Format example code
3
+ - Block infers yieldself from chain
4
+
1
5
  ## 0.51.0 - January 19, 2025
2
6
  - Resolve self in yieldself tags
3
7
  - Include absolute paths in config (#674)
@@ -63,7 +63,12 @@ module Solargraph
63
63
  if receiver_pin && receiver_pin.docstring
64
64
  ys = receiver_pin.docstring.tag(:yieldself)
65
65
  if ys && ys.types && !ys.types.empty?
66
- return ComplexType.try_parse(*ys.types).qualify(api_map, receiver_pin.context.namespace).self_to(receiver_pin.full_context.namespace)
66
+ target = if chain.links.first.is_a?(Source::Chain::Constant)
67
+ receiver_pin.full_context.namespace
68
+ else
69
+ full_context.namespace
70
+ end
71
+ return ComplexType.try_parse(*ys.types).qualify(api_map, receiver_pin.context.namespace).self_to(target)
67
72
  end
68
73
  end
69
74
  nil
@@ -130,11 +130,7 @@ module Solargraph
130
130
  end
131
131
  @documentation += "\n\n" unless @documentation.empty?
132
132
  @documentation += "Visibility: #{visibility}"
133
- example_tags = docstring.tags(:example)
134
- unless example_tags.empty?
135
- @documentation += "\n\nExamples:\n\n"
136
- @documentation += example_tags.map(&:text).join("\n")
137
- end
133
+ concat_example_tags
138
134
  end
139
135
  @documentation.to_s
140
136
  end
@@ -335,6 +331,18 @@ module Solargraph
335
331
  [name, :arg]
336
332
  end
337
333
  end
334
+
335
+ def concat_example_tags
336
+ example_tags = docstring.tags(:example)
337
+ return if example_tags.empty?
338
+ @documentation += "\n\nExamples:\n\n```ruby\n"
339
+ @documentation += example_tags.map do |tag|
340
+ (tag.name ? "# #{tag.name}\n" : '') +
341
+ "#{tag.text}\n"
342
+ end
343
+ .join("\n")
344
+ .concat("```\n")
345
+ end
338
346
  end
339
347
  end
340
348
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Solargraph
4
- VERSION = '0.51.0'
4
+ VERSION = '0.51.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solargraph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.51.0
4
+ version: 0.51.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-19 00:00:00.000000000 Z
11
+ date: 2025-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backport