diagnostic_interface.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:iCompleteMe 作者: jerrymarino 项目源码 文件源码
def _UpdateSquiggles( buffer_number_to_line_to_diags ):
  vimsupport.ClearYcmSyntaxMatches()
  line_to_diags = buffer_number_to_line_to_diags[ vim.current.buffer.number ]

  for diags in itervalues( line_to_diags ):
    # Insert squiggles in reverse order so that errors overlap warnings.
    for diag in reversed( diags ):
      location_extent = diag[ 'location_extent' ]
      is_error = _DiagnosticIsError( diag )

      if location_extent[ 'start' ][ 'line_num' ] <= 0:
        location = diag[ 'location' ]
        vimsupport.AddDiagnosticSyntaxMatch(
          location[ 'line_num' ],
          location[ 'column_num' ],
          is_error = is_error )
      else:
        vimsupport.AddDiagnosticSyntaxMatch(
          location_extent[ 'start' ][ 'line_num' ],
          location_extent[ 'start' ][ 'column_num' ],
          location_extent[ 'end' ][ 'line_num' ],
          location_extent[ 'end' ][ 'column_num' ],
          is_error = is_error )

      for diag_range in diag[ 'ranges' ]:
        vimsupport.AddDiagnosticSyntaxMatch(
          diag_range[ 'start' ][ 'line_num' ],
          diag_range[ 'start' ][ 'column_num' ],
          diag_range[ 'end' ][ 'line_num' ],
          diag_range[ 'end' ][ 'column_num' ],
          is_error = is_error )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号