srusskih / SublimeJEDI

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

"sublime_completions_visibility": "all" collision #137

Closed Bystroushaak closed 10 years ago

Bystroushaak commented 10 years ago

Hello.

I am using "sublime_completions_visibility": "all" and it works in some cases wrong. I have following piece of code:

 def get_data(clsn, info_dict, path):
    def filter_private(tree):
        return filter(lambda x: x.name.startswith(), sequence)

x.name.startswith() is the problematic sequence - when I start typing x.name.star, the completion flashs and disappears. I am certain, that the bug is in SublimeJEDI - when I disable it, it works as expected. It looks like something in SublimeJEDI turns the completion off.

In this case, completion is not derived from context, but from repeated use elsewhere in file.

Example where I try to bring the completion back by hitting shortcut for completion few times:

output

I've toyed with SublimeJEDI source and it seems like there is some problem in completion.py, specifically in show_completions() function. When I comment out the view.run_command("hide_auto_complete") function, it works almost as it should. I think that there should be if depending at how user set his completion, but that is just plain guess.

I am using Sublime 3 build 3059 at Linux and Jedi v0.7.0. When I disable the Jedi package, everything works as expected.

srusskih commented 10 years ago

Made some investigation yesterday. Looks like ST3 for a some reason does not extend his default completion with jedi results, for this case. I have an idea how this can be fixed up.

srusskih commented 10 years ago

Made some investigation. And got two solutions.

  1. add default sublime completion to completions results
  2. this plugin can be used https://github.com/alienhard/SublimeAllAutocomplete

First option in process

Bystroushaak commented 10 years ago

I still have this problem with snippets and SublimeAllAutocomplete didn't help.

Bystroushaak commented 10 years ago

Commenting out part of the show_completions() from completion.py helps:

    def show_completions(self, view, completions):
        # XXX check position
        self.cplns_ready = True
        # if completions:
        #     self.completions = completions
        #     view.run_command("hide_auto_complete")
        #     sublime.set_timeout(functools.partial(self.show, view), 0)
srusskih commented 10 years ago

If we going to remove that part of code, it breaks all Jedi completions suggestions.

--- Исходное сообщение --- От кого: Bystroushaak notifications@github.com Дата: 06 нюля 2014, 00:16:30

Commenting out part of the show_completions() from completion.py helps: def show_completions ( self , view , completions ):

XXX check position

self . cplns_ready = True

if completions:

self.completions = completions

view.run_command("hide_auto_complete")

sublime.set_timeout(functools.partial(self.show, view), 0)

— Reply to this email directly or view it on GitHub .

Russkih Sergey

Jabber ID: sr@jabber.com.ua skype: kharum

srusskih commented 10 years ago

Will look on snippets suggestions, thanks.

--- Исходное сообщение --- От кого: Bystroushaak notifications@github.com Дата: 06 нюля 2014, 00:48:58

I still have this problem with snippets and SublimeAllAutocomplete didn't help. — Reply to this email directly or view it on GitHub .

Russkih Sergey

Jabber ID: sr@jabber.com.ua skype: kharum