module Solargraph::Pin::Conversions
def completion_item
-
(Hash)-
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
def completion_item_kind
- Abstract: -
Returns:
-
(Integer)-
def completion_item_kind raise NotImplementedError end
def deprecated?
-
(Boolean)-
Other tags:
- Abstract: -
def deprecated? raise NotImplementedError end
def detail
-
(String, nil)-
def detail # This property is not cached in an instance variable because it can # change when pins get proxied. detail = String.new detail += "=#{probed? ? '~' : (proxied? ? '^' : '>')} #{return_type.to_s}" unless return_type.undefined? detail.strip! return nil if detail.empty? detail end
def escape_brackets text
-
(String)-
Parameters:
-
text(String) --
def escape_brackets text # text.gsub(/(\<|\>)/, "\\#{$1}") text.gsub("<", '\<').gsub(">", '\>') end
def generate_link
-
(String, nil)-
def generate_link this_path = path || name || return_type.tag return nil if this_path == 'undefined' return nil if this_path.nil? || this_path == 'undefined' return this_path if path.nil? "[#{escape_brackets(this_path).gsub('_', '\\\\_')}](solargraph:/document?query=#{CGI.escape(this_path)})" end
def link_documentation
-
(String)-
def link_documentation @link_documentation ||= generate_link end
def probed?
- Abstract: -
def probed? raise NotImplementedError end
def proxied?
- Abstract: -
def proxied? raise NotImplementedError end
def reset_conversions
-
(void)-
def reset_conversions @completion_item = nil @resolve_completion_item = nil @signature_help = nil @detail = nil @link_documentation = nil end
def resolve_completion_item
-
(Hash)-
def resolve_completion_item @resolve_completion_item ||= begin extra = {} alldoc = '' # alldoc += link_documentation unless link_documentation.nil? # alldoc += "\n\n" unless alldoc.empty? alldoc += documentation unless documentation.nil? extra[:documentation] = alldoc unless alldoc.empty? completion_item.merge(extra) end end
def signature_help
-
(::Array-)
def signature_help [] end
def text_documentation
-
(String, nil)-
def text_documentation this_path = path || name || return_type.tag return nil if this_path == 'undefined' escape_brackets this_path end