mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00

* fix: pip -r appends spaces at the end modularize completing output from subproc-out * docs: * fix: flake8 * fix: failing pip comp tests * refactor: naming xonsh conflicts with actual package the IDE completions don't work. we add this naming convention instead. * feat: option to filter after completion returned this will help reduce some boilerplate, and we can enrich the filtering behaviour * feat: add gh completions * fix: filtering out completions * refactor: simplify invoking completer interface * test: add fixture for xsh with os-env * test: add tests for gh-completions * fix: flake error * fix: mypy errors and update gh completer tests * fix: handle cross-platform line endings * feat: include man,bash completer only if available * todo: improve man page completions * fix: failing man page tests * fix: py 3.7 compatibility * fix: qa error * fix: stop dir completions * feat: improve man page completions now shows descriptions, recognizes more number of options correctly * fix: update man page completions * feat: support filtering based on display as well * Update xonsh/completer.py Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com> * style: * test: xfail ptk-shell tests on windows Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
21 lines
550 B
Python
21 lines
550 B
Python
import pytest
|
|
|
|
from tests.tools import skip_if_not_has
|
|
|
|
pytestmark = skip_if_not_has("gh")
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"line, exp",
|
|
[
|
|
["gh rep", {"repo"}],
|
|
["gh repo ", {"archive", "clone", "create", "delete", "edit", "fork"}],
|
|
],
|
|
)
|
|
def test_completions(line, exp, check_completer, xsh_with_env):
|
|
# use the actual PATH from os. Otherwise subproc will fail on windows. `unintialized python...`
|
|
comps = check_completer(line, prefix=None)
|
|
|
|
if callable(exp):
|
|
exp = exp()
|
|
assert comps.intersection(exp)
|