镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

unit_testing_syntax_compatibility reports column as line+column (location[0] + location[1]) #297

Closed

Description

@dpc00

Summary

UnitTestingSyntaxCompatibilityCommand reports the wrong column in every error line. In unittesting/syntax.py:

"%s:%d:%d: %s" % (syntax, location[0] + 1, location[0] + location[1], message)

location is (line, column) (0-based, as returned by sublime_api.incompatible_syntax_patterns). The line is converted correctly (location[0] + 1), but the column is computed as location[0] + location[1], i.e. line plus column, so the reported column grows with the line number and points to the wrong place. It should be location[1] + 1. Because the output is matched by result_file_regex, jumping to the error from the output panel also lands in the wrong place.

Repro (UnitTesting 1.11.1, Sublime Text 4200)

Packages/ZZ/bad.sublime-syntax (patterns start at 0-based column 12-14 on lines 9, 11, 13):

Line 9  (0-based):     - match: '(?<!a)b(?>c+)d'
Line 11 (0-based):     - match: '\Gxyz'
Line 13 (0-based):     - match: '(a)\1(?<n>q)\k<n>'

sublime_api.incompatible_syntax_patterns(...) returns [((9, 12), (0, 0), 'Negative look behind is not supported'), ((11, 12), (0, 0), '\G is unsupported'), ((13, 12), (0, 3), 'Back references are unsupported')], but the command's output is:

Packages/ZZ/bad.sublime-syntax:10:21: Negative look behind is not supported
Packages/ZZ/bad.sublime-syntax:12:23: \G is unsupported
Packages/ZZ/bad.sublime-syntax:14:25: Back references are unsupported

Columns 21, 23, 25 are 9+12, 11+12, 13+12; the real column is 12 (13 in 1-based).

Suggested fix

Use location[1] + 1 for the column.

Activity

  1. added a commit that references this issue on Oct 1, 2026
    af0a1ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions