Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Test helper not working for <- if not preceeded by a syntax test assertion line #224

Closed
keith-hall opened this issue Feb 7, 2019 · 0 comments
Labels
Milestone

Comments

@keith-hall
Copy link
Member

A traceback occurs when typing - following a syntax test token and <, if there are no syntax test assertions on the line above:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 1082, in run_
    return self.run(edit, **args)
  File "C:\Users\keith\AppData\Roaming\Sublime Text 3\Packages\PackageDev\plugins_\syntaxtest_dev.py", line 355, in run
    col_start, col_end = lines[0].assertion_colrange
IndexError: list index out of range

i.e.

  1. open Packages/Python/tests/syntax_test_python.py
  2. place the caret at EOF
  3. type blah Enter so that there is a line without a syntax test assertion on it
  4. type # <-
  5. notice that it doesn't autocomplete the scope selector
  6. open the ST console
  7. see the traceback

the problem likely lies here, where it removes the first line from the list:

if assertion_colrange[0] == assertion_colrange[1]:
col = assertion_colrange[1]
test_at_start_of_comment = True
lines = lines[1:]

to prove it, you can then press End (so that the - isn't selected), press Enter and type #<- again, and this time it works.

@FichteFoll FichteFoll added this to the 3.2.8 milestone Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants