Module: Solargraph::Pin::Conversions
Instance Attribute Summary
Attributes included from Common
#context, #location
Instance Method Summary
collapse
Methods included from Common
#binder, #closure, #closure=, #comments, #each_closure, #name, #namespace, #path, #reset_generated!, #return_type, #source
#documentation, normalize_indentation, strip_html_comments
Instance Method Details
#completion_item ⇒ Hash
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/solargraph/pin/conversions.rb', line 38
def completion_item
@completion_item ||= {
label: name,
kind: completion_item_kind,
detail: detail,
data: {
path: path,
return_type: return_type.tag,
location: location&.to_hash,
deprecated: deprecated?
}
}
end
|
#completion_item_kind ⇒ Integer
17
18
19
|
# File 'lib/solargraph/pin/conversions.rb', line 17
def completion_item_kind
raise NotImplementedError
end
|
#deprecated? ⇒ Boolean
23
24
25
|
# File 'lib/solargraph/pin/conversions.rb', line 23
def deprecated?
raise NotImplementedError
end
|
#detail ⇒ String?
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/solargraph/pin/conversions.rb', line 71
def detail
detail = String.new
unless return_type.undefined?
detail += "=#{if probed?
'~'
else
(proxied? ? '^' : '>')
end} #{return_type}"
end
detail.strip!
return nil if detail.empty?
detail
end
|
#link_documentation ⇒ String?
Get a markdown-flavored link to a documentation page.
90
91
92
|
# File 'lib/solargraph/pin/conversions.rb', line 90
def link_documentation
@link_documentation ||= generate_link
end
|
#probed? ⇒ Boolean
28
29
30
|
# File 'lib/solargraph/pin/conversions.rb', line 28
def probed?
raise NotImplementedError
end
|
#proxied? ⇒ Boolean
33
34
35
|
# File 'lib/solargraph/pin/conversions.rb', line 33
def proxied?
raise NotImplementedError
end
|
#reset_conversions ⇒ void
This method returns an undefined value.
102
103
104
105
106
107
108
|
# File 'lib/solargraph/pin/conversions.rb', line 102
def reset_conversions
@completion_item = nil
@resolve_completion_item = nil
@signature_help = nil
@detail = nil
@link_documentation = nil
end
|
#resolve_completion_item ⇒ Hash
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/solargraph/pin/conversions.rb', line 53
def resolve_completion_item
@resolve_completion_item ||= begin
= {}
alldoc = ''
alldoc += documentation unless documentation.nil?
[:documentation] = alldoc unless alldoc.empty?
completion_item.merge()
end
end
|
#signature_help ⇒ ::Array<Hash>
66
67
68
|
# File 'lib/solargraph/pin/conversions.rb', line 66
def signature_help
[]
end
|
#text_documentation ⇒ String?
95
96
97
98
99
|
# File 'lib/solargraph/pin/conversions.rb', line 95
def text_documentation
this_path = path || name || return_type.tag
return nil if this_path == 'undefined'
escape_brackets this_path
end
|