class Solargraph::LanguageServer::Host::Sources
A Host class for managing sources.
def add_uri(uri)
-
(void)-
Parameters:
-
uri(String) --
def add_uri(uri) queue.push(uri) end
def clear
-
(void)-
def clear open_source_hash.clear end
def close uri
-
(void)-
Parameters:
-
uri(String) --
def close uri open_source_hash.delete uri end
def find uri
-
(Solargraph::Source)-
Parameters:
-
uri(String) --
Raises:
-
(FileNotFoundError)- if the URI does not match an open source.
def find uri open_source_hash[uri] || raise(Solargraph::FileNotFoundError, "Host could not find #{uri}") end
def include? uri
-
(Boolean)-
Parameters:
-
uri(String) --
def include? uri open_source_hash.key? uri end
def open uri, text, version
-
(Source)-
Parameters:
-
version(Integer) -- -
text(String) -- -
uri(String) --
def open uri, text, version filename = uri_to_file(uri) source = Solargraph::Source.new(text, filename, version) open_source_hash[uri] = source end
def open_from_disk uri
-
(void)-
Parameters:
-
uri(String) --
def open_from_disk uri source = Solargraph::Source.load(UriHelpers.uri_to_file(uri)) open_source_hash[uri] = source end
def open_source_hash
-
(Hash{String => Solargraph::Source})-
def open_source_hash @open_source_hash ||= {} end
def queue
-
(::Array-)
def queue @queue ||= [] end
def update uri, updater
-
(void)-
Parameters:
-
updater(Source::Updater) -- -
uri(String) --
Raises:
-
(FileNotFoundError)- if the URI does not match an open source.
def update uri, updater src = find(uri) open_source_hash[uri] = src.synchronize(updater) changed notify_observers uri end