Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Oct 18, 2023
1 parent 5ebdf78 commit 7eaa826
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/ruby_indexer/lib/ruby_indexer/entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Method < Entry
sig { returns(T::Array[Parameter]) }
attr_reader :parameters

sig { returns(String) }
sig { returns(T.nilable(String)) }
attr_reader :namespace

sig do
Expand All @@ -114,7 +114,7 @@ class Method < Entry
namespace: T.nilable(String) # nilable or not?
).void
end
def initialize(name, file_path, location, comments, parameters_node, namespace = nil)
def initialize(name, file_path, location, comments, parameters_node, namespace)
super(name, file_path, location, comments)
@parameters = T.let(list_params(parameters_node), T::Array[Parameter])
@namespace = T.let(namespace, T.nilable(String))
Expand Down
4 changes: 2 additions & 2 deletions lib/ruby_indexer/test/test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def index(source)
@index.index_single(IndexablePath.new(nil, "/fake/path/foo.rb"), source)
end

def assert_entry(expected_name, type, expected_location, expected_namespace)
def assert_entry(expected_name, type, expected_location, expected_namespace = nil)
entries = @index[expected_name]
refute_empty(entries, "Expected #{expected_name} to be indexed")

Expand All @@ -28,7 +28,7 @@ def assert_entry(expected_name, type, expected_location, expected_namespace)
":#{location.end_line - 1}-#{location.end_column}"

assert_equal(expected_location, location_string)
assert_equal(expected_namespace, entry.namespace)
assert_equal(expected_namespace, entry.namespace) if expected_namespace
end

def refute_entry(expected_name)
Expand Down

0 comments on commit 7eaa826

Please sign in to comment.