ternjs/tern_for_sublime

Conflicts with GitSavvy dashboards

Opened this issue · 5 comments

When I'm changing GitSavvy dashboards via Tab key, TurnJS outputs to the console:

Traceback (most recent call last):
  File "C:\Tools\SublimeText\sublime_plugin.py", line 320, in on_selection_modified_async
    callback.on_selection_modified_async(v)
  File "C:\Users\i.oleksandrov\AppData\Roaming\Sublime Text 3\Packages\tern_for_sublime\tern.py", line 53, in on_selection_modified_async
    on_selection_modified(view)
  File "C:\Users\i.oleksandrov\AppData\Roaming\Sublime Text 3\Packages\tern_for_sublime\tern.py", line 32, in on_selection_modified
    pfile = get_pfile(view)
  File "C:\Users\i.oleksandrov\AppData\Roaming\Sublime Text 3\Packages\tern_for_sublime\tern.py", line 94, in get_pfile
    if not is_js_file(view): return None
  File "C:\Users\i.oleksandrov\AppData\Roaming\Sublime Text 3\Packages\tern_for_sublime\tern.py", line 16, in is_js_file
    return view.score_selector(sel_end(view.sel()[0]), "source.js") > 0
  File "C:\Tools\SublimeText\sublime.py", line 538, in __getitem__
    raise IndexError()
IndexError

You appear to have cut off the interesting part of the stack trace.

@marijnh Sorry, updated.

Could you see if attached patch helps?

Nope, it's pretty the same console output:

Traceback (most recent call last):
  File "C:\Tools\SublimeText\sublime_plugin.py", line 320, in on_selection_modified_async
    callback.on_selection_modified_async(v)
  File "C:\Users\i.oleksandrov\AppData\Roaming\Sublime Text 3\Packages\tern_for_sublime\tern.py", line 53, in on_selection_modified_async
    on_selection_modified(view)
  File "C:\Users\i.oleksandrov\AppData\Roaming\Sublime Text 3\Packages\tern_for_sublime\tern.py", line 32, in on_selection_modified
    pfile = get_pfile(view)
  File "C:\Users\i.oleksandrov\AppData\Roaming\Sublime Text 3\Packages\tern_for_sublime\tern.py", line 94, in get_pfile
    if not is_js_file(view): return None
  File "C:\Users\i.oleksandrov\AppData\Roaming\Sublime Text 3\Packages\tern_for_sublime\tern.py", line 16, in is_js_file
    return len(view.sel()) > 0 & view.score_selector(sel_end(view.sel()[0]), "source.js") > 0
  File "C:\Tools\SublimeText\sublime.py", line 538, in __getitem__
    raise IndexError()
IndexError

Ugh, okay, so indexing view.sel() is somehow returning an index error even though it's length is > 0. Not sure what's going on there, but something seems to be breaking a part of ST that Tern isn't responsible for.