srusskih / SublimeJEDI

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

workaround ST2 segfault on empty completion entry #140

Closed tehasdf closed 6 years ago

tehasdf commented 10 years ago

It seems Sublime Text 2 (build 2221) doesn't really like it when the completion list contains empty strings and segfaults. This originally happened to me when trying to complete arguments for timedelta. Steps to reproduce:

Here's a minimal plugin that crashes ST2 for me:

import sublime_plugin

class ExampleEventListener(sublime_plugin.EventListener):
    def on_query_completions(self, view, prefix, locations):
        return [(u'', u'foo')]

I tried it on two systems, both were 64-bit ubuntu.

krya commented 10 years ago

seems like a bug in jedi itself. shouldn't this fix land in daemon itself ?

tehasdf commented 10 years ago

That might be the case as well! I have no idea if an empty string is the correct output in this case. But in any case, I don't think segfaulting is the correct response to incorrect input. This should be fixed in ST, but all I can do to be able to use sublimejedi is to apply a workaround patch, and I just thought I'd share.

FichteFoll commented 10 years ago

I can not reproduce it on ST3 so it's likely been fixed already. ST2 does not seem to be maintained anymore.