Class: LanguageServer::CompletionProvider::Rcodetools
- Inherits:
-
Object
- Object
- LanguageServer::CompletionProvider::Rcodetools
- Defined in:
- lib/language_server/completion_provider/rcodetools.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(uri:, line:, character:, file_store:) ⇒ Rcodetools
constructor
A new instance of Rcodetools.
Constructor Details
#initialize(uri:, line:, character:, file_store:) ⇒ Rcodetools
Returns a new instance of Rcodetools.
19 20 21 22 23 24 |
# File 'lib/language_server/completion_provider/rcodetools.rb', line 19 def initialize(uri:, line:, character:, file_store:) @uri = uri @line = line @character = character @file_store = file_store end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/language_server/completion_provider/rcodetools.rb', line 26 def call _, candidates = Filter.run(source, lineno: @line + 1, column: @character) candidates.map do |candidate| method_name, description = candidate.split(/\0/, 2) Protocol::Interfaces::CompletionItem.new( label: method_name, detail: description, kind: Protocol::Constants::CompletionItemKind::METHOD ) end end |