@@ -265,11 +265,11 @@ def on_call_node_enter(node)
265265 when :include , :prepend , :extend
266266 handle_module_operation ( node , message )
267267 when :public
268- handle_visibility_change ( node , Entry :: Visibility :: PUBLIC )
268+ handle_visibility_change ( node , :public )
269269 when :protected
270- handle_visibility_change ( node , Entry :: Visibility :: PROTECTED )
270+ handle_visibility_change ( node , :protected )
271271 when :private
272- handle_visibility_change ( node , Entry :: Visibility :: PRIVATE )
272+ handle_visibility_change ( node , :private )
273273 when :module_function
274274 handle_module_function ( node )
275275 when :private_class_method
@@ -343,7 +343,7 @@ def on_def_node_enter(node)
343343 name_location ,
344344 comments ,
345345 signatures ,
346- Entry :: Visibility :: PUBLIC ,
346+ :public ,
347347 singleton ,
348348 ) )
349349 end
@@ -465,8 +465,8 @@ def on_class_variable_write_node_enter(node)
465465 handle_class_variable ( node , node . name_loc )
466466 end
467467
468- #: (String name, Prism::Location node_location, Array[Entry::Signature] signatures, ?visibility: Entry::Visibility , ?comments: String?) -> void
469- def add_method ( name , node_location , signatures , visibility : Entry :: Visibility :: PUBLIC , comments : nil )
468+ #: (String name, Prism::Location node_location, Array[Entry::Signature] signatures, ?visibility: Symbol , ?comments: String?) -> void
469+ def add_method ( name , node_location , signatures , visibility : :public , comments : nil )
470470 location = Location . from_prism_location ( node_location , @code_units_cache )
471471
472472 @index . add ( Entry ::Method . new (
@@ -621,7 +621,7 @@ def handle_private_constant(node)
621621 # The private_constant method does not resolve the constant name. It always points to a constant that needs to
622622 # exist in the current namespace
623623 entries = @index [ fully_qualify_name ( name ) ]
624- entries &.each { |entry | entry . visibility = Entry :: Visibility :: PRIVATE }
624+ entries &.each { |entry | entry . visibility = :private }
625625 end
626626
627627 #: (Prism::CallNode node) -> void
@@ -868,7 +868,7 @@ def handle_module_function(node)
868868 entry_owner_name = entry . owner &.name
869869 next unless entry_owner_name
870870
871- entry . visibility = Entry :: Visibility :: PRIVATE
871+ entry . visibility = :private
872872
873873 singleton = @index . existing_or_new_singleton_class ( entry_owner_name )
874874 location = Location . from_prism_location ( argument . location , @code_units_cache )
@@ -879,7 +879,7 @@ def handle_module_function(node)
879879 location ,
880880 collect_comments ( node ) &.concat ( entry . comments ) ,
881881 entry . signatures ,
882- Entry :: Visibility :: PUBLIC ,
882+ :public ,
883883 singleton ,
884884 ) )
885885 end
@@ -894,7 +894,7 @@ def handle_private_class_method(node)
894894 # If we're passing a method definition directly to `private_class_method`, push a new private scope. That will be
895895 # applied when the indexer finds the method definition and then popped on `call_node_leave`
896896 if arguments . first . is_a? ( Prism ::DefNode )
897- @visibility_stack . push ( VisibilityScope . new ( visibility : Entry :: Visibility :: PRIVATE ) )
897+ @visibility_stack . push ( VisibilityScope . new ( visibility : :private ) )
898898 return
899899 end
900900
@@ -921,9 +921,7 @@ def handle_private_class_method(node)
921921 entries = @index . resolve_method ( name , @index . existing_or_new_singleton_class ( owner_name ) . name )
922922 next unless entries
923923
924- entries . each do |entry |
925- entry . visibility = Entry ::Visibility ::PRIVATE
926- end
924+ entries . each { |entry | entry . visibility = :private }
927925 end
928926 end
929927
@@ -1037,7 +1035,7 @@ def last_name_in_stack
10371035 name . split ( "::" ) . last
10381036 end
10391037
1040- #: (Prism::CallNode, Entry::Visibility ) -> void
1038+ #: (Prism::CallNode, Symbol ) -> void
10411039 def handle_visibility_change ( node , visibility )
10421040 owner = @owner_stack . last
10431041 return unless owner
0 commit comments