solargraph 0.39.12 → 0.39.13
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/SPONSORS.md +4 -0
- data/lib/solargraph/api_map.rb +1 -1
- data/lib/solargraph/library.rb +3 -3
- data/lib/solargraph/pin/yard_pin/method.rb +16 -1
- data/lib/solargraph/pin/yard_pin/yard_mixin.rb +2 -8
- data/lib/solargraph/source_map/clip.rb +1 -1
- data/lib/solargraph/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b06a4823fe5895875513bafc0192b627ecc2a5eff460bdc4e9bd511e8d31ecda
|
4
|
+
data.tar.gz: e5cfad1cfaa75dec019e2a772297c4f5c936370a9dcb49d1a61ae1e9e0529581
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e169cdfe2badf421a2323c6e796d346dea9c17f1b919a2d96de47ac7f1d0a3ebc77a799ac1ff7f44022b6621c01936fb31178ec9db56ea0b6ee63f44e279f47
|
7
|
+
data.tar.gz: 1c7783cd9b43ed4b9dc29a30fea180c10c9440961a630e7180f4101bcc064b40db9fd9018b5d94594cf061c9b993402cf18ffdcff3a4537f0366dd6f29992865
|
data/SPONSORS.md
CHANGED
@@ -4,6 +4,10 @@ Solargraph is developed and maintained by [Castwide Technologies](https://castwi
|
|
4
4
|
|
5
5
|
The following people and organizations provide funding or other resources. [Become a sponsor](https://patreon.com/castwide)
|
6
6
|
|
7
|
+
## Linked Sponsors
|
8
|
+
|
9
|
+
- **[Calyptix Security](https://www.calyptix.com/)**
|
10
|
+
|
7
11
|
## Named Sponsors
|
8
12
|
|
9
13
|
- Emily Strickland
|
data/lib/solargraph/api_map.rb
CHANGED
@@ -423,7 +423,7 @@ module Solargraph
|
|
423
423
|
# api_map.document('String#split')
|
424
424
|
#
|
425
425
|
# @param path [String] The path to find
|
426
|
-
# @return [Array<YARD::
|
426
|
+
# @return [Array<YARD::CodeObjects::Base>]
|
427
427
|
def document path
|
428
428
|
rake_yard(store)
|
429
429
|
docs = []
|
data/lib/solargraph/library.rb
CHANGED
@@ -174,8 +174,8 @@ module Solargraph
|
|
174
174
|
if cursor.comment?
|
175
175
|
source = read(filename)
|
176
176
|
offset = Solargraph::Position.to_offset(source.code, Solargraph::Position.new(line, column))
|
177
|
-
lft = source.code[0..offset-1].match(
|
178
|
-
rgt = source.code[offset..-1].match(/^([a-z0-9_]*)(:[a-z0-9_:]*)
|
177
|
+
lft = source.code[0..offset-1].match(/[\[<, ]([a-z0-9_:]*)\z/i)
|
178
|
+
rgt = source.code[offset..-1].match(/^([a-z0-9_]*)(:[a-z0-9_:]*)?[\]>, ]/i)
|
179
179
|
if lft && rgt
|
180
180
|
tag = lft[1] + rgt[1]
|
181
181
|
clip = api_map.clip(cursor)
|
@@ -259,7 +259,7 @@ module Solargraph
|
|
259
259
|
end
|
260
260
|
|
261
261
|
# @param query [String]
|
262
|
-
# @return [Array<YARD::
|
262
|
+
# @return [Array<YARD::CodeObjects::Base>]
|
263
263
|
def document query
|
264
264
|
catalog
|
265
265
|
api_map.document query
|
@@ -6,6 +6,12 @@ module Solargraph
|
|
6
6
|
class Method < Pin::Method
|
7
7
|
include YardMixin
|
8
8
|
|
9
|
+
# @param code_object [YARD::CodeObjects::Base]
|
10
|
+
# @param name [String, nil]
|
11
|
+
# @param scope [Symbol, nil]
|
12
|
+
# @param visibility [Symbol, nil]
|
13
|
+
# @param closure [Solargraph::Pin::Closure, nil]
|
14
|
+
# @param spec [Gem::Specification]
|
9
15
|
def initialize code_object, name = nil, scope = nil, visibility = nil, closure = nil, spec = nil
|
10
16
|
closure ||= Solargraph::Pin::Namespace.new(
|
11
17
|
name: code_object.namespace.to_s,
|
@@ -25,9 +31,14 @@ module Solargraph
|
|
25
31
|
|
26
32
|
private
|
27
33
|
|
34
|
+
# @param code_object [YARD::CodeObjects::Base]
|
35
|
+
# @return [Array<Solargraph::Pin::Parameter>]
|
28
36
|
def get_parameters code_object
|
29
37
|
return [] unless code_object.is_a?(YARD::CodeObjects::MethodObject)
|
30
|
-
|
38
|
+
# HACK: Skip `nil` and `self` parameters that are sometimes emitted
|
39
|
+
# for methods defined in C
|
40
|
+
# See https://github.com/castwide/solargraph/issues/345
|
41
|
+
code_object.parameters.select { |a| a[0] && a[0] != 'self' }.map do |a|
|
31
42
|
Solargraph::Pin::Parameter.new(
|
32
43
|
location: location,
|
33
44
|
closure: self,
|
@@ -40,10 +51,14 @@ module Solargraph
|
|
40
51
|
end
|
41
52
|
end
|
42
53
|
|
54
|
+
# @param a [Array]
|
55
|
+
# @return [String]
|
43
56
|
def arg_name a
|
44
57
|
a[0].match(/[A-Za-z0-9_]*/)[0]
|
45
58
|
end
|
46
59
|
|
60
|
+
# @param a [Array]
|
61
|
+
# @return [Symbol]
|
47
62
|
def arg_type a
|
48
63
|
if a[0].start_with?('**')
|
49
64
|
:kwrestarg
|
@@ -4,16 +4,10 @@ module Solargraph
|
|
4
4
|
module Pin
|
5
5
|
module YardPin
|
6
6
|
module YardMixin
|
7
|
-
attr_reader :code_object
|
8
|
-
|
9
|
-
attr_reader :spec
|
10
|
-
|
11
|
-
attr_reader :location
|
12
|
-
|
13
|
-
@@gate_cache ||= {}
|
14
|
-
|
15
7
|
private
|
16
8
|
|
9
|
+
# @param code_object [YARD::CodeObjects::Base]
|
10
|
+
# @param spec [Gem::Specification]
|
17
11
|
# @return [Solargraph::Location, nil]
|
18
12
|
def object_location code_object, spec
|
19
13
|
return nil if spec.nil? || code_object.nil? || code_object.file.nil? || code_object.line.nil?
|
@@ -156,7 +156,7 @@ module Solargraph
|
|
156
156
|
|
157
157
|
def tag_complete
|
158
158
|
result = []
|
159
|
-
match = source_map.code[0..cursor.offset-1].match(
|
159
|
+
match = source_map.code[0..cursor.offset-1].match(/[\[<, ]([a-z0-9_:]*)\z/i)
|
160
160
|
if match
|
161
161
|
full = match[1]
|
162
162
|
if full.include?('::')
|
data/lib/solargraph/version.rb
CHANGED
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.39.
|
4
|
+
version: 0.39.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Snyder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backport
|