class Solargraph::LanguageServer::Message::Workspace::DidChangeWatchedFiles
Constants
- CHANGED
- CREATED
- DELETED
Public Instance Methods
process()
click to toggle source
# File lib/solargraph/language_server/message/workspace/did_change_watched_files.rb, line 10 def process need_catalog = false # @param change [Hash] params['changes'].each do |change| if change['type'] == CREATED host.create change['uri'] need_catalog = true elsif change['type'] == CHANGED next if host.open?(change['uri']) host.create change['uri'] need_catalog = true elsif change['type'] == DELETED host.delete change['uri'] need_catalog = true else set_error Solargraph::LanguageServer::ErrorCodes::INVALID_PARAMS, "Unknown change type ##{change['type']} for #{uri_to_file(change['uri'])}" end end # Force host to catalog libraries after file changes (see castwide/solargraph#139) host.catalog if need_catalog end