Class: PlatformosCheck::LanguageServer::HoverProvider
- Inherits:
-
Object
- Object
- PlatformosCheck::LanguageServer::HoverProvider
show all
- Includes:
- CompletionHelper, RegexHelpers
- Defined in:
- lib/platformos_check/language_server/hover_provider.rb
Defined Under Namespace
Classes: CurrentToken
Constant Summary
RegexHelpers::HTML_LIQUID_PLACEHOLDER, RegexHelpers::LIQUID_TAG, RegexHelpers::LIQUID_TAG_OR_VARIABLE, RegexHelpers::LIQUID_VARIABLE, RegexHelpers::START_OR_END_QUOTE
CompletionHelper::WORD
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#matches
#cursor_on_first_word?, #cursor_on_start_content?, #first_word
Constructor Details
#initialize(storage = InMemoryStorage.new) ⇒ HoverProvider
23
24
25
|
# File 'lib/platformos_check/language_server/hover_provider.rb', line 23
def initialize(storage = InMemoryStorage.new)
@storage = storage
end
|
Instance Attribute Details
#storage ⇒ Object
Returns the value of attribute storage.
9
10
11
|
# File 'lib/platformos_check/language_server/hover_provider.rb', line 9
def storage
@storage
end
|
Class Method Details
.all ⇒ Object
14
15
16
|
# File 'lib/platformos_check/language_server/hover_provider.rb', line 14
def all
@all ||= []
end
|
.inherited(subclass) ⇒ Object
18
19
20
|
# File 'lib/platformos_check/language_server/hover_provider.rb', line 18
def inherited(subclass)
all << subclass
end
|
Instance Method Details
#completions(relative_path, line, col) ⇒ Object
27
28
29
|
# File 'lib/platformos_check/language_server/hover_provider.rb', line 27
def completions(relative_path, line, col)
raise NotImplementedError
end
|
#doc_hash(content) ⇒ Object
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/platformos_check/language_server/hover_provider.rb', line 31
def doc_hash(content)
return {} if content.nil? || content.empty?
{
documentation: {
kind: MarkupKinds::MARKDOWN,
value: content
}
}
end
|
42
43
44
45
46
47
48
49
50
|
# File 'lib/platformos_check/language_server/hover_provider.rb', line 42
def format_hash(entry)
return {} unless entry
return { sortText: entry.name } unless entry.deprecated?
{
tags: [CompletionItemTag::DEPRECATED],
sortText: "~#{entry.name}"
}
end
|