Skip to content

Commit

Permalink
Use RegexpCompletor directly. Not through class method of InputComple…
Browse files Browse the repository at this point in the history
…tor.
  • Loading branch information
tompng committed Oct 10, 2023
1 parent 2088784 commit a92c2a2
Show file tree
Hide file tree
Showing 5 changed files with 398 additions and 409 deletions.
19 changes: 0 additions & 19 deletions lib/irb/completion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
module IRB
module InputCompletor # :nodoc:

BASIC_WORD_BREAK_CHARACTERS = " \t\n`><=;|&{("

GEM_PATHS =
if defined?(Gem::Specification)
Gem::Specification.latest_specs(true).map { |s|
Expand Down Expand Up @@ -62,22 +60,5 @@ def self.retrieve_files_to_require_relative_from_current_dir
path.sub(/\.(rb|#{RbConfig::CONFIG['DLEXT']})\z/, '')
}
end

def self.completor_class
require_relative 'completion/regexp_completor'
RegexpCompletor
end

def self.retrieve_completion_candidates(target, preposing, postposing, bind:)
# This method is always called before retrieve_completion_doc_namespace.
# To use preposing, postposing and binding information in those methods,
# We need to store them as an instance of completor_class into @completor.
@completor = completor_class.new(target, preposing, postposing, bind: bind)
@completor.completion_candidates
end

def self.retrieve_completion_doc_namespace(target)
@completor.doc_namespace(target)
end
end
end
Loading

0 comments on commit a92c2a2

Please sign in to comment.