Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lint #9

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions xontrib/jedi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
__all__ = ()

import jedi
import jedi.settings as jsettings
from jedi.api.classes import Completion


@lazyobject
def XONSH_SPECIAL_TOKENS():
Expand Down Expand Up @@ -60,9 +61,7 @@ def complete_jedi(context: CompletionContext):
return None

filter_func = get_filter_function()
jsettings.case_insensitive_completion = not XSH.env.get(
"CASE_SENSITIVE_COMPLETIONS"
)
settings.case_insensitive_completion = not XSH.env.get("CASE_SENSITIVE_COMPLETIONS")

source = context.python.multiline_code
index = context.python.cursor_index
Expand All @@ -73,7 +72,7 @@ def complete_jedi(context: CompletionContext):

extra_ctx = {"__xonsh__": XSH}
try:
extra_ctx["_"] = _
extra_ctx["_"] = _ # type: ignore
except NameError:
pass

Expand All @@ -100,7 +99,7 @@ def complete_jedi(context: CompletionContext):
return res


def should_complete(comp: jedi.api.classes.Completion):
def should_complete(comp: Completion):
"""Make sure _* names are completed only when
the user writes the first underscore
"""
Expand All @@ -112,7 +111,7 @@ def should_complete(comp: jedi.api.classes.Completion):
return completion and len(completion) <= len(name) - 1


def create_completion(comp: jedi.api.classes.Completion):
def create_completion(comp: Completion):
"""Create a RichCompletion from a Jedi Completion object"""
comp_type = None
description = None
Expand Down
Loading