srusskih / SublimeJEDI

awesome Python autocompletion with SublimeText
MIT License
938 stars 109 forks source link

Fix a small error ) #322

Closed Devil-Oper closed 3 years ago

Devil-Oper commented 3 years ago

Hi! Sorry, I don't speak English. But I'll try with a translator. Sublime console reports an error when focusing on some output-panels (like as linter output):

Traceback (most recent call last):
File "...Sublimetext\sublime_plugin.py", line 610, in on_selection_modified_async
    callback.on_selection_modified_async(v)
File "...Sublimetext\Data\Packages\Jedi - Python autocompletion\sublime_jedi\go_to.py", 
    line 271, in on_selection_modified_async
    if not is_python_scope(view, view.sel()[0].begin()) or not view.file_name() or not should_highlight:
File "...Sublimetext\sublime.py", line 649, in __getitem__
    raise IndexError()
IndexError

Fix it in the "go_to.py":

# before
# if not is_python_scope(view, view.sel()[0].begin()) or not view.file_name() or not should_highlight:
# after
if not view.file_name() or not is_python_scope(view, view.sel()[0].begin()) or not should_highlight:

Maybe it will be useful for somebody...

harshraj22 commented 3 years ago

Hello @Devil-Oper , @srusskih , I would like to work on this issue.

srusskih commented 3 years ago

Thank you @harshraj22! Great job!

loscil06 commented 2 years ago

Is it me or is it still happening? As right now I've upgraded the plugin and still get this error:

Traceback (most recent call last):
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 936, in on_selection_modified_async
    run_view_callbacks('on_selection_modified_async', view_id)
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 708, in run_view_callbacks
    callback(v, *args)
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 190, in exception_handler
    return event_handler(*args)
  File "/home/alan/.config/sublime-text/Packages/Jedi - Python autocompletion/sublime_jedi/go_to.py", line 271, in on_selection_modified_async
    if not is_python_scope(view, view.sel()[0].begin()) or not view.file_name() or not should_highlight:
  File "/opt/sublime_text/Lib/python33/sublime.py", line 1044, in __getitem__
    raise IndexError()
IndexError
harshraj22 commented 2 years ago

@loscil06 the latest release was on March 6th, 2020 while this pull request was merged Dec 17, 2020. So, I assume the updates haven't been pushed out yet.

Unless you build it from source, you won't get these changes locally.