
    8@dk                         d dl Z d dlmZ d dlmZ d dlmZmZ  e j        e	          Z
ed             Zed             Zd ZdS )    N)libutils)Rename)hookimplurisc                      ddddiiiS )Npluginsrope_renameenabledF r       9lib/python3.11/site-packages/pylsp/plugins/rope_rename.pypylsp_settingsr      s     	5'9:;;r   c                    |                      |j                                      di           }|                    |          }t	          |t          j        ||j                  |                    |                    }t          	                    d|
                    |          |           |                    |dd          }t          	                    d|j                   g }	|j        D ]}}
t          j        |
j        j                  }|                    |          }|	                    ||r|j        nd dddd	t'          |
j                  dd	d
|
j        dgd           ~d|	iS )N)document_pathropezExecuting rename of %s to %sT)in_hierarchydocszFinished rename: %s)uriversionr   )line	character)startend)rangenewText)textDocumenteditsdocumentChanges)settingspathget_rope_project_builderr   r   path_to_resourceoffset_at_positionlogdebugword_at_positionget_changeschangesr   from_fs_pathresourceget_maybe_documentappendr   
_num_linesnew_contents)config	workspacedocumentpositionnew_namerope_configrope_projectrename	changesetr)   changer   docs                r   pylsp_renamer;      s   ///>>BB62NNK22;??L!,>>##H-- F II,h.G.G.Q.QS[\\\""8$T"JJIII#Y%6777G#   455**3//*-73;;4  +,!!<!<$.v$?$?)*      &2	 	
 
 	 	 	 	$ w''r   c                 h    t          |                                                                           S )z/Count the number of lines in a `File` resource.)lenread
splitlines)r+   s    r   r.   r.   ;   s$    x}}))++,,,r   )logging	rope.baser   rope.refactor.renamer   pylspr   r   	getLogger__name__r%   r   r;   r.   r   r   r   <module>rF      s           ' ' ' ' ' '                g!! 
< < 
<
 
#( #( 
#(L- - - - -r   