Skip to content

QueryCompletionListener.on_query_completions uses Query which is not imported #61

Description

@dpc00

QueryCompletionListener.py imports controller, Selection, Context, settings, verbose and state but not Query, while

def on_query_completions(self, view, prefix, locations):
    if settings.get("disable_autocompletion") and not Query.by_command():
        return False

uses it (ruff F821). With disable_autocompletion enabled, every completion request raises NameError: name 'Query' is not defined instead of returning False.

Fix: import Query as the other modules do.

Found while testing packages from the Package Control catalog (static analysis with ruff plus source review).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions