Module: Solargraph::Pin::Conversions
Instance Attribute Summary
Attributes included from Common
#context, #location
Instance Method Summary
collapse
Methods included from Common
#binder, #closure, #comments, #name, #namespace, #path, #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 ? location.to_hash : nil),
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
|
# File 'lib/solargraph/pin/conversions.rb', line 71
def detail
detail = String.new
detail += "=#{probed? ? '~' : (proxied? ? '^' : '>')} #{return_type.to_s}" unless return_type.undefined?
detail.strip!
return nil if detail.empty?
detail
end
|
#link_documentation ⇒ String
Get a markdown-flavored link to a documentation page.
84
85
86
|
# File 'lib/solargraph/pin/conversions.rb', line 84
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.
96
97
98
99
100
101
102
|
# File 'lib/solargraph/pin/conversions.rb', line 96
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?
89
90
91
92
93
|
# File 'lib/solargraph/pin/conversions.rb', line 89
def text_documentation
this_path = path || name || return_type.tag
return nil if this_path == 'undefined'
escape_brackets this_path
end
|