

def on_query_completions(self, view, prefix, locations):
    if self.IsValidScope(view):
        settings = SublimePapyrus.GetSettings()
        if (settings and settings.get('intelligent_code_completion', True)):
            if self.completionRunning:
                return
            elif self.linterRunning:
                return
            self.completionRunning = True
            completions = None
            if (not view.find('scriptname', 0, sublime.IGNORECASE)):
                path = view.file_name()
                if path:
                    (_, name) = os.path.split(self)
                    completions = [('scriptname\tscript header', ('ScriptName %s' % name[:name.rfind('.')]))]
                else:
                    completions = [('scriptname\tscript header', 'ScriptName ')]
            else:
                completions = self.Completions(view, prefix, locations)
            if completions:
                completions = list(set(completions))
            elif (completions == None):
                completions = []
            completions = (completions, (sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS))
            self.completionRunning = False
            return completions

dataset/ETHPy150Open Kapiainen/SublimePapyrus/Source/Modules/Skyrim/Plugin.py EventListener.on_query_completions/VarMisuse@124/158 `path`->`self`