
    8@d	                         d dl Z d dlZd dlmZmZ  e j        e          Z ej        d          Z	 ej        d          Z
 ej        d          Ze	e
egZed             Zd ZdS )    N)hookimpl_utilsz-\s*:param\s+(?P<param>\w+):\s*(?P<doc>[^\n]+)z-\s*@param\s+(?P<param>\w+):\s*(?P<doc>[^\n]+)z&\s*(?P<param>\w+).*:\s*(?P<doc>[^\n]+)c                    t          j        ||          } |                                j        di |}|sdg iS | j                            di                               di           }|                    di           }|                    ddg          }t          j        |          |d         }|                                                    d          pd	gd         	                                }	d

                    d |	D                       }
|
t          j        |                    d                    d}|j        rfd|j        D             |d<   |gdd}|j        |j        r
|j        |d<   |S )N
signaturestextDocumentsignatureHelpsignatureInformationdocumentationFormatmarkdownr   z

  c                 6    g | ]}|                                 S  )strip).0lines     7lib/python3.11/site-packages/pylsp/plugins/signature.py
<listcomp>z(pylsp_signature_help.<locals>.<listcomp>$   s     IIIdTZZ\\III    T)rawmarkup_kindlabeldocumentationc           	      r    g | ]3}|j         t          j        t          |j                              d4S )r   r   )namer   format_docstring_param_docs)r   p	docstringpreferred_markup_kinds     r   r   z(pylsp_signature_help.<locals>.<listcomp>/   s^         V#4Iqv..1  
 
   r   
parameters)r   activeSignatureactiveParameterr   )r   position_to_jedi_linecolumnjedi_scriptget_signaturescapabilitiesgetchoose_markup_kindr!   split
splitlinesjoinr   paramsindex)configdocumentpositioncode_positionr   signature_capabilitiessignature_information_supportsupported_markup_kindssfunction_sig_linesfunction_sigsigsig_infor!   r"   s                @@r   pylsp_signature_helpr=      s   6xJJM6%%''6GGGGJ "b!!#044^RHHLL_^`aa$:$>$>?UWY$Z$Z!:>>?TWaVbcc"56LMM1AI $//&119bT1=HHJJ88II6HIIIJJL0KKDK!!-
 
 
 C 	x      8  L  #e::Hwqx&'g"#Or   c                     |                                  D ]X}t          D ]N}|                    |          }|s|                    d          |k    r4|                    d          pdc c S Yd S )Nparamdocr   )r-   	DOC_REGEXmatchgroup)r!   
param_namer   regexms        r   r   r   A   s    $$&& ( ( 	( 	(ED!!A www:--775>>'R'''''	(( (r   )loggingrepylspr   r   	getLogger__name__logcompileSPHINXEPYDOCGOOGLErA   r=   r   r   r   r   <module>rQ      s     				 " " " " " " " "g!!	D	E	E	D	E	E	=	>	>VV$	 
, , 
,^( ( ( ( (r   