Sha256: c8a73172da5be805072e74f632d61063b98793eb05d2d4b6fee83920521ef635
Contents?: true
Size: 880 Bytes
Versions: 17
Compression:
Stored size: 880 Bytes
Contents
module Rsense module Server module Listeners end end end class Rsense::Server::Listeners::WhereEventListener include Java::org.cx4a.rsense::Project::EventListener EventType = Rsense::Typing::Graph::EventListener::EventType SourceLocation = Rsense::Util::SourceLocation attr_accessor :line, :closest, :name, :context def initialize(context) @context = context end def prepare(line) @line = line end def update(event) eligible = [ EventType::DEFINE, EventType::CLASS, EventType::MODULE ] if context.main && eligible.any? {|e| event.type == e} if event.name && event.node loc = SourceLocation.of(event.node) loc_line = loc.getLine() if loc && @line >= loc_line && @line - @closest > @line - loc_line @closest = loc_line @name = event.name end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems