Sublime Forum

HTML_completions break custom.sublime-completions

#1

Hi,
I developed a plugin for Sublime 2, some custom HTML classes completions. Everything works fine.
I have only custom.sublime-completions file in Packages folder. Even added it in Package manager, and again everything works fine.
https://github.com/easingthemes/UIkit-Sublime
This is my first plugin, and I’m still learning python.
if you type some letter inside html class quotes you get a list of all classes from UIkit framework.

But,
It wont work in Sublime 3. I don’t have python file so that’s not an issue.

If I disable HTML completion, plugin works fine.

Solution:
If I replace html_completions.py in Program Files\Sublime Text 3\Packages\HTML.sublime-package with same file from Sublime 2,
everything works fine again, I got html completions and custom plugin completions.

So what to do? Is it Sublime 3 bug or?

I’m using latest Sublime 3, fresh install, on Windows 7, using it for HTML,CSS.
Thanks,
Dragan

ps. for moderators: If this need to be in Plugin Development, please move it there.

0 Likes

#2

On line 137

completion_list = ] if is_inside_tag and ch != '<': if ch in ' ', '\t', '\n']: # maybe trying to type an attribute completion_list = self.get_attribute_completions(view, locations[0], prefix) # only ever trigger completion inside a tag if the previous character is a < # this is needed to stop completion from happening when typing attributes # if next line is disabled, custom completion works, but also tag names are offered 137: # return (completion_list, sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)

So something is wrong here, this line prevent all completions inside attribute.
Do I need some python file in my plugin to override this?

0 Likes