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

Use the new Jedi API #1025

Merged
merged 22 commits into from
Dec 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4ca918e
Use the new API instead of the deprecated one
davidhalter Jul 30, 2020
3a27747
Use the project.search function
davidhalter Jul 30, 2020
1e9bdc8
definition -> name, because Jedi calls it name now
davidhalter Jul 30, 2020
5858a99
Unify Pyimport and goto
davidhalter Jul 30, 2020
c4fc2cd
Use projects instead of environments
davidhalter Jul 30, 2020
2949389
Describe the environment_path option properly
davidhalter Jul 30, 2020
104d817
environment_path needs to be defined properly
davidhalter Jul 30, 2020
e236874
Implement :JediChooseEnvironment
davidhalter Jul 31, 2020
6edda90
Make choose environment buffer disappear if it's not visible anymore
davidhalter Jul 31, 2020
2c157e3
Fix documentation tests
davidhalter Jul 31, 2020
01e6e6b
Fix debug info
davidhalter Jul 31, 2020
87abaf0
Fix goto issues
davidhalter Jul 31, 2020
862fbbc
Add a choose-venv test
davidhalter Aug 1, 2020
6efd966
Remove multi definition tests that are not really working anymore bec…
davidhalter Aug 1, 2020
74fd73d
Added an undocumented JediLoadProject for now
davidhalter Aug 1, 2020
48b3e5c
In older versions of VIM bufname needs an argument
davidhalter Aug 4, 2020
acbb712
Try and update the CI from Ubuntu 16.04 to 18.04
davidhalter Aug 4, 2020
6193c9f
Remove the Python 2 support
davidhalter Aug 4, 2020
a769652
Fix the project choice
davidhalter Oct 23, 2020
dc0fdc5
Updated jedi and parso
davidhalter Dec 25, 2020
04ba9a2
A small fix
davidhalter Dec 25, 2020
ea52ca5
Try to use GitHub Actions
davidhalter Dec 26, 2020
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
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: ci
on: push

jobs:
tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive

- name: Setup
run: |
sudo pip install pytest
vim --version

#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: Run tests
run: 'make test'

code-quality:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive

- name: Run tests
run: |
vim --version
make check

coverage:
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive

- name: Install dependencies
run: |
sudo add-apt-repository ppa:neovim-ppa/stable -y
sudo apt-get update -q
sudo apt-get install neovim -y

sudo pip install pynvim pytest-cov
sudo pip list
nvim --version

- name: Run tests
run: |
make --keep-going test_coverage BUILD_VIRTUAL_ENV=$VIRTUAL_ENV

- name: Upload coverage data
run: |
coverage xml
bash <(curl -s https://codecov.io/bash) -X fix -f coverage.xml -F py${TRAVIS_PYTHON_VERSION//./}
17 changes: 5 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
dist: xenial
dist: bionic
language: python
python: 3.7
python: 3.8
env:
matrix:
- ENV=test
- ENV=check
- ENV=test_coverage
matrix:
include:
- env: ENV=test_coverage
python: 2.7
- env: ENV=test_coverage
python: 3.8
- ENV=test
- ENV=check
- ENV=test_coverage
install:
- |
if [ "$ENV" = "test" ]; then
Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ get more information. If you set them to ``""``, they are not assigned.
let g:jedi#completions_command = "<C-Space>"
let g:jedi#rename_command = "<leader>r"
A few examples of setting up your project:

.. code-block:: vim
let g:jedi#environment_path = "<leader>d"
Finally, if you don't want completion, but all the other features, use:

Expand Down
10 changes: 10 additions & 0 deletions autoload/jedi.vim
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ let s:default_settings = {
\ 'popup_select_first': 1,
\ 'quickfix_window_height': 10,
\ 'force_py_version': "'auto'",
\ 'environment_path': "'auto'",
\ 'project_path': "'auto'",
\ 'smart_auto_mappings': 0,
\ 'use_tag_stack': 1
\ }
Expand Down Expand Up @@ -422,6 +424,14 @@ function! jedi#py_import(args) abort
PythonJedi jedi_vim.py_import()
endfun

function! jedi#choose_environment(args) abort
PythonJedi jedi_vim.choose_environment()
endfun

function! jedi#load_project(args) abort
PythonJedi jedi_vim.load_project()
endfun

function! jedi#py_import_completions(argl, cmdl, pos) abort
PythonJedi jedi_vim.py_import_completions()
endfun
Expand Down
12 changes: 12 additions & 0 deletions doc/jedi-vim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Contents *jedi-vim-contents*
6.12. force_py_version |g:jedi#force_py_version|
6.13. smart_auto_mappings |g:jedi#smart_auto_mappings|
6.14. use_tag_stack |g:jedi#use_tag_stack|
6.15. environment_path |g:jedi#environment_path|
7. Testing |jedi-vim-testing|
8. Contributing |jedi-vim-contributing|
9. License |jedi-vim-license|
Expand Down Expand Up @@ -506,6 +507,17 @@ definition with arbitrary changes to the |jumplist|.
Options: 0 or 1
Default: 1 (enabled by default)

------------------------------------------------------------------------------
6.15. `g:jedi#environment_path` *g:jedi#environment_path*

To use a specific virtualenv or a specific Python version it is possible to
set an interpreter.

Both setting the directory and setting a project is working.

Examples: "/usr/bin/python3.9", "venv", "../venv", "../venv/bin/python"
Default: "auto"

==============================================================================
7. Testing *jedi-vim-testing*

Expand Down
4 changes: 4 additions & 0 deletions plugin/jedi.vim
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ endif
" Pyimport command
command! -nargs=1 -complete=custom,jedi#py_import_completions Pyimport :call jedi#py_import(<q-args>)

command! -nargs=? -complete=file JediChooseEnvironment :call jedi#choose_environment(<q-args>)
command! -nargs=? -complete=file JediLoadProject :call jedi#load_project(<q-args>)


function! s:jedi_debug_info()
" Ensure the autoload file has been loaded (and ignore any errors, which
" will be displayed with the debug info).
Expand Down
2 changes: 1 addition & 1 deletion pythonx/jedi
Submodule jedi updated 176 files
Loading