
    ue!              
       0   d dl mZ d dl mZ d dlmZmZ ej                  ej                  ej                  ej                  ej                  ej                  ej                  ej                  ej                  ej                   f
Zed        Z G d d      Zy)    )api)messages)hookimpllspc                    | j                  d      5  t        |j                        }t        j                  |j
                  j                  d      |j                  |       |j                  cd d d        S # 1 sw Y   y xY w)Nzlint: pyflakeszutf-8)reporter)	report_progressPyflakesDiagnosticReportlinespyflakes_apichecksourceencodepathdiagnostics)	workspacedocumentr   s      =/usr/lib/python3/dist-packages/pylsp/plugins/pyflakes_lint.py
pylsp_lintr      sg    		"	"#3	4 $+HNN;OO""7+X]]X	
 ##$ $ $s   AA88Bc                   $    e Zd Zd Zd Zd Zd Zy)r
   c                      || _         g | _        y )N)r   r   )selfr   s     r   __init__z!PyflakesDiagnosticReport.__init__#   s    
    c                     ddddddd}| j                   j                  d||t        j                  j                  d       y )Nr   line	characterstartendpyflakesr   rangemessageseverity)r   appendr   DiagnosticSeverityError)r   	_filenamemsg	err_ranges       r   unexpectedErrorz(PyflakesDiagnosticReport.unexpectedError'   sL    a0A.
	 	$"2288		
r   c                     |xs d}|xs d}|xs d}|dz
  |d|dz
  |t        |      z   dd}| j                  j                  d||t        j                  j
                  d       y )N   r    r   r   r"   r#   )lenr   r'   r   r(   r)   )r   r*   r+   linenooffsettextr,   s          r   syntaxErrorz$PyflakesDiagnosticReport.syntaxError5   s|    11 zr %qjv>"QJVc$i5GH
	 	$"2288		
r   c                    |j                   dz
  |j                  d|j                   dz
  t        | j                  |j                   dz
           dd}t        j
                  j                  }t        D ]*  }t        ||      st        j
                  j                  } n | j                  j                  d||j                  |j                  z  |d       y)z+Get message like <filename>:<lineno>: <msg>r/   r   r   r"   r#   N)r2   colr1   r   r   r(   WarningPYFLAKES_ERROR_MESSAGES
isinstancer)   r   r'   r%   message_args)r   r%   r,   r&   message_types        r   flakezPyflakesDiagnosticReport.flakeJ   s     &nnq0w{{K* GNNQ,>!?@
	 ))113 	L'<01177	
 	$""??W-A-AA$		
r   N)__name__
__module____qualname__r   r-   r5   r=    r   r   r
   r
   "   s    

*
r   r
   N)r"   r   r   r   pylspr   r   UndefinedNameUndefinedExportUndefinedLocalDuplicateArgumentFutureFeatureNotDefinedReturnOutsideFunctionYieldOutsideFunctionContinueOutsideLoopBreakOutsideLoopTwoStarredExpressionsr9   r   r
   rA   r   r   <module>rM      s    )   $$""!!  ""  
$ 
$?
 ?
r   