765 Commits

Author SHA1 Message Date
Dave Halter
338af171ea Merge pull request #1112 from jgb/master
update jedi to v0.19.0
2023-07-31 22:39:54 +00:00
Jan Geboers
c0c01ede07 update jedi to v0.19.0 2023-07-31 10:12:14 +02:00
Dave Halter
42c2af1812 Merge pull request #1106 from jgb/master
update jedi to v0.18.2
2023-04-11 15:55:50 +00:00
Jan Geboers
1198e4cfa3 update jedi to v0.18.2 2023-04-11 10:27:08 +02:00
Dave Halter
c5d5d2e3b4 Merge pull request #1105 from hawkins/patch-1
Remove mention of Python 2.7 support in installation instructions
2023-04-10 21:25:51 +00:00
Josh Hawkins
0d245f3287 Remove mention of Python 2.7 support in installation instructions 2023-04-10 14:13:51 -04:00
Dave Halter
be483a2dcb Merge pull request #1097 from jamescherti/rename-that-do-not-delete-word
Add a keyboard mapping to rename  variables/functions/classes without deleting the word under the cursor
2022-12-28 19:46:41 +00:00
James Cherti
f286f9e4b6 Key mapping <Leader>R: Rename vars/functions/classes without deleting the word under the cursor
This pull request also adds the support for 'set selection=exclusive' to
the function 'rename_visual()' (bug fix).

'<Leader>R' in Normal mode:
---------------------------
Jedi-vim keeps the word under the cursor, moves the cursor to the end of the
word, and puts Vim in insert mode, where the user is expected to enter the
new variable name.

'<Leader>R' in Visual mode:
---------------------------
Use the selected text as the default answer to the prompt.
2022-12-26 13:43:42 -05:00
Dave Halter
e073385976 Merge pull request #1088 from Jakuje/patch-1
Update link to Fedora package
2022-12-24 23:40:23 +00:00
Dave Halter
6b8013c480 Merge pull request #1095 from Konfekt/popup
fix typo
2022-11-23 09:11:09 +00:00
Konfekt
c381156dd4 fix typo 2022-11-23 08:23:42 +01:00
Dave Halter
28a6765ecc Merge pull request #1093 from Konfekt/popup
prefer popup over preview window
2022-11-21 22:50:46 +00:00
Konfekt
df261c0a3e remove slash to pass check for code quality 2022-11-12 10:32:44 +01:00
Konfekt
40c7f6d09d split code line to pass check for line length 2022-11-11 10:29:45 +01:00
Konfekt
8c7161f4e9 prefer popup over preview window 2022-11-10 15:55:13 +01:00
Jakub Jelen
27db7160a5 Update link to Fedora packages 2022-05-30 20:27:13 +02:00
Dave Halter
e82d07faa1 Merge pull request #1082 from jamescherti/buffer_jedi_added_sys_path
Add the buffer-local option 'b:jedi_added_sys_path'
2022-04-08 15:07:48 +02:00
James Cherti
50dfac448a Add 'g:jedi#added_sys_path' and 'b:jedi_added_sys_path' to the cache (cache_key). 2022-04-05 15:59:09 -04:00
James Cherti
0a27795d76 Add the buffer-local option 'b:jedi_added_sys_path' (to add additional sys_path). 2022-04-05 13:04:19 -04:00
Dave Halter
32d05f7742 Merge pull request #1076 from jamescherti/case-insensitive
Add option to enable/disable case insensitive completion
2022-01-30 12:33:41 +01:00
James Cherti
873ee9325d Add an option to enable/disable case insensitive completion.
Options:
- Global option: g:jedi#case_insensitive_completion
- Buffer-local option: b:jedi_case_insensitive_completion

Values:
- 0 to disable case insensitive completion.
- 1 to enable case insensitive completion (default).
2022-01-29 17:54:33 -05:00
Dave Halter
08ad42efed Merge pull request #1074 from blueyed/bump-parso
Update parso submodule to 0.8.3 (from 0.8.2)
2022-01-17 19:26:34 +01:00
Dave Halter
f5aad68bec Merge pull request #1073 from blueyed/fixup-1059
get_project: simplify getting b:jedi_environment_path override
2022-01-17 19:22:23 +01:00
Daniel Hahler
2c99d7377f Update submodule pythonx/parso 5edab04...ee5edaf
* pythonx/parso 5edab04...ee5edaf (13):
      > Prepare Release 0.8.3
      > Add a Python 3.12 grammar, because that is probably going to be needed in a year from now
      > Merge pull request #199 from sobolevn/patch-1
      > Merge pull request #195 from sturmianseq/fix
      > Jedi still has an import dependency on search_ancestor
      > Merge pull request #194 from mgorny/python310
      > Merge pull request #188 from davidhalter/line-ending
      > Fix flaky test_cache_last_used_update again (#189)
      > Add `NodeOrLeaf.dump()` and `NodeOrLeaf.search_ancestor()` (#187)
      > Add a grammar for Python 3.11 (just copied 3.10), so the core devs can work with it
      > Relax a test regex to match new enum repr in Python 3.10.0a7+ (#186)
      > Merge pull request #185 from davidhalter/switch-to-github-actions
      > Merge pull request #184 from davidhalter/remove-nocond-39
2022-01-17 17:21:36 +01:00
Daniel Hahler
7d2fc14f4f get_project: simplify getting b:jedi_environment_path override
- the common case is having an exception here (with no buffer setting),
  which results in the exception handler always
- vim_eval has overhead, especially with Neovim, so the less calls the
  better

This patch changes it to query the `b:` dict, using the (always
set/initialized) global setting as the default.
2022-01-17 14:56:29 +01:00
Dave Halter
e1afc904e4 Merge pull request #1072 from ThomasBlauth/default_setting
Fix added_sys_path default setting
2022-01-17 09:23:57 +01:00
Thomas Blauth
64c92771be Fix added_sys_path default setting
This commit removes the inner string quotation of the default value for the
added_sys_path setting. The inner quotes cause the value of the resulting
variable g:jedi#added_sys_path to be the sting "[]" instead of an empty list.
2022-01-17 08:40:54 +01:00
Dave Halter
030211555d Merge pull request #1068 from jgb/master
Update jedi to v0.18.1 and parso to v0.8.2
2021-11-17 22:33:56 +01:00
Jan Geboers
ab2550ef29 Update jedi to v0.18.1 and parso to v0.8.2 2021-11-17 15:45:26 +01:00
Volodymyr Kozachynskyi
7ac81cb880 doc: Add hint about python 2 support (#1060)
* doc: Add hint about python 2 support

* Update README.rst

Co-authored-by: Dave Halter <davidhalter88@gmail.com>
2021-06-22 22:45:23 +02:00
Dave Halter
6812ce11b7 Merge pull request #1059 from jamescherti/buffer_jedi_environment_path
The buffer-local variable `b:jedi_environment_path`
2021-06-22 21:34:08 +02:00
James Cherti
81002ed6e7 This commit fixes the exception: jedi_vim.VimError: Vim(let):E121: Undefined variable: b:jedi_environment_path; created by 'b:jedi_environment_path' 2021-06-22 13:42:11 -04:00
James Cherti
81e1e9ca34 The buffer-local variable b:jedi_environment_path was added to override the global variable g:jedi#environment_path. 2021-06-21 14:58:57 -04:00
Dave Halter
8763462331 Merge pull request #1049 from SeungChan92/master
Add missing item in manual index
2021-03-17 23:32:13 +01:00
Seung-Chan Ahn
760120240f Add missing item in manual index 2021-03-17 09:59:43 +09:00
Dave Halter
6e6738758f Merge pull request #1048 from SeungChan92/master
Support adding extra sys_path
2021-03-16 23:38:49 +01:00
Seung-Chan Ahn
ff9a0afbda Support adding extra sys_path 2021-03-15 14:36:20 +09:00
Dave Halter
088469a8ee Merge pull request #1045 from Konstantin-Glukhov/master
Use helper function relpath() instead of os.path.relpath()
2021-02-26 11:18:52 +01:00
Konstantin-Glukhov
8730095b89 Use helper function relpath() instead of os.path.relpath() to address
issue #1044 ("path is on mount %r, start on mount %r" exception thrown
on Windows if Python and jedi-vim are installed on different drives)
2021-02-16 04:25:02 +09:00
Dave Halter
5d4615707f Fix a refactoring error, fixes #1041 2021-01-30 15:38:01 +01:00
Dave Halter
960eaa8053 Typo
Co-authored-by: Daniel Hahler <git@thequod.de>
2021-01-03 03:06:44 +01:00
Dave Halter
acd9182131 Fix some comments in signature test 2021-01-03 03:06:44 +01:00
Dave Halter
04c708cbfc Useful examples for environment_path 2021-01-03 03:06:44 +01:00
Dave Halter
91312f1755 Run CI on pull requests 2021-01-03 03:06:44 +01:00
Dave Halter
e02fa9dc10 Upgrade Jedi to 8ef2ce232cebf6f30b41b28b2677d84666a97d55 2021-01-03 03:06:44 +01:00
Dave Halter
d7be014c54 Namespaces cannot be shown properly, fixes #815
This only works with Jedi commit 2ec3d72151d1072fa22861aef07ba6fc170e3781
Once using that commit, namespaces will be used properly.
2021-01-02 12:15:25 +01:00
Dave Halter
e96eba9f53 Use relative paths when accessing a buffer 2021-01-02 04:05:46 +01:00
Dave Halter
e4daf7a74c Fix a test around signatures that was failing sometimes 2021-01-02 04:05:24 +01:00
Dave Halter
3a1c900a26 Remove Python 2 stuff 2020-12-27 00:44:17 +01:00
Dave Halter
57757bd334 Merge pull request #1025 from davidhalter/jedi-api
Use the new Jedi API
2020-12-26 23:47:32 +01:00
Dave Halter
ea52ca5305 Try to use GitHub Actions 2020-12-26 23:38:46 +01:00
Dave Halter
04ba9a2430 A small fix 2020-12-25 17:44:22 +01:00
Dave Halter
dc0fdc55cb Updated jedi and parso 2020-12-25 12:45:23 +01:00
Dave Halter
a76965238a Fix the project choice 2020-10-23 17:45:40 +02:00
Dave Halter
6193c9fd95 Remove the Python 2 support
It should mostly still work (except for :Pyimport), but it won't pass all the tests anymore.
Since I'm dropping Python 2 in Jedi anyways, it makes sense to also remove it here.
2020-08-04 15:22:38 +02:00
Dave Halter
acbb712906 Try and update the CI from Ubuntu 16.04 to 18.04 2020-08-04 15:11:30 +02:00
Dave Halter
48b3e5c0e7 In older versions of VIM bufname needs an argument 2020-08-04 15:07:39 +02:00
Dave Halter
74fd73d017 Added an undocumented JediLoadProject for now 2020-08-01 13:32:48 +02:00
Dave Halter
6efd966481 Remove multi definition tests that are not really working anymore because of changes in Jedi 2020-08-01 12:01:54 +02:00
Dave Halter
862fbbc8a9 Add a choose-venv test 2020-08-01 11:16:57 +02:00
Dave Halter
87abaf0781 Fix goto issues 2020-08-01 00:30:54 +02:00
Dave Halter
01e6e6bcf7 Fix debug info 2020-08-01 00:15:46 +02:00
Dave Halter
2c157e323e Fix documentation tests 2020-08-01 00:12:24 +02:00
Dave Halter
6edda9063a Make choose environment buffer disappear if it's not visible anymore 2020-07-31 20:25:12 +02:00
Dave Halter
e23687462b Implement :JediChooseEnvironment 2020-07-31 15:06:09 +02:00
Dave Halter
104d817f0c environment_path needs to be defined properly 2020-07-30 18:37:27 +02:00
Dave Halter
2949389be4 Describe the environment_path option properly 2020-07-30 18:16:35 +02:00
Dave Halter
c4fc2cde8c Use projects instead of environments 2020-07-30 15:45:12 +02:00
Dave Halter
5858a999de Unify Pyimport and goto 2020-07-30 14:36:40 +02:00
Dave Halter
1e9bdc863a definition -> name, because Jedi calls it name now 2020-07-30 14:18:33 +02:00
Dave Halter
3a27747773 Use the project.search function 2020-07-30 14:00:16 +02:00
Dave Halter
4ca918e830 Use the new API instead of the deprecated one 2020-07-30 13:47:53 +02:00
Daniel Hahler
a17b033303 Update Jedi to v0.17.2 (#1023)
* pythonx/jedi 3ad3dc08...3b7106ae (203):
      > Fix a typo
      > Prepare for 0.17.2
      > Fix a Python 3.9 issue on travis
      > Properly negate with Interpreter, fixes #1636
      > Fix issues with generators, fixes #1624
      > Introduce py__next__ to have more clear way to use __next__
      > Merge pull request #1633 from mrclary/mrclary-fix-wingkinl-patch-python-environ
      > Fix dict completions for inherited dicts, fixes #1631
      > Refactor Interpeter completions a bit
      > Make sure the interpreter completions work better in Jupyter Notebook, fixes #1628
      > Fix an issue with interpreter completion, see also #1628
      > Making sure to note that Python 2 will not be supported after 0.17.2
      > Mention in Changelog that 3.9 is now supported
      > Add download badge
      > Some test skips
      > Revert some of the Decoratee changes
      > Some more signature adjustments
      > Change Decoratee slightly
      > Fix an issue with decoratee names
      > Add Project.path, fixes #1622
      > Fix the of a signature with a decorator
      > Fix docstrings for method decorators, fixes #1621
      > Make partial use the __doc__ of its function, fixes #1621
      > Merge pull request #1614 from PeterJCLaw/fix-decorator-factory-passthrough
      > Merge pull request #1623 from mallamanis/master
      > Remove a print
      > Typeshed third party libraries should not be loaded if they don't actually exist in the environment, fixes #1620
      > Add the env_vars change to CHANGELOG
      > Merge pull request #1619 from mrclary/subprocess-env-vars
      > Make sure that Callables are properly represented
      > Add Python 3.8 to the tox env list (#1618)
      > Use Python 3 in the deployment script
      > Prepare release 0.17.1
      > Make sure the current version doesn't install a parso version that is new
      > Small changelog improvement
      > Mention Django Manager support for managers/querysets in changelog
      > Add SyntaxError.get_message
      > Mention 3.9 support better
      > Fix decorator param completion
      > Merge branch 'django'
      > Merge branch 'master' of github.com:davidhalter/jedi
      > Fix some issues with sub class matching, fixes #1560
      > Better debugging output for is_sub_class_of
      > Ignore runtime_checkable, because we don't really need it
      > Fix a small extract_variable issue, fixes #1611
      > Try to get get the tests for Python 3.9 passing, fixes #1608
      > Make it possible to use inheritance on generics without always specifying type vars, see also discussion in #1593
      > Update MANIFEST.in
      > Make sure that scopes can only be exact values, see #1590
      > Merge pull request #1590 from muffinmad/references-scope
      > Fix a small issue with doctest completions, fixes #1585
      > Exclude more Linux constants in test_import
      > Merge pull request #1601 from yuan-xy/patch_3
      > Refactoring about checking \r\n (#1603)
      > fix typo (#1602)
      > fix typo
      > Merge pull request #1599 from isidentical/py38-plus-setuppy
      > Merge pull request #1595 from PeterJCLaw/operator-not-in
      > Import FileNotFoundError from jedi._compatibility
      > Merge pull request #1586 from PeterJCLaw/django-more-fields
      > Fix potential AttributeError in get_defintion_start_position/get_defintion_end_position, see #1584
      > Fix an error of get_definition_end_pos, see #1584
      > Refactor test_definition_start_end_position to use parametrize
      > definition_end_position -> get_definition_end_position, same for start, see #1584
      > Merge pull request #1584 from pappasam/get_definition_position
      > Fix tests in Python 2
      > Fix a small issue
      > Magic methods fixes for reverse methods
      > lists and tuples should not be added
      > Use __truediv__ instead of __div__
      > Fix an issue with Tuple generics
      > A few class renames
      > Better debugging
      > Skip another non-important Python 2 test that fails on Windows
      > Fix a namespace issue when getting references
      > Fix an about dict completions
      > Fix a None issue
      > Implement magic method return values, fixes #1577
      > Remove an unused cache method
      > Undefined api types should not return a random value
      > Add support for generic optional parameters (#1559)
      > Fix inline case where a name was removed without the code being used, fixes #1582
      > Make the diff nicer if there is no ending newline, fixes #1581
      > Merge pull request #1579 from muffinmad/pseudotreenameclass
      > Merge pull request #1572 from davidhalter/classvar
      > Reduce noise in signatures of compiled params (#1564)
      > Fix #1573 again; a tree_node can be None
      > Fix argument clinic unpacking, remove dynamic bullshit
      > This fixes two issues with the caching on Windows:
      > Fix getattr completions on very weird cases, fixes #1573
      > Fix tests
      > Remove the common folder and move it to a common file
      > Remove common.value
      > Move infer_type_vars to base_value
      > Merge pull request #1554 from PeterJCLaw/fix-nested-tuple-argument
      > Add .venv to _IGNORE_FOLDERS
      > Correct a test
      > Speed up signature fetching for MixedName, see discussion in #1422
      > Test that the actual signature of a function is used in Interpreter
      > Very small refactoring
      > Tell sith that goto_assignments is now goto
      > Merge pull request #1561 from PeterJCLaw/newtype-pyclass
      > Merge pull request #1553 from PeterJCLaw/generic-tuple-return
      > Allow files for get_default_project, fixes #1552
      > Don't display unnecessary help, fixes #1557
      > Pin Django in a different way so tests can work everywhere
      > Make sure that Django's values/values_list is tested (though not implemented
      > Properly implement inheritance for Django models
      > Make sure Django User inference works
      > Pin the Django test dependency
      > Mention django stubs support in README
      > Include Django stubs license in Jedi package
      > Some more django query tests
      > Infer many to many fields
      > Include Django stubs as a third party repo
      > Make sure that infering the Django User model works
      > Fix a recursion error issue
      > Remove unused imports
      > Fix typos in api.classes docstrings
      > Remove a redundant check from Name.desc_with_module
      > Actually fix #1556, forgot to add this in 94d374c9ceeb16ea1c6fe49b8e039d415c7dbe5a
      > Start changelog for 0.17.1
      > Fix a small issue with the help method, fixes #1556
      > Django is not supported for Python 2
      > Work with a NameWrapper, so Django goto works better
      > Fix another django modelfield issue
      > Some nitpicks
      > Fix another issue with foreign keys
      > Fix ForeignKey issues with invalid values
      > Some other small refactorings
      > Refactor a few things for django
      > Remove old third party django tests
      > Use debug instead of print for Django and fix indentation, see #1467
      > Make Django test optional
      > Merge branch 'master' of https://github.com/ANtlord/jedi
      > Better developer tools
      > Make the linter completely private
      > Make sure that calling Jedi with a random argument in CLI results in errors
      > Fix a small _get_annotated_class_object, fixes #1550
      > Also don't complete keywords if kwargs only are allowed, see #1541
      > Completion: Don't suggest variables when only kwargs are legal, fixes #1541
      > fix #1548
      > * Use an explicit environment for subprocess to ensure that existing environment variables are not inherited. This ensures more reliable results, see issue #1540. * Attempt to send SYSTEMROOT variable to Windows subprocess
      > Sort test_project::test_search results to fix failures
      > Inc difference limit in TestSetupReadline::test_import for py3.8
      > Project._python_path -> Project.environment_path
      > Set the release date in Changelog
      > Some README improvements
      > Extract now properly validates line/column and those two params are required
      > Some minor CHANGELOG changes
      > Upgrade parso version
      > Fix a small issue
      > Some more code quality fixes
      > Some code cleanups
      > Don't reuse a variable
      > Remove unreachable code
      > _convert_names kwargs are not needed
      > Add pyproject.toml to the list of files to search for projects
      > Use the interpreter environment if the executable is not available, fixes #1531
      > Fix a potential AttributeError
      > Add a comment to clarify the Type case
      > Avoid AttributeErrors for generics when a module is passed
      > Merge branch 'improve-type-annotation-inference-refactors' of https://github.com/PeterJCLaw/jedi
      > Merge branch 'improve-type-annotation-inference' of https://github.com/PeterJCLaw/jedi
      > If branch inference should not trigger for things we don't know, fixes #1530
      > Fix string completion issue, fixes #1528
      > Fix wrong types for iterate, fixes #1524
      > Fix stub conversion for Decoratee, so docstrings work, see #117
      > Remove unused environment param
      > Fix a Python 2 test
      > Merge branch 'refactor'
      > Merge branch 'project'
      > Included statement as a possible return type for BaseDefinition.type
      > Fix partialmethod issues
      > Make sure partialmethod tests are only executed for Python 3
      > Merge branch 'add-partialmethod' of https://github.com/ffe4/jedi
      > Merge branch 'expandtab' of https://github.com/Carreau/jedi
      > Changed semantics of ClassVar attributes in classes, fixes #1502
      > Avoid duplicate definitions for goto, fixes #1514
      > Merge _remove_statements and infer_expr_stmt, fixes #1504
      > Fix namedtuple docstring/signature issues, fixes #1506
      > Fix a getattr_static issue, fixes #1517
      > Disable some more tests for Python 2
      > Make InterpreterEnvironment public
      > is_typeddict should be part of ClassMixin
      > Don't continue searching for values if an annotation is found
      > TypedDict checking should be at a later point
      > Simplify tests a bit
      > Merge branch 'typeddict' of https://github.com/pappasam/jedi
      > Update sith's module docstring to match the available operations
      > Remove the word 'class' from annotation_string
      > Add a couple of docstrings
      > Tell sith that 'completions' became 'complete'
      > Add venv to .gitignore
      > Remove additional prefix which seems incorrect
      > Update use of _source which no longer exists to _code
      > Make sure to move up VSCode, because it's used a lot
      > Revert "Make sure to mention that VSCode is using Jedi"
      > Make sure to mention that VSCode is using Jedi
      > Fix a test issue
      > Actually use follow_builtin_imports and improve the goto docstring, fixes #1492
      > Catch an error with illegal class instances, fixes #1491
      > Make Ellipsis without list in Callable work, fixes #1475
2020-07-17 23:14:17 +02:00
Dave Halter
a0207fadf9 Instead of zip completions (for tests) use something else, see discussions in #1020 2020-06-30 09:24:28 +02:00
Maxim Belkin
e83112f9aa doc/jedi-vim.txt: fix apostrophe (#1002) 2020-03-07 21:38:13 +01:00
Daniel Hahler
b2e8c65e35 Improve/harden jedi#setup_python_imports
In particular it should not try to import `jedi_vim_debug` during error
handling "unprotected", which might hide the real error on Python 2 at
least.

Ref: https://github.com/davidhalter/jedi-vim/issues/998#issuecomment-592305240
2020-03-05 21:06:06 +01:00
Daniel Hahler
686f39ac00 Fix jedi#add_goto_window: use :copen to go to the qf window always
Without this it would not go there with an already open qf window, and
would go to an unexpected buffer line instead of selecting the entry.

This is a follow-up to b689409, where it was decided that it should
always require the user to select an entry.

An exception is when the same usages are used again: then it will select
the nearest/current entry only (via ":cc").
2020-02-27 20:41:45 +01:00
Daniel Hahler
055199f2aa show_goto_multi_results: handle full_name=None
Seen with `<Definition name='key', description='param key'>` (using
usages on an function argument) [1].

1: https://github.com/pytest-dev/py/blob/2b6bd2925/py/_vendored_packages/iniconfig.py#L32-L33
2020-02-27 20:40:11 +01:00
Daniel Hahler
8d24b83754 Merge pull request #993 from blueyed/cover-jedi_debug_info
tests: cover jedi_debug_info
2020-02-03 01:43:09 +01:00
Daniel Hahler
a3696bee36 ci: upload coverage always 2020-02-03 01:37:10 +01:00
Daniel Hahler
5d4658f989 tests: cover jedi_debug_info 2020-02-03 01:37:10 +01:00
Daniel Hahler
18b1a519b0 Update parso/jedi (v0.6.0, v0.16.0+) (#991) 2020-02-03 01:36:04 +01:00
Daniel Hahler
acb98fc706 show_call_signatures: doc, default to 2 without 'conceal' (#994)
It basically allows to give a warning when '1' is used / set explicitly, and
the 'conceal' feature is not available.

Also defaulting to '2' (cmdline mode) then seems better than not using
it.

This is just some minor clean up before
https://github.com/davidhalter/jedi-vim/pull/652.
2020-02-03 01:31:10 +01:00
Daniel Hahler
e99cfd32de Update submodule pythonx/jedi afbd8cad...3ad3dc08
* pythonx/jedi afbd8cad...3ad3dc08 (197):
      > Run get_type_hint tests only for 3.6+
      > Stubs should not become stubs again in the conversion function, fixes #1475
      > Make sure to print errors in __main__ completions
      > Make sure param hints are working for functions
      > Generate type hints, fixes #987
      > Bump version to 0.16.1
      > Make sure to be able to deal with all kinds of loaders, fixes #1487
      > Make generators return more correct values with while loops, fixes #683
      > Avoid aborting search for yields when they are still reachable, see #683
      > Jedi understand now when you use del, fixes #313
      > Remove dead code
      > Remove Python 3.3 from environment tests
      > Make sure to skip some tests for Python 3.5
      > Small Changelog updates
      > Fix a small signature issue
      > Create a private helper to test completions
      > Fix an issue with names
      > compiled_object -> compiled_value
      > Remove dead code
      > CompiledObject -> CompiledValue
      > CompiledValue -> ExactValue
      > Revisit caching of mixed
      > Make MixedName a Namewrapper instead of inheritance
      > Remove underscore_memoization caching method
      > Refactor MixedName quite a bit
      > Fix issue with mixed objects, fixes #1480
      > Remove some dead code
      > Prepare a test for #1479
      > Avoid a print in tests
      > Fix value/context mixup in mixed, fixes #1479
      > Clarify that for Python 2 we will not fix bugs anymore
      > Skip a test in Python 2
      > Use is_compiled instead of isinstance checks
      > Create CompiledModule to have a better differentiation between compiled modules and compiles values
      > Make sure that the builtin docstring works again for infer calls
      > Fix a bug with version_info, fixes #1477
      > Make sure that del_stmt as a name can be handled, see #313
      > Remove use_filesystem_cache and additional_dynamic_modules, it hasn't been implemented for a long time
      > Removed settings.no_completion_duplicates
      > Make sure to stop gathering buildout paths at a certain point, fixes #1325
      > Rewrite some whitespace
      > Reformat the changelog a bit
      > Add follow_imports to Definition.goto, fixes #1474
      > Raise a proper exception instead of assert in case only_stubs and prefer_stubs are given
      > Make sure a certain test passes as well with tox
      > Fix a Python 2 issue
      > Rename Script.names to Script.get_names, fixes #1476
      > find_signatures -> get_signatures, see #1476
      > find_references -> get_references, see #1476
      > Fix remaining tests
      > Reduce limits of files to parse by quite a bit
      > Make sure that CompiledObject doesn't have a file_io
      > Use different limits for references and dynamic calls
      > Explain why the references limits were chosen
      > Start limiting opened files and parsed files for references
      > Remove a few imports
      > Make sure to not scan the same directory multiple times
      > Don't search for usages when we are working with params
      > Ignore .gitignore in get_references and therefore make get_references usable again
      > Revisit reference finding, scan a lot of folders
      > Added FolderIO.walk and FolderIO.get_base_name
      > Move get_module_contexts_containing_name to the references module
      > Apparently this one variable is needed
      > Small changelog fix
      > Forgot to use sudo for installing dependencies in travis
      > Another few travis fixes
      > Don't run some usage tests on Python 2
      > Interpreter test fix for travis config
      > Add a few more stub usage tests
      > Disable flow analysis for finding usages
      > Add another stub usage test
      > Fix stub conversion
      > Make sure to find both stubs and non-stubs with usages
      > Use the proper fixture
      > Implement interpreter test on travis
      > Get interpreter environment tests working
      > Make sure tests are proper packages, so that pytest doesn't do shenannigans with sys path
      > Remove NestedImportModule, because it hasn't been used in years
      > Refactor execute_operation a bit
      > Finally get rid of call_of_leaf
      > Refactor the isinstance checks a bit
      > Makes sure examples are excluded from pytest
      > speed test to examples
      > Move not_in_sys_path tests to examples
      > Move namespace tests to examples
      > Moved zipped imports test files
      > Move sample_venvs to examples
      > Move the extension test to examples
      > Move another test to examples
      > Remove unused test code
      > Move implicit namespace package code to example dir
      > Move flask tests to examples folder
      > Move the absolute import test files
      > Avoid a bug that a compiler might have found, fixes #1469
      > Make sure the latest changes work with Python 3.6/3.7
      > Properly convert compiled values to generic classes
      > Make Union/Optional works with compiled objects
      > Make sure that CompiledValue can deal with string annotations
      > Avoid a few warnings
      > Skip a test that doesn't work in Python 2
      > Remove a statement that didn't make sense
      > Remove a method that was not necessary
      > Fix a bug where parent_context was a value
      > Fix some issues with converting names, see #1466
      > Use one single way to convert stubs to Python, see #1466
      > Make sure to use _stub_to_python_value_set for all conversions, see #1466
      > Make sure fixture resolving works in conftest.py, see #791
      > Fix signatures when used for Generic classes, fixes #1468
      > Make sure inheritance works for fixtures, fixes #791
      > Add a test to check if numpy tensorflow stuff is now cached, see #1116
      > Make sure to check the module cache before loading a module (again)
      > Add a completion cache for numpy/tensorflow, fixes #1116
      > Ignore processing param names, fixes #520
      > Avoid using params in tests and use get_signatures().params
      > Make sure params have no name
      > Make sure that kwargs are not repeated when they are inferred
      > Undo finding signatures for everything and only do it for stubs and non-statements for when used in docstrings
      > Fix an issue with the is_big_annoying_library function, see #520
      > Make sure decorators are also not inferred for big annoying libraries, see #520
      > Make sure the repr of compiled access isn't huge
      > Disable some features for big annoying libraries like pandas, tensorflow, see #520
      > Fix a debug message
      > Fix a small issue
      > Little refactoring
      > Remove the old definition tests
      > Remove get_signatures again from names
      > Infer doctests and signatures uniformly, fixes #1466
      > Fix a small pytest fixture bug
      > Raise a deprecation warning on Definition.params
      > Remove a weird assert
      > Make sure coverage works again
      > Use Python 3.7 for calculating test coverage
      > Remoeve dead code
      > Remove unnecessary code
      > Separate getting docstrings and getting signatures for names, see discussion #1466
      > LazyInstanceClassName -> Use NameWrapper
      > Make sure that equals will only be added to keyword arguments and not just randomly
      > Make some test code prettier
      > Remove some skips around attribute docstrings
      > Add some more dict completion tests with whitespace
      > Change ModuleValue param order and add defaults
      > Make sure to pass tests again on Python 3.4
      > Make sure that include_signature always works, fixes #1466
      > Add a test for #1465
      > Skip dict key completion tests for Python 3.5, because it's just annoying with all the f-string stuff
      > Revert "Use the root implementation for get_root_context"
      > Added debug.warning to coveragerc, it's not relevant
      > Remove unused code
      > Use the root implementation for get_root_context
      > Add github sponsor FUNDING.yml file
      > Merge branch 'qa' of https://github.com/blueyed/jedi
      > Get rid of most flake8 errors
      > Get rid of a lot of flake8 errors
      > Make sure to get completions for backticks in docstrings work, see #860
      > Some more clarifications around docstrings, see #860
      > Get doctest completions working, fixes #860
      > Fix tests, skip more Python 2
      > Make sure test prefixed functions are checked for pytest fixtures, see #791
      > Make sure pytester is also used for fixtures, see #791
      > Clarify a sentence around virtualenv security, see #1250
      > Add the CHANGELOG entries for dict completions.
      > Merge branch 'dict', fixes #951
      > Make sure to mention that Jedi understands Pytest fixtures
      > Fix namedtuple issues that were uncovered by the 'self' changes
      > Self manipulations are now more correct, fixes #1392
      > Skip pytest tests when environments is not the same one
      > Make sure pytest stdlib fixtures are completable
      > Make sure the monkeypatch fixture completion works
      > Merge branch 'pytest', fixes parts of #791
      > Make sure py__name__ and name are defined on all values
      > Fix tests
      > Keyword completion after ... should not work, fixes davidhalter/jedi-vim#506
      > Fix python 2 environment finalizing, fixes #1412
      > Remove a function that did nothing anymore
      > Make sure modules for dynamic searches are not checked twice
      > Make sure classmethod param completion works better for the first param
      > Make sure staticmethod params are (mostly) inferred correctly, fixes #735
      > Python 2 test fixes
      > Add the fix for #997 to the changelog
      > Goto on a function/attribute in a class now goes to the definition in its super class, fixes #1175
      > Fix a few tests
      > Add support for completion even when __getattr__ is present, fixes #997
      > Fix an error recovery goto issue, fixes davidhalter/jedi-vim#962
      > Add a test to make sure some renamings work always
      > Refactor references: Matching more names that might be related
      > Catch an additional case for get_context where the cursor is e.g. on the function name
      > Add Script().get_context, fixes #253
      > Fix some issues with Definition.parent()
      > Test parents a bit better
      > Refactor tests a bit
      > Attribute docstrings work now, fixes #138
      > Avoid some duplication of code
      > Remove the _Help class completely
      > Move the docstring checking code to the names
      > Add the Script.help function, fixes #392
      > Add big API changes to Changelog
      > Merge branch 'api', fixes #1166
2020-02-03 01:27:40 +01:00
Daniel Hahler
41ecaa5c15 Update submodule pythonx/parso fb010f2...c864ca6
* pythonx/parso fb010f2...c864ca6 (14):
      > Bump version to 0.6.0
      > Make sure iter_funcdefs includes async functions with decorators, fixes #98
      > Add a bit to the changelog
      > del_stmt is now considered a name definition
      > Forgot to increase the pickle version
      > Revision on fstring issues (#100)
      > Revision on assignment errors (#97)
      > Add a Changelog note about dropping 2.6/3.3
      > Fix a Python 2.7 issue
      > Get rid of Python 3.3 artifacts
      > Remove Python 2.6 grammar
      > Merge branch 'rm-2.6' of https://github.com/hugovk/parso
      > Make sure to limit the amount of cached files parso stores, fixes davidhalter/jedi#1340
      > Fix simple typo: utitilies -> utilities
2020-02-03 01:27:31 +01:00
Dave Halter
5dd5631027 Merge pull request #990 from blueyed/fix-goto
Fix "goto" with multiple results
2020-02-02 18:53:08 +01:00
Daniel Hahler
b689409a2a Do not use :cc, but only select the line in the qf window
Ref: https://github.com/davidhalter/jedi-vim/pull/990#issuecomment-580163737
2020-02-02 07:20:43 +01:00
Daniel Hahler
ea4de13344 Minor CI/test improvements (#992)
* ci: Travis: pip-list, nvim-version

* tests: remove unused fixture argument
2020-02-02 07:10:11 +01:00
Daniel Hahler
1f7bc2a0fb Fix "goto" with multiple results
E.g. with `os.path`.
2020-01-29 19:20:12 +01:00
Aleksandrs Stier
c9bdefca54 doc: goto_stubs mapping <leader>s (#989)
Co-Authored-By: Daniel Hahler <github@thequod.de>
2020-01-24 20:11:02 +01:00
Daniel Hahler
e8790b1d8f minor: rewrite/expand show_documentation (#980)
* minor: rewrite/expand show_documentation

* tests: improve 'documentation docstrings'
2020-01-17 13:48:22 +01:00
Daniel Hahler
e2abec21c5 VimError: include throwpoint
This is helpful information to have in case of errors.
2020-01-14 21:09:35 +01:00
Daniel Hahler
c0ded0baf2 ci: add codecov.yml to disable comments (#981) 2020-01-10 19:59:28 +01:00
Daniel Hahler
7dfc56992a ci: Travis: test with py38 also 2020-01-10 17:51:51 +01:00
Dave Halter
2572136fcb Add a funding button to github (#976) 2020-01-01 14:14:45 +01:00
Daniel Hahler
55120b28e4 Merge pull request #974 from blueyed/update
Update parso and Jedi
2019-12-20 17:27:20 +01:00
Dave Halter
d57edde2e8 Update tests 2019-12-20 17:20:02 +01:00
Daniel Hahler
fab26f4551 Update submodule pythonx/jedi 005f6939...afbd8cad
* pythonx/jedi 005f6939...afbd8cad (208):
      > Don't test Python 3.4 in tox anymore by default
      > Add the release date to Changelog
      > Jedi needs at least parso 0.5.2 now
      > Fix a rb byte literal test
      > Goto definition doesn't work on strings anymore, fixes microsoft/vscode#81520
      > Make sure that sequence literals have the right generic classes, fixes #1416
      > Improved Generic subclass matching
      > Make sure overload checks work for TypeAlias, see #1416
      > Avoid recursion in a specific example, see also #1458
      > Fix simple typo: wheter -> whether (#1460)
      > Completions.complete returns None for fuzzy completions #1409
      > Cleanup fuzzy tests a bit, see #1409
      > Add fuzzy completions to Changelog
      > Merge branch 'feature_827_fuzzy_search' of https://github.com/jmfrank63/jedi
      > Python 2 compatibility
      > Make sure that the definition order in stubs are ignored
      > Make sure that a goto on stubs even without the implementation is possible
      > Fix a goto case with nested pyi files
      > Catch some cases were _sqlite3.Connection was misidentified as sqlite3.Connection
      > Rename goto_changes to options
      > Fix: Stubs in typeshed weren't loaded properly sometimes, fixes #1434
      > Files bigger than one MB (about 20kLOC) get cropped to avoid getting stuck completely
      > Upgrade typeshed, fixes #1084
      > Add a typeshed README
      > Make sure param annotation completions work
      > Make sure that you can select virtualenvs more precisely, fixes #1407
      > Python 2 compatibility
      > Make sure goto definitions works on with, fixes #1280
      > Make sure that __getattr__ is always working with Interpreter
      > qualified names can be None, so we need to handle it
      > Cleanup some callbacks
      > Make sure that Python 2 passes a test on more systems
      > Make sure warnings are not shown if a property is executed, fixes #1383
      > Fix RecursionError: global statements in modules should just be ignored, fixes #1457
      > Make it possible to infer Callable TypeVars, fixes #1449
      > Account for sys path potentially not being all unicode in typeshed, fixes #1456
      > Make sure docstrings can always be inferred for builtins modules, fixes #1432
      > Forgot to add some test files
      > Get the context of a class name right, fixes #1396
      > Make sure classmethod signatures don't include cls, fixes #1455
      > Add a test to show that type var inference also works for tuples
      > Don't use globals anymore
      > Remove a duplicate method
      > More docstrings
      > A bit better documentation
      > Refactor so typing uses BaseTypingValueWithGenerics
      > Make some more classes private for inference.gradual.base
      > Use _create_instance_with_generics
      > The generics manager is now part of DefineGenericBase
      > Remove get_index_and_execute and use something else
      > _InstanceWrapper to _GenericInstanceWrapper
      > Another rename for readability
      > Merge GenericClass and  _AbstractAnnotatedClass
      > Use the generics manager for all the typing classes
      > Start using generic managers, for #1413
      > Start working on generic managers, see #1413
      > Move iter_over_arguments to a separate file
      > value_of_index -> context_of_index
      > Try to prepare DefineGenericBase for a more general usage
      > Make AbstractAnnotatedClass private
      > Move parts of AbstractAnnotatedClass to the new class DefineGenericBase
      > Formatting
      > Rename two classes to make some things clearer
      > Make some lines shorter
      > Remove an unused InstanceArguments
      > Move more stuff from gradual/typing.py to gradual/base.py
      > Remove TypingName, it looks like it's not used
      > Start splitting up gradual/typing.py
      > Make sure Callable TypeVars are better identified, solves a part of #1413
      > Remove a TODO that was implemented
      > Pin colorama to a version that works for Python 3.4
      > Find active conda environment and set it as default (if there is one) (#1440)
      > Remove Python 3.4 test from appveyor
      > Make sure overload signatures work, see #1417
      > Shorten a line to < 100 chars
      > Fix a tuple test
      > Make sure that Tuple autocompletes properly, fixes #1389
      > Avoid more Python 2
      > Fix issues with interpreter completions on unittest.mock.
      > Start writing the changelog
      > Improve call signature detection by a lot
      > Make sure we use the right context in case of goto with decorators, fixes #1427
      > Python 2 still sucks.
      > Make sure an assert no longer causes unnecessary trouble
      > Make sure that decorator signature completion is working, see #1433
      > Avoid wrong random call signature completion, fixes #1433
      > Make sure py__iter__ has the right signature
      > Remove probably dead code
      > Python 2
      > Make sure execute_function_slots and get_function_slots is defined for all instances
      > Upgrade typeshed to the latest commits
      > Make sure that the differences are calculated a bit more reliable, fixes #1429
      > Unfortunately commited something that should not have been committed
      > Fix Python 2 issues
      > A CompiledInstance is not really compiled, it's an instance of a compiled class value
      > Remove is_package on contexts
      > Fix some more package issues
      > Get rid of py__package__ from contexts
      > Make is_package a function and call it consistently
      > Make sure code_lines works on stubs, even if they are builtins
      > Fix the MixedContext and also use MixedModuleContext
      > Separate CompiledModuleContext from CompiledContext, fixes #1428
      > Fix contextualizing of subscriptlist
      > Fix a globals context issue, fixes #1435
      > Remove Python 2 implicit relative imports feature
      > A small rename of a value that is actually a context
      > Merge pull request #1451 from pappasam/FIX_SHOW_SYSTEM_FOLDERS
      > Add __ne__ to BaseValueSet. Might have caused issues in Python 2, see #1442
      > Avoid finding submodules for compiled objects, because it's at least not implemented
      > Make sure that goto on a subscript colon doesn't crash
      > Fix getitem in compiled
      > Make sure py__get__ is defined on all values
      > Fix file name completions when file name is too long
      > Fix an issue around completions in comments before strings
      > Fix missing inference for typing.Type[typing.TypeVar] (#1448)
      > Remove Python 3.9 dev build from travis, it's not needed
      > Start to use Python 3.8 in the normal CI pipeline
      > Fix the pow test for Python 3.8
      > Fix inference from type comment for function parameter with dot
      > Fix annotation string generated from wrong object
      > Fix a small issue created in #1398
      > fix static analysis test skips with latest pytest
      > Fixed rST in changelog
      > test: test_completion: Dynamically resolve current directory name.
      > Skip Python 2 tests for some array issues
      > Skip some param resolving tests in Python 2/3.4
      > Add a few tests for a previous assertion failure
      > Make sure a compiled instance is is_compiled
      > Reenable a test
      > Disable a test in Python2
      > Remove a few unused imports
      > Move eval_node to one place
      > Avoid creating the same object twice
      > Move inference_state.goto to the name and _follow_error_node_imports_if_possible away from inference_state
      > Make some dynamic array variables private
      > ContextualizedName -> TreeNameDefinition
      > Use create_name instead of duplicated logic
      > Replace obj with value
      > Remove get_object, it's not needed anymore
      > Implement properties properly
      > Make arguments private for instance
      > Refactor dynamic params a bit
      > Revert "Refactor some dynamic function arguments things"
      > Refactor some dynamic function arguments things
      > Move some annotation inferring code to proper functions
      > Remove an unneeded list cast
      > SimpleParamName -> AnonymousParamName
      > Make create_instance_context a lot more understandable (and shorter)
      > Make sure a self variable is only defined in a function not outside
      > get_first_non_keyword_argument_values is not really used anymore
      > A simplification
      > Fix recursion issues about dynamic param lookups and defaults work again
      > Refactor search_param_names interface
      > Use get_executed_param_names if get_executed_param_names_and_issues is not necessary
      > Don't use get_executed_param_names_and_issues as an attribute on arguments
      > Remvoe AnonymousArguments
      > Refactor AnonymousInstance/TreeInstance, so that the anonymous instance doesn't have to use arguments
      > Separate tree/compiled instances better
      > Get rid of create_init_executions
      > Implement super() properly
      > Start using AnonymousMethodExecutionContext instead of the normal function execution context with arguments
      > Prepare instance for AnonymousMethodExecutionContext
      > Use the function execution filters with proper inheritance
      > Deal with inheritance properly when dealing with function executions
      > Separate FunctionExecution and AnonymousFunctionExecution
      > Fix static analysis for params
      > Add get_param_names to the function execution, which is needed to do some filtering
      > Move the normal anonymous arguments case over to names
      > Prefer annotations in SimpleParamName
      > Add some dynamic inference checks for annotations
      > Avoid using arguments.get_executed_param_names_and_issues
      > Remove get_executed_param_names_and_issues from FunctionExecution
      > Use function/arguments intead of execution
      > Make FunctionExecutionContext.arguments private
      > _ArrayInstance -> _DynamicArrayAdditions
      > var_args -> arguments
      > Fix the final issues about parameter arguments
      > Fix infering of dynamic params
      > Remove an unnecessary piece of code from goto
      > Use Context.create_name instead of weird playing with params everywhere
      > Use SimpleParamName everywhere it's needed
      > Refactor params and what execution contexts need
      > Fix a TODO
      > Make the order of overloaded functions correct
      > Get py__simple_getitem__ working on dicts that have a dict as a param, see #1385
      > Move some code from SequenceLiteralValue to DictLiteralValue
      > Fix usages in context of the new parso parameter include_setitem=True
      > execution_allowed should be called with nodes
      > Move a repr function
      > Fix cases where dicts are passed to dicts and generics were not properly applied
      > Small rename
      > Change a test so it works with generics
      > Get py__simple_getitem__ modifications working for list/dict instances
      > Random objects should not be affected by list/dict modifications
      > Add a way how dict setitem can be understood
      > Move the dynamic module to dynamic_params
      > Move the dynamic arrays code
      > Add a comment about how _ArrayInstance is used
      > check_array_additions -> _check_array_additions
      > Remove methods that are not used
      > Create separate classes for FakeSequence
      > Remove _FakeArray, because it's no longer needed
      > Enable a sys path test that is working now
      > Reenable some tests
      > Add a method implementation, that doesn't seem to be used, but it might one day be.
      > Merge branch 'refactoring'
      > Merge branch 'master' of github.com:davidhalter/jedi
      > Bump version
2019-12-20 12:37:26 +01:00
Daniel Hahler
4dcc6437e3 Update submodule pythonx/parso c0ace63...fb010f2
* pythonx/parso c0ace63...fb010f2 (22):
      > Add a release date to the Changelog
      > Prepare the next release v0.5.2
      > Merge pull request #93 from yangyangxcf/fstring_tokenize
      > Add information about named expressions (#90) to the Changelog
      > Use a lower pytest version so python3.4 is able to pass
      > Use Python 3.8 on travis for testing
      > Whitespace changes
      > Fix: Add more cases for named expression errors, see #89, #90
      > Add Python 3.8 to tested environments for tox
      > Fix: Catch some additional cases named expr errors, see #89, #90
      > Make sure that function executions are errors as well, see #90
      > Some minor refactorings for #90
      > Merge https://github.com/JarryShaw/parso into master
      > Fix trailing comma error
      > Remove debug print statement
      > Fix typo (#84)
      > Fix is_definition test
      > Add include_setitem for get_defined_names, is_definition and get_definition
      > Make is_definition work on setitem modifications, see #66
      > ENH: update grammar for py39 (#78)
      > Refactor the ambiguity tests a bit, see #70
      > Make pgen2's grammar ambiguity detection handle more cases
2019-12-20 12:37:23 +01:00
Daniel Hahler
c80a08d983 Fix invalidating cache with jedi#show_call_signatures (#968) 2019-12-08 17:26:24 +01:00
Daniel Hahler
ac6b2f1e3e ci: Travis: slighty improve codecov-bash invocation (#967) 2019-12-05 23:09:19 +01:00
Dave Halter
12e97c7a04 Make sure call signatures are cleared before they are calculated again 2019-12-05 01:02:58 +01:00
Daniel Hahler
08f13af066 completions: skip docstr without preview, handle exceptions (#958)
Closes https://github.com/davidhalter/jedi-vim/issues/948.
2019-10-20 23:56:22 +02:00
Daniel Hahler
5880f2de93 Revisit usage highlighting (#851) 2019-10-16 22:54:29 +02:00
Daniel Hahler
b4b2f3ef54 debug info: catch any errors with PythonJedi commands
Ref: https://github.com/davidhalter/jedi-vim/issues/953
2019-09-28 12:34:54 +02:00
Daniel Hahler
50abb5e95a jedi#debug_info: escape script path for "git" (#950)
Ref: https://github.com/davidhalter/jedi-vim/issues/949
2019-09-24 08:43:48 +02:00
Daniel Hahler
89c995e7d9 display_debug_info: add global sys.executable (#947)
This helps with bug reports in general.
2019-09-19 00:46:16 +02:00
Daniel Hahler
4f2499e4f2 ci/tests: update dependencies 2019-08-19 01:06:32 +02:00
Daniel Hahler
7665d73eae Update submodule pythonx/jedi to v0.15.1: 35e5cf2c...005f6939 (#940)
* pythonx/jedi 35e5cf2c...005f6939 (5):
      > Write the CHANGELOG for 0.15.1
      > Remove forgotten debug/print in filename completion. (#1380)
      > staticmethod and a few other cases might not have properly returned its signatures
      > Remove reference to a file that doesn't exist anymore
      > Bump version to make it clear that it's a different one than the current one
2019-08-18 21:35:09 +02:00
Daniel Hahler
b3d715c5fc Update submodule pythonx/jedi 60415033...35e5cf2c
* pythonx/jedi 60415033...35e5cf2c (106):
      > A small Changelog improvement
      > Cleanup Changelog for the next release
      > Make it possible to access functions that were inherited, see #1347
      > Messed up a Windows test
      > Again a small windows issue fixed.
      > Need to escape the path backslash for windows slashes
      > Make it possible to access properties again
      > A small compatibility fix
      > Fix an issue with type vars that might have been a problem for other things as well
      > Don't add quotes after paths if they are already there
      > A small speed optimization that helps a lot with sys.version_info >= (3, 0) patterns in typeshed
      > Remove an unnecessary isinstance usage
      > Make CompiledValue lazy
      > A python 2 fix
      > Fix an error that occured because of some refactorings
      > Fix one more os.path.join issue
      > Fix more issues with os.path path completion
      > Make join detection much easier
      > Fix some remaining issues with file path completions
      > A few more tests for path completions (join)
      > Fix quote completions for os.path.join path completions
      > Fix first param argument of os.path.join file completions
      > Fix arglist/trailer issues
      > in os.path.join completions, directories should not end in a slash
      > Make some file path completions in os.path.join work
      > Fix os.path.join static value gathering
      > os.path.sep should always have a clear value
      > Fix string name completion for stuff like dirname and abspath
      > Fix bytes issue with file path adding
      > Python 2 compatibility
      > Make __file__ return the correct value
      > Fix string additions when used in certain ways
      > Make string additions work for file path completion
      > Fix interpeter project path
      > Fix the REPL completer for file path completions
      > Fix a few more file name completion cases
      > A first iteration for file path completions
      > Fix a test failure
      > Add Definition.execute, fixes #1076
      > Add tests to show that #516 is not working, yet
      > List possible Definition.type in its docstring, fixes #1069.
      > Start writing the Changelog for 0.15.0
      > 3.8-dev should not be allowed to fail
      > Skip more Python 2 tests
      > Skipping of tests was done the wrong way again
      > Skip the right tests
      > Parameter.kind is not avaialble in Python 3.5
      > Fix Python 2 test issues
      > Add a few docstrings to make some things clearer
      > Add ParamDefinition.kind, fixes #1361
      > Make it possible to format a param to a string, fixes #1074
      > Add another test for signature annotations
      > Add Signature.to_string() with proper tests, fixes #779, fixes #780
      > Test infer_default
      > Use a helper to create definitions
      > Add a execute_annotation option to infer_annotation
      > Test infer_annotation
      > Make it possible for users to infer annotations/defaults
      > A first iteration of adding signatures to the API, fixes #1139
      > Fix a caching issue
      > Forgot the right resolve_stars parameters in one place
      > Cache getting resolved param names
      > Turn around resolve_stars, it shouldn't by default be resolved
      > Remove a class that is not needed anymore
      > Revert "Use __str__ instead of to_string"
      > Fix the last remaining issues with function signature
      > overloaded_functions should be private
      > Use __str__ instead of to_string
      > Better repr for CallSignature
      > Fix some minor signature issues
      > Remove the unused function signature_matches
      > Fix signatures for __init__ calls when used with supers, fixes #1163
      > Fix some issues for args resolving in method calls
      > Remove a bit of code that i sprobably unused
      > Move get_signatures from Function to FunctionMixin
      > Merge the signature changes
      > Remove an import
      > Small refactoring
      > Skipped Python 2 Interpreter tests the wrong way
      > Remove a paragraph in docs that was arguing that stubs and generics (and other things) were not properly supported, fixes #1012
      > Fix partial signatures for MixedObject
      > Fix partial signatures, fixes #1371
      > Make sure with a test that the staticmethod signature is also correct
      > Fix classmethod signature, fixes #498
      > Deal with annotation on *args and **kwargs correctly, fixes #980
      > Use LazyContextWrapper more
      > Very small refactoring
      > Fix for failing assertion on native modules Issue #1354 (#1370)
      > Skip numpydoc tests for Python 2
      > Remove code that didn't mean anything
      > Fix docstrings for wrapped functions, fixes #906
      > Fix an isue about dict ordering in Python before 3.6.
      > Make it clearer when get_param is used.
      > A small dataclass refactoring
      > Evaluate annotations for dataclasses when infer is called on param
      > Get inheritance of dataclass right
      > A first working iteration of dataclass signatures, fixes #1213
      > Remove an unused function
      > Dataclass progress
      > Add enum changes to changelog
      > Fix a recursion error about getting metaclasses
      > One test about recursion issues only applied to Python 2
      > Use class filters in instances differently so metaclass plugins work, fixes #1090
      > First step in working with metaclasses in plugins, see #1090.
      > Refactor the plugin registry
      > Remove classes from plugins and use decorators instead
2019-08-12 00:16:06 +02:00
Daniel Hahler
b9f8317595 Update submodule pythonx/jedi 454447d4...60415033
* pythonx/jedi 454447d4...60415033 (54):
      > Prepare the v0.14.1 release
      > Use fixture names everywhere
      > Cleanup a test file
      > Use parametrize instead of TestCase
      > Remove a TestCase class usage
      > Use pytest.mark.parametrize for something instad of a class
      > Use the names fixture even more
      > Use the names fixture more
      > A small rename
      > Refactor names tests
      > A small refactoring
      > Make sure __wrapped__ works properly when using an Interpreter, fixes #1353
      > Small refactoring
      > Make API param names appear without leading double underscores, fixes #1357 again
      > Fix some call signature tests
      > Make expected index work in Python 3
      > Test both closing brackets and non-closing brackets for CallSignature.index
      > Fix a case with errors
      > Move some code around
      > Fix some kwargs cases
      > Fix some *args issues
      > Deal better with some error nodes
      > Delete unused code
      > Fix some error node handling for call signatures
      > Fix CallSignature index for a looot of cases, fixes #1364,#1363
      > Use recursion rather than other stuff
      > Even more refactorings
      > small name refactoring
      > Refactor some call details
      > Disable a test for Python 2
      > Fix pow() signature, fixes #1357
      > Merge branch 'master' of github.com:davidhalter/jedi
      > Fix signature to_string
      > Fix an issue with keyword params, fixes #1356
      > Simplify some test code for param defaults, see #1356
      > Merge branch 'function_signature_in_interpreter' of https://github.com/linupi/jedi
      > Improve a bit of dataclasses support, so at least the attributes can be seen
      > Make sure in tests that pep 0526 variables are also able to be used when using self, see #933
      > Get typing.NewType working (#1344)
      > Cannot use pytest 5 yet
      > Fix filters for classes and functions
      > Fix some small things to get more tests passing
      > A better repr for Definition
      > Merge branch 'master' of github.com:davidhalter/jedi
      > Fix ClassVar filter for instances
      > Keyword completions are no longer possible directly after a number, fixes #1085
      > Fix super call goto for multiple inheritance, fixes #1311
      > goto should always goto definitions, fixes #1304
      > Fix star imports checks, fixes #1235
      > Actually import IsADirectoryError
      > Add 3.8 to supported versions
      > Fix project search if a directory is called manage.py, fixes #1314
      > Return annotations for compiled objects now help to infer
      > Update parso requirement
2019-07-13 20:21:56 +02:00
Daniel Hahler
d3f40d13ec Update submodule pythonx/parso 59df3fa...c0ace63
* pythonx/parso 59df3fa...c0ace63 (9):
      > For Python 2.7 and 3.4 pytest 5 doesn't work anymore
      > Prepare the 0.5.1 release
      > Fix name tokenizing for Python 2
      > Fix positioning for names that are interleaved with error tokens
      > Merge branch 'master' of github.com:davidhalter/parso
      > Fixed name tokenizing issues for tamil characters, fixes davidhalter/jedi#1368
      > Document that the cache uses pickle files
      > Fix changelog dates, fixes #77
      > Try to use collections.abc.Mapping instead of collections.Mapping
2019-07-13 20:21:56 +02:00
Dave Halter
016fb7c78e Merge pull request #915 from davidhalter/typeshed
With typeshed coming to Jedi, builtin modules should be displayed
2019-06-23 01:13:14 +02:00
Dave Halter
e736eea934 Use staticmethod for call signature tests instead of str
str has different signatures for Python 2 and 3 and is therefore annoying to test.
2019-06-21 00:28:18 +02:00
Dave Halter
6c6b4dcf92 Make sure that formatting happens on unicode 2019-06-20 23:56:46 +02:00
Dave Halter
73289427ba Modules should be accessible if column is not None 2019-06-20 23:46:34 +02:00
Dave Halter
1a053d2a23 Fix some call signature tests 2019-06-20 23:37:43 +02:00
Dave Halter
636ad08d32 Get rid of documentation about pip install jedi
pip install jedi doesn't work with properly with virtualenvs, if jedi-vim is
used.
2019-06-20 23:15:16 +02:00
Dave Halter
d32962f3b2 Upgrade Jedi to 0.14.0 and parso to 0.5.0 2019-06-20 22:38:57 +02:00
Dave Halter
717446dd71 For whatever reason tabs were used as indentation 2019-06-17 20:52:31 +02:00
Dave Halter
9c9a513aaf Add a goto_stubs command 2019-06-16 09:39:50 +02:00
Daniel Hahler
69aa410afa Fix :JediClearCache!
Parso's cache can be cleaned from Jedi now.
2019-04-28 21:19:39 +02:00
Daniel Hahler
914754a04e Disable smart_auto_mappings by default
Ref: https://github.com/davidhalter/jedi-vim/issues/568
2019-04-06 01:02:23 +02:00
Dave Halter
f26b2a8802 Change supported Python version in docs 2019-03-22 12:40:28 +01:00
Daniel Hahler
d879d2f216 jedi#show_documentation: check len of g:jedi#documentation_command 2019-03-22 12:35:43 +01:00
Dave Halter
23c14f6826 With typeshed coming to Jedi, builtin modules should be displayed
(If there's a module_path (which most will have)).

This change is still backwards compatible and can be used with older Jedi
versions (<0.14.0).
2019-03-09 13:35:56 +01:00
Dave Halter
1f7e661d9d Upgrade parso 2019-02-24 18:59:53 +01:00
Dave Halter
c6fe4fee76 Upgrade Jedi to latest 2019-02-24 18:59:29 +01:00
Dave Halter
ea5e87a703 Remove jedi.NotFoundError, because that was removed quite a while ago, see #899 2019-02-17 18:04:15 +01:00
Henré Botha
d02a72e792 Update Python version in README (#911)
As per the author's comment here, Python 2.6 is no longer supported. https://github.com/davidhalter/jedi-vim/issues/866#issuecomment-409852888
2019-02-12 14:30:02 +01:00
Daniel Hahler
42d24387ac Update parso to 0.3.3 (#909)
Update submodule pythonx/parso a2b153e...f1ee761

    * pythonx/parso a2b153e...f1ee761 (6):
      > Release of 0.3.3
      > Rename a test
      > Remove some unused code
      > Fix working with async functions in the diff parser, fixes #56
      > Fix bytes/fstring mixing when using iter_errors, fixes #57.
      > Improve a docstring, fixes #55.
2019-02-06 13:09:45 +01:00
Stevan Milic
ba5915bf26 Fix rename with folds: replace line in buffer directly (#906)
Fixes #789
2019-02-05 20:28:46 +01:00
Daniel Hahler
c5c13d69d6 ci: Travis: Ubuntu Xenial, and pynvim (#908) 2019-02-05 20:03:33 +01:00
Daniel Hahler
f36749776d Update parso to v0.3.2
Update submodule pythonx/parso 930ec08...a2b153e

    * pythonx/parso 930ec08...a2b153e (91):
      > Upgrade the Changelog
      > Escape a backslash properly
      > Bump the parso version to 0.3.2
      > f-string parts are also PythonLeaf instances
      > Fix get_start_pos_of_prefix
      > Remove dead code
      > Refactor f-string support
      > Fix: End detection for strings was mostly wrong, fixes #51
      > Fix f-string escapes, fixes #48
      > Tokenizer: Simplify end of string regexes
      > Add a comment from the Python3.7 code base
      > Fix diff parser: The previous fix was a bit off
      > Change fuzzer: Add ways to not always use correct parse input
      > Fix diff parser: issue with opening brackets
      > Async doesn't work in 3.4
      > Skip some tests for Python2.6 and Python3.3
      > Fix diff parser: DEDENT as error leaves should also be ignored and reparsed
      > Fix diff parser: error dedents in between nodes should be ignored for now when copying
      > Fix diff parser: Don't copy error nodes/leaves in the beginning, leads to strange issues in some cases
      > Diff fuzzer: Create a check to see if the errors make sense.
      > Fix diff parser: Don't copy DEDENT tokens at the beginning
      > Fix diff parser: Skip last leaves for last line offset leaves
      > Fix indentation error tokens
      > Fix diff parser: Avoid side effects for prefix
      > Fix tokenizer: backslashes sometimes led to newline token generation
      > Make lines easier copyable in the fuzzer
      > Fix tokenizer: Carriage returns after backslashes were not properly handled
      > Fix in diff parser: prefix calculation was wrong when copying nodes
      > Replace --print-diff with --print-code
      > Fix diff parser generation for empty files
      > Docopt should not be needed for tests
      > Fix tokenizer: Form feeds and multiline docstrings didn't work together
      > Fix diff parser: Need to calculate the prefix for the diff tokenizer better
      > Remove copied nodes stuff, to simplify some things
      > Fix newline endings and a few parser/copy counts
      > Feature: The diff parser fuzzer is now able to use random Python fragments
      > Fix: The Python 3.8 grammar did not include f-string support
      > Fix tokenizer: Closing parentheses in the wrong place should not lead to strange behavior
      > Fix end positions with error dedents
      > Fix diff parser tests for Python 2
      > Randomize the fuzzer a bit more with inserting characters
      > Simplify the regexes
      > Fix a regex clause that was totally wrong
      > Fix another tokenizer issue
      > Apply \r changes in syntax trees
      > Actually make \r usable
      > Fix split lines for Python code
      > Add \r as a valid linebreak for splitlines
      > Move split_lines tests around
      > Start generating really random strings with the fuzzer
      > Fix tokenizer: Dedents before error tokens are properly done, now.
      > Fix diff parser: Also check async with
      > Make the diff parser use a lot of different files by default
      > Fix diff parser: Forgot that with statments are also flows
      > Fix valid graph asserting for some dedents that are errors
      > Fix diff parser: If funcs are not copied, errors shouldn't either
      > Better documentation for the fuzz diff parser script
      > Rename a test
      > More verbose output for the diff fuzzer
      > Fix diff parser: error dedent issues
      > Fix diff parser: Avoid indentation issues
      > Use the right diff order in debug output
      > Fix diff parser: The prefix was wrong in some copy cases
      > Make fuzz parser compatible with Python 2
      > Make it possible to print all diffs in fuzzer
      > Introduce a redo flag 'only_last' to narrow down issues
      > Add docopt to testing dependencies
      > Rewrite the fuzz diff parser to cache errors (so we can re-run those)
      > Fix diff parser: Decorators were sometimes parsed without their functions
      > Fix tokenizer: Dedents should only happen after newlines
      > Usability for diff parser fuzzing
      > Fix for diff parser: Rewrite prefix logic and don't mutate prematurely
      > Fix diff parser: positioning of functions if decorators were removed
      > Ignore ERROR_DEDENT in graph validation
      > Add a small diff parser fuzzer
      > Fix diff parser: get_last_line was sometimes wrong
      > Fix error reporting order for diff issues
      > Clean up the test diff parser file
      > Avoid nasty side effects in creation of Node
      > Make parso errors even more informative
      > Fix diff parser get_last_line calculation
      > Fix graph asserting for error indents
      > Better checks for checking valid graphs
      > Create better ways for debugging the diff parser
      > Fix diff-parser: Copying parts of if else should not lead to the whole thing being copied
      > Reenable diff parser parser counting in all tests
      > Fix: Make the NodesStack to a NodesTree
      > Fix for diff parser : Make sure that start_pos are growing always The problem was that functions/classes were sometimes not well positioned. Now all diff tests are ensuring that leaves always grow.
      > Add a check to see if leaves have the right start positions
      > Add parso version to an exception
      > MNT: add grammar for python 3.8
2019-01-25 01:21:33 +01:00
Brian Mego
7f4f2db260 Fixes incorrect documentation 2018-12-03 23:51:19 +01:00
Daniel Hahler
2f65c636f8 ftplugin: do not duplicate jedi_usages autocommands (#883)
Fixes https://github.com/davidhalter/jedi-vim/issues/882.
2018-11-08 08:43:28 +01:00
Daniel Hahler
b6dfc5fd49 Update submodule pythonx/parso e6bc924...930ec08
* pythonx/parso e6bc924...930ec08 (7):
      > Use SVG badges
      > tox.ini: simplify deps
      > tox: add pypy to envlist for tox-travis
      > setup.py: add "testing" extras_require
      > Add Python 3.7 stable to test matrix and update classifiers
      > Update usage.rst
      > Don't use invalid escape sequences in regex, see https://github.com/davidhalter/jedi-vim/issues/843
2018-10-14 17:55:56 +02:00
Daniel Hahler
2a43448f3b Update submodule pythonx/jedi a79a1fb...bd1010b
* pythonx/jedi a79a1fb...bd1010b (91):
      > Create a new 0.13.1 release
      > Fixed completions of global vars and tensorflow slowness, fixes #1228, #1116
      > The changelog date was wrong
      > Release notes for 0.13.0
      > Fix tensorflow issues with a few hacks (temporary), fixes #1195
      > If the VIRTUAL_ENV variable changes, need to reload the default environment, fixes #1201, #1200
      > Return SameEnvironment as a default, fixes #1226, #1196
      > Document that using the REPL autocompletion is only available on Linux/Mac, fixes #1184
      > Fix an issue with f-strings, fixes #1224
      > Ignore some errors that are happening when the Python process ends and its subprocesses are cleaned up
      > also remove crashes with pep 448 unpacking of lists and sets
      > Fixed crash (and now recognises correctly) {**d, "b": "b"}["b"]
      > Recognize {**d} as a dict instead of set
      > Add extras_require=testing
      > _get_virtual_env_from_var: use safe=False
      > tests: venv_path: use session scope
      > jedi/api/environment.py: minor flake8 fix
      > jedi.api.environment._SUPPORTED_PYTHONS: add 3.7
      > Removing a test from doctests, becaues it shouldn't be one
      > Refactor argument clinic usage
      > With the recent changes one performance optimization got lost
      > FunctionExecutionContext should use the parent if possible
      > Use anonymous instance arguments in a different way
      > Move some anonymous instance function execution stuff
      > Get rid of InstanceFunctionExecution, because it's really not needed
      > Use the InstanceArguments for super as well
      > Use InstanceArguments directly and not via InstanceFunctionExecution
      > Remove old garbage code
      > Don't use arguments that are not needed
      > Also move the remaining get_params to get_executed_params
      > get_params -> get_executed_params where possible
      > Subprocess error reporting improvements
      > Fix a recursion issue about compiled objects
      > Use a CompiledInstanceNameFilter that wraps the class name as well
      > Prefer Python 3 import over 2
      > Now it's actually possible to specify a pytest environment for the same Python version
      > Note that Python 3.3 support was dropped in Changelog
      > Drop support for EOL Python 3.3 (#1019)
      > Rewrite the pyc test
      > Fix an issue with stderr debugging of subprocesses
      > stderr of the child processes should be printed in debug output
      > Use close_fds for posix.
      > Remove some redundant code
      > Use names of classes to infer names of instances
      > Don't have execute and execute_evaluated on name
      > Fix an issue where __ prefixed variables where not hidden when accessed from a class
      > Bound methods are now working correctly in all Python versions. Therefore a test was wrong.
      > Remove a print in tests
      > BoundMethods now have access to the function that they are using
      > Remove another usage of is_class where it's not needed
      > FunctionContext should be created from a unified interface
      > Don't create a FunctionExecutionContext if it's not used.
      > Use TreeContext in a good way
      > Fix broken link in documentation
      > The implicit namespace package test from 4b276bae87a3170672f7ddb3e00f5851fe24d562 can only be used for Python 3.4+
      > The import resolution for namespace packages was wrong
      > Add a way to use the interpreter environment for tests
      > MergedExecutedParams -> DynamicExecutedParams
      > Fix a recursion error, fixes #1173
      > Remove two recursion tests again that will belong into a commit at a point where it is not failing anymore
      > Don't merge params if it's just one param
      > Add a repr for AnonymousArguments
      > Fix a doctest
      > Some minor flake8 fixes
      > Script.__repr__: include environment
      > Add params to CallSignature.__repr__
      > Environments are now always created on request
      > Improve Environment
      > Add max line length 100 to the config for flake8
      > tests: use monkeypatch.setenv
      > Don't test Python 3.3 on appveyor anymore, it's getting really hard to get all the right dependencies for it, because 3.3 is deprecated everywhere.
      > Mention that it's ok to have a line length of 100 characters in our files.
      > Don't use invalid escape sequences in regex, see https://github.com/davidhalter/jedi-vim/issues/843
      > subprocess: listen: exit normally with EOFError
      > Script: improve ValueError for column
      > The sys path might be lazy or not in a venv
      > The encoding parameter should be used again (includes test), fixes #1167
      > Remove source_encoding from documentation (see #1167)
      > Actually use the fast_parser setting again
      > Use an import name list as long as possible
      > Different _load_module API
      > Directly load modules if possible, with this it's not necessary anymore to use dotted_from_fs_path, also fixes #1013.
      > Don't mutate the sys.path. This is pretty nasty bug that fixes #1148
      > Don't follow builtin imports anymore by default when follow_imports is on (goto)
      > Add a changelog entry for the include_builtins change
      > additional_module_paths in usages never actually worked
      > Add include_builtins to usages, fixes #1131.
      > Finally make it possible to use auto_import_modules for packages
      > Test auto_import_modules in a very basic way
      > Fix a bug about fstring completion
      > Comprehensions are also possible arguments. Fixes 1146
2018-10-14 17:55:56 +02:00
Daniel Hahler
c6f05cd82c .coveragerc: concurrency = greenlet (#874)
Fixes https://github.com/neovim/python-client/issues/354
2018-08-16 16:37:00 +02:00
Daniel Hahler
132d8506ab tests: move/rename/cleanup vspec based tests (#860)
The main motivation is to being able to use normal/other pytest based
tests.

Therefore this moves everything from conftest into test_integration
itself.
2018-08-01 23:57:37 +02:00
Daniel Hahler
399c57ff72 Fix displaying of error information with shortmess+=F
When being initialized via ftplugin `set shortmess+=F` (default in
Neovim by now) causes the additional information (the full traceback) to
be silenced.

This patch uses `:unsilent` to always display it.

Ref: https://github.com/neovim/neovim/issues/8675
2018-08-01 22:50:23 +02:00
Daniel Hahler
1126ffde9b Makefile: make pip-install quiet 2018-08-01 22:50:23 +02:00
Daniel Hahler
88502891ba Report coverage (#863) 2018-07-30 22:45:06 +02:00
Dave Halter
b33392c8c8 Merge pull request #864 from blueyed/nvim (neovim testing)
Testing is now alow possible with Neovim
2018-07-30 18:09:45 +02:00
Daniel Hahler
ffec4d7fc5 Test with Neovim 2018-07-30 14:24:53 +02:00
Daniel Hahler
43a9a9b191 Fix test/signatures.vim: ensure there is no indent (nvim) 2018-07-30 14:24:53 +02:00
Daniel Hahler
e05f34646e Fix test/signatures.vim: take into account &ruler (nvim) 2018-07-30 14:24:53 +02:00
Daniel Hahler
713e78dd39 tests: harden/fix completions with regard to longest/nvim mostly 2018-07-30 14:24:53 +02:00
Daniel Hahler
e49638ffc8 Upgrade vim-vspec to 1.8.1 (#862)
This fixes some tests to make it work with the newer version.
2018-07-30 11:16:51 +02:00
Daniel Hahler
4c430ed536 Improve JediDebugInfo for envs (#858)
Improve JediDebugInfo for envs

This is taken out of https://github.com/davidhalter/jedi-vim/pull/836.
2018-07-28 01:46:12 +02:00
Daniel Hahler
40fc5ab27f test/signatures.vim: remove trailing spaces 2018-07-25 02:21:54 +02:00
Daniel Hahler
9a4a4f4074 Skip duplicate call signatures
I am seeing `p` twice for os.path.dirname, which seems to come from
Lib/posixpath.py and Lib/ntpath.py, as can be seen with `os.path.join`,
where I still see two with this patch:

```
            (path, *paths)
import os   (a, *p)
os.path.join()
```
2018-07-16 13:50:49 +02:00
Daniel Hahler
c6716c6392 Makefile: use a single venv 2018-07-15 21:22:29 +02:00
Daniel Hahler
5123dbbbc7 Fix flake8 issue 2018-07-15 20:57:27 +02:00
Daniel Hahler
ee0f759a2e qa: add flake8 to check make target 2018-07-15 20:57:27 +02:00
Daniel Hahler
66b6a20041 Factor out annotate_description
This uses d.type, but special-cases functions and statements.
2018-07-15 19:26:11 +02:00
Daniel Hahler
8e077adb2f show_goto_multi_results: use relpath
This helps Vim to display the path for unlisted buffers relative to cwd
in the quickfix list.
2018-07-15 19:26:11 +02:00
Dave Halter
e7cb9a186e Also add remove_usages on InsertEnter 2018-07-15 19:26:11 +02:00
Dave Halter
b5774a9554 Add an augroup for usages 2018-07-15 19:26:11 +02:00
Dave Halter
f0d80048f1 Remove usages after text has changed in normal mode 2018-07-15 19:26:11 +02:00
Dave Halter
9e2244c44e Use standout/reverse instead of yellow for jediUsages
It uses cterm=reverse, which is supported by current Neovim, and at
least for xterm and rxvt-unicode reverse and standout are the same.

See `infocmp`:

> smso=\E[7m / rev=\E[7m
2018-07-15 19:26:11 +02:00
Dave Halter
cc087ef463 Somehow show_goto_multi_results was called without arguments
This was obviously wrong and fixed by inserting the obvious param
2018-07-15 19:26:11 +02:00
Dave Halter
efaef9cee3 Rename was in the wrong spot when using it at the end of a line. 2018-07-15 19:26:11 +02:00
Dave Halter
58561d45f1 Fix renaming and also highlight the renamed classes. 2018-07-15 19:26:11 +02:00
Dave Halter
84b8eeb954 Highlight usages
Use matchaddpos to highlight usages in the current file.
2018-07-15 19:26:11 +02:00
Dave Halter
2bb7677b43 Make it clearer which versions make check requires 2018-07-14 15:39:02 +02:00
Dave Halter
81ada14f0b Upgrade jedi to 0.12.1, forgot to upgrade it when upgrading parso
a79a1fb Merge branch 'parso'
58141f1 Don't use requirements for now, and use the git version instead in tox
e0e2be3 Add a better comment about why people need to upgrade parso
1e7662c Prepare release of 0.12.1
68974ae Don't use internal parso APIs if possible
c208d37 Remove code that is no longer used, because parso was refactored.
3847406 Make jedi work with the next parso release
95f835a Force unicode when listing module names
282c6a2 Use highest possible pickle protocol
ea71ded Include stderr with "subprocess has crashed" exception (#1124)
106b11f Set stdout and stdin to binary mode on Python 2 and Windows
f9e90e8 Use system default buffering on Python 2
197aa22 Use cPickle on Python 2 if available
e96ebbe Add tests for DefaultDict support.
55941e5 Add support for DefaultDict on jedi_typing.py.
ff4a773 Parse correct AST attribute for version
70c2fce Replace distutils.spawn.find_executable with shutil.which
5dab97a Add an error message, see also #1139.
e2cd228 Dict comprehension items call should now work, fixes #1129
c1014e0 Fix flow analysis test
62a3f99 Fix a wrong branch check, fixes #1128
6ebe3f8 Drop 3.3 tests from travis
50812b5 A simple yield should not cause an error, fixes #1117
d10eff5 Travis: report coverage also to codecov.io
6748faa Fix _get_numpy_doc_string_cls: use cache
fc14aad Fix namespace autocompletion error
3c909a9 Travis: remove TOXENV=cov from allowed failures
b94b45c Environment._get_version: add msgs with exceptions
a95274d None/False/True are atom non-terminals in the syntax tree, fixes #1103
8d48e74 When searching submodules, use all of __path__, fixes #1105
9149956 Specially crafted docstrings sometimes lead to errors, fixes #1103
ba96c21 Follow up from the last async issue, fixes more related things about #1092.
8494164 Fix an async funcdef issue, fixes 1092.
4075c38 In some very rare cases it was possible to get an interpreter crash
because of this bug. Fixes #1087
0bcd170 Start using our own monkeypatch function for some things
ceb5509 Include function return type annotation in docstring if it is present
88243d2 Don't catch IndexError where we don't have to
5f37d08 Extend create_environment to accept an executable path
aa6857d check_fs: handle FileNotFoundError
2018-07-14 12:31:11 +02:00
Daniel Hahler
7cade1fb62 Update submodule pythonx/parso 6f385bd...e6bc924
* pythonx/parso 6f385bd...e6bc924 (44):
      > Use a setuptools that still supports py33
      > 3.1 release notes
      > Use one simple functions to check for funcdefs in diff parser
      > Make sure to treat async funcdefs the same way as normal funcdefs
      > Fix an issue in the diff parser
      > Asterisks in function definitions may be at the end of a func without a comma, fixes #44
      > Remove some TODOs that were fixed
      > Error recovery should not match the whole line in case of an invalid token, fixes #40
      > docs: enable searchbox
      > Merge branch 'pgen'
      > Merge branch 'master' of github.com:davidhalter/parso
      > Add docstring
      > Add some comments
      > Use a set instead of dict if it's not necessary
      > Simplify some code
      > Some refactorings for simplicity
      > Use NFAArc as a class
      > Some more renames
      > Another rename
      > Rename
      > Move the grammar parsing to a separate module
      > More renames
      > Rename
      > Separate generating dfas from parsing
      > Cleanup some names
      > Remove some code that is not used anymore
      > Some cleanups and documentation
      > Move out some more functions out of classes
      > Some more refactorings for clarification
      > Factor out start_symbol into a better position
      > Refactor out dfas
      > Document pgen grammars a bit better
      > addarc -> add_arc
      > Refactor some things in pgen
      > Move some initializations
      > Change license again. The year shouldn't matter
      > Make first private
      > Change copyright years
      > Remove some code from the grammar
      > Separate the grammar generation from the grammar parsing
      > In pgen now everything is named grammar and not c
      > Better recovery for online classes and functions
      > Fix one-line error recovery for all things that are using a suite
      > Add a debug function for first tokens
2018-07-10 14:46:01 +02:00
Daniel Hahler
1773837a11 syntax: use "hi def" everywhere
This allows for keeping user configuration.
2018-07-10 12:49:48 +02:00
Daniel Hahler
67fd8c6572 s:init_python: fix check for Python 2
Fixes https://github.com/davidhalter/jedi-vim/issues/841.
2018-07-08 04:31:58 +02:00
Daniel Hahler
d3d9a91ae6 init: improve handling of import errors (#840)
* jedi_vim.jedi_import_error: add location

This is useful for debugging.  It contains e.g. the path to parso, if
importing failed from there.

Example:

> Error: jedi-vim failed to initialize Python: jedi#setup_python_imports: could not import jedi: cannot import name 'PythonTokenTypes' (in /…/jedi-vim/pythonx/jedi/jedi/api/completion.py:1). (in function jedi#init_python[3]..<SNR>44_init_python[27]..jedi#setup_python_imports, line 37)

* init: handle jedi_vim.jedi_import_error in Vim plugin

Using `set shortmess+=F` would suppress the `:echom` used in
`jedi_vim.no_jedi_warning` [1].

This patch makes `jedi#setup_python_imports` handle the error instead.

1: https://github.com/neovim/neovim/issues/8675

* Revisit error handling with loading jedi_vim

* jedi#debug_info: display parso submodule separately

* Fix jedi#reinit_python

* fixup! Revisit error handling with loading jedi_vim

* display_debug_info: handle exceptions with environment.get_sys_path

* fixup! Revisit error handling with loading jedi_vim

[ci skip]
2018-07-04 22:12:07 +02:00
Daniel Hahler
0361d6c633 s:init_python: handle g:jedi#force_py_version again (#834)
It was removed previously, since it now refers to the environment being
used.

This brings it back for now.

There could be a separate var for it later, and/or it needs changes
later (or rather the environment needs a new variable name, since it
should refer to the executable really) - but this is good for now I think.

Fixes https://github.com/davidhalter/jedi-vim/issues/833
2018-07-04 17:55:25 +02:00
Dave Halter
a54729ef63 Use the official Jedi goto API instead of multiple calls
Fixes #802.
2018-07-04 00:03:11 +02:00
tobaloidee
5f98bfb62e Add logo (#837)
This has been force-pushed.

See https://github.com/davidhalter/jedi-vim/pull/837 for other variants,
and the reason for force-pushing.
2018-06-26 18:07:14 +02:00
Daniel Hahler
745dc8a559 jedi#setup_python_imports: better SyntaxError handling
Uses `repr` for SyntaxErrors.

Related: https://github.com/neovim/python-client/pull/221
2018-06-23 11:28:41 +02:00
Vivian
84a5299c8f Fix spelling error 2018-05-29 19:33:30 +02:00
Daniel Hahler
d4006ab1bf Fix s:init_python
Just check for `has('python3')` / `has('python')`.

Fixes 72a2643f7c (r28922063).
2018-05-21 23:37:14 +02:00
Daniel Hahler
ed8153ef2b Update submodule pythonx/parso 579146b...6f385bd
* pythonx/parso 579146b...6f385bd (7):
      > Not testing Python 3.3 anymore on travis. It seems to be broken
      > Add a changelog for 0.2.1
      > Push the version
      > The diff parser was slighly off with prefixes, fixes #1121
      > A better repr for the endmarker
      > Merge branch 'master' of github.com:davidhalter/parso
      > Fix a prefix issue with error leafs.
2018-05-21 23:35:42 +02:00
Daniel Hahler
f07ff6a535 Fix flake8 W605: invalid escape sequence '\{w,d}' 2018-05-10 22:40:58 +02:00
Dave Halter
6781eb17da Small documentation change 2018-05-09 16:04:47 +02:00
Dave Halter
5ad782d920 Remove a strange sentence 2018-05-09 16:04:47 +02:00
Daniel Hahler
d75aaa470e Improve jedi_vim.get_environment
- cache current environment
- s/jedi.get_python_environment/jedi.get_system_environment: the former
  does not exist (renamed in https://github.com/davidhalter/jedi/commit/336087f)
- improve error display
2018-05-09 16:04:47 +02:00
Daniel Hahler
56eb0f6d63 Improve display_debug_info 2018-05-09 16:04:47 +02:00
Dave Halter
835e329883 Some improvements for the virtualenv patch 2018-05-09 16:04:47 +02:00
Dave Halter
49fa267e59 The jedi API changed a bit 2018-05-09 16:04:47 +02:00
Dave Halter
fa1aaa10cf Fix the jedi-vim debug tool, fixes #795 2018-05-09 16:04:47 +02:00
Dave Halter
e54a17ec71 Document force_py_version better 2018-05-09 16:04:47 +02:00
Dave Halter
48a9ea085d Force the Python environment correctly 2018-05-09 16:04:47 +02:00
Dave Halter
72a2643f7c Use the environment for completions. 2018-05-09 16:04:47 +02:00
Dave Halter
57cbf1421f Somehow the virtual env prefix is set in VIM.
This basically corrupts VIM's Python, because it might be having a differnet prefix (Python 3.6) than sys path. I don't know who came up with this - probably it's just how Python loads venvs - but it's definitely not good. Fortunately we can just reset it and be happy.
2018-05-09 16:04:47 +02:00
Daniel Hahler
7894b38c0c tests: move .cache to build, rename test/_utils.vim 2018-04-19 21:55:19 +02:00
Daniel Hahler
1c3078e9f9 get_script: additional_dynamic_modules: add only listed buffers
Unlisted buffers might come e.g. from `set viminfo+=%`, and Jedi would
crash on them.

This could additionally check for them to be readable, but this should
be handled in Jedi itself anyway.
2018-04-17 23:55:30 +02:00
Daniel Hahler
79b332a3c6 Update submodule pythonx/jedi 02f238c...bd7c65d
* pythonx/jedi 02f238c...bd7c65d (413):
      > Finally fix all the get_system_environment issues
      > Fix a test
      > There's really no bin/activate needed for an environment to work
      > Document get_sys_path and change the signature of get_system_environment a bit
      > Rework the time cache.
      > Cache default environment
      > Require parso 0.2.0 at least
      > Set a release date
      > Don't install the latest pip version anymore in appveyor
      > Fix some references
      > Mention Virtualenv support in readme and features
      > Title case for Mänu :)
      > Better overview over functions in the documentation
      > A small docs correction
      > Remove the old static analysis stuff. It was never really used
      > Fix a lot of old docs code that doesn't exist anymore
      > Remove the old parser documentation (that's now part of parso)
      > Don't call it the plugin API anymore, that's confusing
      > Reorder some functions
      > Adda  lot of environment documentation to sphinx
      > find_python_environments -> find_system_environments
      > A small refactoring
      > Remove from_executable, were not really using it, yet.
      > For the second time in a row it's called creationflags not creation_flags
      > Refactor something small
      > Remove an unnecessary else
      > CREATE_NO_WINDOW was introduced in Python 3.7 and didn't exist before
      > The SameEnvironment should not load by default if it's a portable
      > Do binary comparisons to get virtualenvs working and not just venvs
      > Use the correct parameter name for creation flags
      > Add a way to generalize Popen
      > Check the windows environments in a better way
      > Fix some issues with the latest changes
      > DefaultEnvironment -> SameEnvironment
      > Better docs for Environment
      > Some docstrings
      > Make the Environment clearly non-public
      > Make some names public
      > Make sure Windows environments are safe
      > Fix the module_name issue again
      > Write a test for #1079 to avoid a regression in the future.
      > Cleanup some of the module cache stuff
      > Do not cache unimportable compiled module (#1079)
      > Merge branch 'master' of github.com:davidhalter/jedi
      > Multiple inheritance completion in Python 2 did not work
      > Give the run.py script an environment parameter
      > Fix an import
      > Merge the environment changes for Windows
      > Better tests for venvs
      > Write a test for venvs
      > Obviously Python 3 syntax cannot be used in Python 2
      > Update the changelog about f-strings
      > Use the latest parso version from master.
      > Better goto definition for fstrings
      > Fix an issue around the new grammar
      > Fix some fstring issues for now
      > Make a few modifications to always use the latest environment available.
      > Better tests for fstrings
      > With the changes in parso, f-strings are now completable
      > With the changes in parso, f-strings are now completable
      > Fix lambda dynamic param searches, fixes #1070
      > Cleanup the namespace lookups so that it also works for Python 3.7
      > Add a note about the fixed Windows tests in the changelog
      > Add micbou to AUTHORS
      > Add a badge for AppVeyor. Running tests for Windows
      > Add comment explaining why test_versions is disabled on Windows
      > Add JEDI_TEST_ENVIRONMENT_EXECUTABLE for AppVeyor
      > Add AppVeyor configuration
      > Improve venv_and_pths test
      > Properly raise broken pipe exception
      > Remove SourceLair from products, because it's a paid product
      > Add a note to the readme.
      > Fix another windows issue
      > Merge branch 'master' of github.com:davidhalter/jedi
      > Merge the windows fixes
      > Some code cleanup
      > Fix another error that surfaced in pandas
      > Fix an issue with docstrings that contain errors
      > Upgrade the wx widgets paths
      > Somehow forgot about subscriptlist. Just ignore those for now.
      > Fix the first issue in #1010
      > colorama should always color, even if it's not a shell
      > os.path.join completion speed test is sometimes slow, so give it a bit more of time
      > Fix some code_lines issues
      > Remove stdout/stderr from subprocesses (redirected to /dev/null)
      > Add the module_path again
      > Clean up the namedtuple test for #1060
      > All modules now have a code_lines attribute, see #1062
      > The release date for 0.12.0 should not be set, yet. See #1061.
      > And now remove a pep0484 function that is no longer needed
      > Some more code to a function
      > More rewriting of the pep0484 logic
      > Start moving some of the pep0484 comment code around
      > Cleanup some instance stuff
      > Better docs for funciton annotations
      > Fix an error in param comments
      > Catch parser errors instead of error recovery when splitting param comments
      > Merge branch 'function_comment' of https://github.com/wilfred/jedi into mypy-comments
      > Fix a few version issues in tests
      > Use inspect.Parameter.kind for better differentiation between param types
      > Fix REPL completion param name completion
      > Add keyword argument test for #292
      > Fix an interpreter test in Python 2
      > Clean up zombie subprocesses, fixes #1048
      > Fix an issue around __dir__ in the interpreter
      > Fix doctest for replstartup
      > Fix shell completion issues and documentation
      > Merge branch 'master' of github.com:davidhalter/jedi
      > Fix issues with default parameters in functions and classes
      > Correct mistakes of lambda names
      > eval_element -> eval_node
      > Use the correct class for params when used in names. Fixes #1006
      > Get rid of a regex warning, where escaping was not properly used in a normal string
      > Get rid of the imp library import in Python3 to avoid warnings, fixes #1001
      > Don't need the tests from #122
      > Refactor the namespace package tests
      > Add a failing test for nested PEP420 namespace packages
      > Include __init__.py files in search for the project directory, fixes #773
      > Add pytest cache to gitignore
      > Improve some documentation/a failing doctest
      > Fix the recursion error with globals
      > Always pop nodes in recursion detector
      > Globals should be looked up with the same priority as other defined nodes.
      > fix set.append syntax error
      > Add a few bits to the changelog
      > Autocompletion in comments should at least not fail
      > Fix the last async issue
      > Fix a few numpydocs tests
      > Fix some more await things
      > Fix a yield from test
      > AbstractIterableMixin -> IterableMixin
      > Support generator returns when used with yield from.
      > Show in a test that something doesn't work properly around async analysis
      > A few documentation improvements
      > Try to make the whole Builtin overwriting more abstract
      > Fix a small remaining issue in Python 2
      > Reorder tests to make the async stuff pass on all python versions
      > Fix for all python versions
      > Getting more edget cases work in 3.6 for async
      > Fix an issue with async for
      > Use the await method properly and just use it instead of some crazy things
      > Refactor the way builtins can be overwritten by jedi's own contexts
      > Move all the asynchronous contexts to a separate module
      > Fix the merge issues. Now async stuff should at least partially work
      > Merge the async branch
      > Get rid of an unused import
      > Add the name always to the script module
      > Add the travere_parents function to a utility directory
      > Fix Python 2 old-school relative imports
      > Use the project path as a prefix, because many times it's used as a higher priority than other stuff
      > Move the buildout_project stuff to a separate examples folder
      > Rename of buildout stuff
      > Small rename
      > Use generators instead of complicated return of lists
      > Some more sys path corrections.
      > Generalize the use of smart import paths
      > Better handling of smart sys path
      > Some simplifications
      > Add comments to implicit namespaces and fix some minor things.
      > Merge the implicit namespace improvement (pkgutils.itermodules modification)
      > Relative imports should be working again even when used in more special occasions. Fixes #973
      > parent_module is not needed for loading modules
      > Try to avoid CachedMetaClass for modules
      > DOn't check the parser cache, that's parso's responsibility
      > Better module loading
      > Try to put all module loading in one place including namespace packages
      > Unify load_module access
      > Prepare a test to eventually solve a relative import problem
      > Add a module cache that has a bit more capabilites
      > print_to_stderr needs to be used with one argument
      > Print errors that happen when importing certain objects
      > Use unicode literals, to avoid potential issues
      > Merge branch 'master' of github.com:davidhalter/jedi
      > Fix some more dict.get/dict.values stuff
      > Implememnt dict.values for FakeDict to avoid a recursion error. Fixes #1014.
      > Add better error reporting
      > Use a better string
      > Add better debugging for an assert, see also #1010
      > Make some things clearer about lazy contexts
      > Finding the autocompletion stack is a bit more complicated than I initially thought
      > Move the ahead of time tests to the pep0526 file
      > Fix an issue where a default value was wrongly used
      > Update the ahead of time tests
      > Fix the last remaining issues with ahead of time annotations, see #982
      > Fix a bug related to a wrong parametrization at one point
      > Merge branch 'master' of https://github.com/johannesmik/jedi
      > Force unicode on django paths
      > Forgot to add the examples folder
      > Fix a goto_assignments issue with a better internal API
      > Merge remote-tracking branch 'origin/master' into virtualenv
      > Disable predefined name analysis (if stmts) for all non-analysis tasks
      > Remove something that obviously never happened
      > Reorder some open flags for Python 2
      > inspect.signature throws weird errors sometimes, just make it a bit simpler
      > Fix the implicit namespace test
      > Undo most of the namespace changes and use module again
      > Differentiate between namespace and module as a type
      > Use Scripts for virtualenvs instead of bin for windows
      > Refactor django path support
      > Fix project path finding
      > Add a repr for Project
      > Use the PathFinder, because the FileFinder doesn't work without suffixes
      > Create the importer stuff Python2.7 and 3.3
      > Trying to use the import machinery to import jedi/parso in python3.4+
      > Better reporting of internal errors
      > Better error handling for subprocesses
      > Another merge with master
      > Get rid of a cwd to tmpdir, because with the subprocess it doesn't behave the same depending on which tests you run first
      > Hopefully the last merge with master
      > Merge with master again
      > Merge with master
      > Get rid of some potential issues when using pandas interactively
      > Clarity
      > Remove the get_default_project caching
      > Add a comment about why the project is None in the subprocess
      > evaluate.project doesn't exist anymore. Eliminated code that used it
      > At the moment, don't allow projects as an input to script
      > Remove the old project
      > Make the new project API fully work in tests
      > Try to migrate to the new project API
      > Refactor to make configuratios of sys paths easier
      > Use the evaluate.project sys path stuff for api.project
      > Cache the default project
      > A possible introduction for projects
      > Check for safe and unsafe environments when searching for them
      > Sith still used NotFoundError which doesn't exist anymore in jedi
      > Ignore pypy in travis for now
      > A path to ignore in coveragerc was wrong
      > Allowing the cov tests did not properly work. Trying again.
      > Somehow previously removed the allowed failurs of TOXENV=cov
      > Try to put env variables on one line
      > Coverage was unfortunately excluded
      > Merge with master
      > Add a comment to refactoring that it's not in active development
      > Change coveragerc a bit
      > Use Python3.4 for coverage.
      > Correct the issue about has_zlib
      > Move the zip tests to the environment
      > Only execute the zipimport tests fully if zlib is available for the environment Python.
      > Some tests that involved jedi were actually a bit wrong and only worked in certain environments.
      > Skip some 3.3 tests for travis
      > Skipping was done wrong
      > Try a bit more if modifying the PATH is now possible.
      > A comparison was wrong
      > A new version of the travis install script
      > Try to use the virtual env that was defined in the VIRTUAL_ENV variable, if possible.
      > If a subprocess gets killed by an OOM killer or whatever it should respawn and raise an InternalError
      > Merge Subprocess and CompiledSubprocess
      > Try to recover from errors that are happening in subprocesses
      > Move the default environment around
      > More travis trying
      > Better debugging for travis
      > Forgot to add the executable bit to the travis installer.
      > Experiment with travis and installing packages differently
      > The tags should be annotated if possible
      > Remove 2.6 from travis
      > Correct the travis file
      > Some refactoring to finally get tests working with py27 and 3 environments
      > Use the parser to check for certain namedtuple features
      > Use unicode strings in test to pass some tests in Python 2
      > Use Script everywhere where cwd_at is used, otherwise Python 2.7 is annoying
      > The given sys_path gets converted to unicode now in py2
      > Try to avoid the pth tests not working because of the created virtualenv in tox
      > Test if virtualenvs and pth files work
      > Move the module name searching to the subprocess
      > Move the last test out of test_regressions and delete the file
      > Move most of the regression tests into other test files
      > Cleanup test_regression tests
      > Move test_integration_keywrod to test_api/test_keyword
      > Cleanup the docstring tests
      > More test_evaluate Script fixtures
      > stdlib fixture conversions
      > More Script fixture conversions in test_evaluate
      > Migrate parso integration to script fixture
      > Use Script in more places
      > Use the Script fixture more generally
      > Differentiate between different Python versions in a specific test
      > Start replacing Script calls with a fixture
      > Monkeypatch the Unpickler in Python3.3
      > Try to pass the environment variable for JEDI_TEST_ENVIRONMENT to pytest over tox
      > Correct the two last unicode issues
      > Some repr went crazy
      > Make it more clear for debugging where dynamic search ended
      > Fix pep0484 comments
      > Better display of descriptors
      > Remove some of the last py27 errors that were caused in combination with 3.6
      > Forgot to cast a map to a list
      > Fixing more py27 stuff
      > More unicode literals
      > Use force_unicode for all sys paths
      > Add a print_to_stderr function in compatibility
      > Some more small improvements for Python 2
      > There were a few bugs in the previous commit
      > Use unicode in way more cases
      > Use unicode always for getting special objects
      > Skip the correct tests
      > Always use the parser of the environment
      > Try to test on travis with different jedi test environment variables
      > Try adding more automated tests to travis
      > Fix potential issues with py2 analysis
      > Check for bytes and unicode in dicts for Python 2
      > Eliminate is_py3 usages
      > Don't use python_version directly on evaluator anymore
      > Use unicode always in getattr
      > Fix an issue with the new behavior of special methods
      > Fix some more py36 to py27 issues
      > Refactor some things regarding Python 2 support
      > Also don't cast do a string for other names
      > Casting to str is not necessary
      > Skip tests according to the current environment
      > Remove unused keyword code
      > Do more comparisons in the subprocess
      > Use unicode in compiled access
      > Remove unused code
      > Refactor allowed_getattr_callback a bit to not raise random errors.
      > The default of one function was not actually used
      > The string_name of a Name should always be unicode
      > Refactor a bit and force unicode in some places and use an appropriate function name for it
      > Fix a test fail because of the unicode changes
      > The environment selection had a bug
      > More unicode conversions
      > Don't use getattr, use the abstractions
      > More unicode conversions
      > Avoid execution of Jedi in test setup
      > Start using a lot more unicode literals for Python 2
      > Make it possible to explicitly state the version in pytest for different envs
      > Use unicode sys paths always
      > Don't cast bytes to strings when unpickling
      > By default enable cross Python version tests in tox
      > Skip more tests if it's necessary.
      > Move the import logic to the subprocess
      > Move even more import stuff to a separate function
      > Move some import parts around to refactor it
      > Make ImplicitNamespaceContext a bit cleaner
      > Change two tests that were written in a strange way
      > Add a way to skip typing tests in non default environments
      > Use better error messages for import errors
      > Start using the new virtualenv code
      > Start using the correct parser for each environment
      > Add a way to specify environments in tox
      > Fix sys_path propagation for builtins load_module
      > A small refactoring
      > Merge branch 'master' into virtualenv
      > evaluate/docstrings.py
      > Don't import numpydoc in the beginning
      > Ignore the build directory for pytest
      > Refactor environments a bit
      > Make it possible to get the right version parser for a certain environment
      > api.virtualenv -> api.environment
      > DefaultEnvironment -> get_default_environment
      > Better support for searching python environments
      > Add an optimization around compiled dir()
      > Fix a potential issue in evaluate/stdlib
      > Cache the subprocess results
      > Remove unit test class from speed tests
      > Make get_repr static in access.
      > There was a bug in creating modules in a subprocess
      > Fix the Python 2.7 tests
      > Don't try to pickle ellipsis
      > Ignore __main__ modules
      > Use builtins_module instead of BUILTINS
      > Don't use the pickler modification anymore. That doesn't work in other python versions and was in general a bit hard to do
      > Remove the last test failures.
      > Get the subprocess mostly working
      > Don't use the create function anymore in compiled
      > Use even more subprocess accesses
      > Use the subprocess access to create acceses
      > Use access handles everywhere
      > Create a way of accessing access objects through a subprocess
      > Use a class instead of a dict in get_special_objects
      > Move get_special_object
      > Move load_module a bit around
      > Move another usage of create to builtin_from_name
      > Use sys.modules instead of __import__
      > Remove unused code
      > Start creating access objects in a different way
      > Use create_simple_object for a lot of use cases
      > Move some of the compiled.create calls to compiled.builtin_from_name
      > Move some stuff from compiled to context
      > Remove stuff from CompiledObject that didn't belong there and wasn't used
      > create_from_access -> _create_from_access
      > Refactor a bit more and remove the parent_context parameter from create_from_access
      > Isolate fake stuff a bit more
      > Simplify an if
      > Rewrite bases
      > Use create only for non access objects
      > Some simplification of _create_from_access
      > Remove the old now unused fake code
      > Fake context python code is now not the base for a lot of things anymore. It just gets executed.
      > Rename SelfNameFilter to SelfAttributeFilter
      > Simplify one if statement
      > Refactor LazyInstanceName -> SelfName
      > Fix all tests except fake docstring stuff
      > Fix a slice test with a better helper function
      > Fix a few more tests
      > Creating objects works now a bit better but is a huge mess.
      > Get a lot of tests passing
      > Make params work with access
      > Add an access abstraction (only array tests work, yet)
      > The check if we should add type completions is now a bit more obvious
      > Eliminate CompiledObject.type
      > Make some faked things private
      > Cleanup some compiled stuff.
      > Progress in executing builtin stuff in submodules.
      > Exceptions now also work over the subprocess.
      > Finally got compiled_objects and the access to them working
      > Progress when working with evaluators
      > Make the subprocesses work and return the right sys paths for the different versions
      > Make it possible to connect to a subprocess to get the sys path
      > Subprocess progress
      > Use types instead of special objects (see also #988)
      > Some subprocess progress
      > virtualenv progress
2018-04-17 23:42:11 +02:00
Daniel Hahler
24a0369d0f Update submodule pythonx/parso 2ca629a...579146b
* pythonx/parso 2ca629a...579146b (22):
      > Don't test python 2.6 in tox by default, because the newer pip versions don't support it anymore
      > Set a release date
      > Fix whitespace issues with prefixes
      > Use proper leafs for fstring start/end
      > Fix a Python 2 related issue.
      > Forgot to delete another print. WTF I'm tired
      > Unfortunately forgot to delete a print
      > Start to write a changelog for 0.2.0
      > Merge branch 'fstrings'
      > A comparison was slightly off
      > Ignore the pytest cache
      > Fix an error message change in Python 3.7
      > Fix an issue in the diff parser about endmarker newlines
      > Remove the copyright for good
      > Remove copyright years from documentation. (Closes: #25)
      > Fix typo: containes→contains
      > tox: use older pytest only for py26/py33
      > Merge branch 'master' of github.com:davidhalter/parso
      > Don't use a newer pytest version
      > The tags should be annotated if possible
      > Bump version for the next release
      > Use 3.7-dev not 3.7 for travis
2018-04-17 23:42:11 +02:00
Daniel Hahler
d430570fd0 pythonx/jedi_vim: flake8 fixes 2018-04-17 23:26:22 +02:00
Daniel Hahler
79c6172be7 Update .gitignore
- add build/ (used in Makefile)
- use .pytest-cache instead of .cache for newer pytest
2018-04-17 23:25:48 +02:00
Matthieu Méquignon
48af2afd3e [IMP] README.rst - Add a description for Vundle installation. (#781)
* [IMP] README.rst - Add a description for Vundle installation.

* [FIX] README.rst - Fix typo.
2018-02-16 11:22:10 +01:00
MaximeSauvage1
7b7e6b5859 Readme: fix stackoverflow link (#782) (#783) 2018-02-16 11:14:34 +01:00
Dave Halter
37bd03c3d5 An or is not needed
This comparison is useless, because the case where the module_path is None is already looked at in a previous if
2018-02-01 00:27:42 +01:00
Dave Halter
79ced22a37 Handle the module_path better for namespaces
See also discussion in davidhalter/jedi#1033
2018-01-30 00:16:35 +01:00
Daniel Hahler
510b1c94e4 Improve tests / failure detection (#769) 2018-01-15 08:38:35 +01:00
Daniel Hahler
6d05c25873 Factor out jedi#setup_completion (#768) 2018-01-15 08:37:35 +01:00
naronA
0b9bbc3495 fix: CheckHealth doesn't work in neovim (#765)
Squashed:

* fix: CheckHealth doesn't work in neovim

CheckHealth calls display_debug_info().
However, error occured when loading jedi_vim.jedi.Script('')._evaluator.sys_path,
because Evaluator.sys_path is unavailable variable.

* handle the both the old and new API

Evaluator.project.sys_path is temporary fix, because Evaluator.sys_path is correct API.
So, we handle the both the old and new API in preparation for merging virtualenv branch.
2017-12-30 14:03:54 +01:00
Dave Halter
31ebd30c31 Upgrade jedi and parso 2017-12-14 23:06:18 +01:00
yaegassy
3be8833913 Fix typo in jedi-vim.txt 2017-11-22 20:04:54 +01:00
Dave Halter
77924398bd Add a comment to clarify why we I used longest 2017-10-19 09:20:43 +02:00
Dave Halter
8e0cefc371 The parso sys path was not properly set 2017-10-19 09:20:43 +02:00
Dave Halter
bbd456c016 Update jedi to 0.11.0 2017-10-19 09:20:43 +02:00
Dave Halter
41507bab99 Use single quoted strings 2017-10-19 09:20:43 +02:00
Dave Halter
8b7c4cbad5 In older vim versions, noinsert and noselect didn't work
Use longest instead of them.
2017-10-19 09:20:43 +02:00
Dave Halter
65190a1856 A pyimport test failed sometimes on travis
There are sometimes slight differences in installed Python versions (and also Python versions within VIM versions).
2017-10-19 09:20:43 +02:00
Dave Halter
fb52e32238 Try installing Python3.6 in travis 2017-10-19 09:20:43 +02:00
Dave Halter
109ceeb2f8 Add the tests again to travis 2017-10-19 09:20:43 +02:00
Dave Halter
d189d8aab7 Add the parso submodule 2017-10-19 09:20:43 +02:00
Dave Halter
7e6811cb4b Fix call signature tests
Now all tests should be fixed again. Also removed a deprecated call to call_name.
2017-10-19 09:20:43 +02:00
Dave Halter
24496c1416 Remove param name in description to make call signatures a bit better 2017-10-19 09:20:43 +02:00
Dave Halter
8d547695e2 Fix goto tests 2017-10-19 09:20:43 +02:00
Dave Halter
d42f56bc82 Buffer names seem to be an empty string sometimes and not None 2017-10-19 09:20:43 +02:00
Dave Halter
192e03b335 NotFoundError was deprecated in Jedi a while ago 2017-10-19 09:20:43 +02:00
Dave Halter
1c7c9064b7 test titles don't need underscores 2017-10-19 09:20:43 +02:00
Dave Halter
85020495ef Only use the tagstack if the file actually exists
This caused problems when using jedi-vim without an actual file behind a buffer.
2017-10-19 09:20:43 +02:00
Dave Halter
edde267f6b Fix a pyimport test fail 2017-10-19 09:20:43 +02:00
Dave Halter
641c88111d Fix completion tests. 2017-10-19 09:20:43 +02:00
Dave Halter
5c6531ffae Better names for the test parametrizations 2017-10-19 09:20:43 +02:00
Dave Halter
516189c7e3 call_name was deprecated a few Jedi versions ago 2017-10-19 09:20:43 +02:00
Dave Halter
ce6b60063d Use python3.6 for tests. 2017-10-19 09:20:43 +02:00
Daniel Hahler
72c1a332d2 jedi#show_documentation: do not use quotes around bufname 2017-09-29 18:36:04 +02:00
Alexander Zhukov
c8164fdfda Enhance example installation command (#739) 2017-09-17 21:21:42 +02:00
Daniel Hahler
0c6a2b7737 README: improve FAQ for slowness, add deoplete-jedi
Ref: https://github.com/davidhalter/jedi/issues/910#issuecomment-322731875

[ci skip]
2017-08-16 22:08:59 +02:00
Daniel Hahler
60bdff8eea Move Python code for jedi#debug_info into pythonx
This allows vimlparser to parse the vim file again, and it is more
convenient to have it in a real Python file anyway.

Small refactoring and minor text changes included.
2017-08-09 23:59:52 +02:00
Daniel Hahler
ddaec5652b Lint fixes 2017-08-09 00:13:55 +02:00
Daniel Hahler
163a0b5db1 Use Vim's pythonx mechanism
Move jedi_vim.py and the jedi submodule into pythonx, which gets added
to Vim's internal sys.path.  While jedi cannot be imported directly from
there, it still makes sense for consistency.
2017-08-08 18:58:54 +02:00
Daniel Hahler
cfadac7f22 jedi#debug_info: try/catch failures from s:init_python()
This is relevant for when using `:JediDebuginfo` in a broken setup,
where the call to `jedi#init_python()` in the autoload file throws an
error already (but `jedi#debug_info` is defined/loaded before already).
2017-08-08 17:28:29 +02:00
Daniel Hahler
82661d515b Fix restoring alternate terminal with completeopt redirection
Fixes https://github.com/davidhalter/jedi-vim/issues/721.
2017-08-07 20:34:10 +02:00
Daniel Hahler
a46ea1a1eb Refactor completeopt handling
Temporarily set &completeopt before triggering automatic completion,
instead of handling different settings afterwards.
`g:jedi#popup_select_first` is used to use `noinsert` instead of
`noselect`.

Fixes https://github.com/davidhalter/jedi-vim/issues/516.
Fixes https://github.com/davidhalter/jedi-vim/issues/706.
2017-08-07 19:48:53 +02:00
Daniel Hahler
a2cf2291da Inline Python init script
Fixes https://github.com/davidhalter/jedi-vim/issues/726.
2017-08-06 21:57:10 +02:00
Daniel Hahler
dc7b6228b2 Rename initialize.py to jedi_vim_init.py
Ref: https://github.com/davidhalter/jedi-vim/issues/726#issuecomment-320505021.
2017-08-06 17:04:28 +02:00
Daniel Hahler
20312dcca8 JediDebugInfo: skip newline with no non-default settings 2017-08-06 15:08:11 +02:00
Daniel Hahler
c11b38cb48 s:init_python: use setup_py_version instead of force_py_version 2017-08-06 15:07:12 +02:00
Daniel Hahler
f1d9708f7c jedi#setup_py_version: check if init script is readable
Ref: https://github.com/davidhalter/jedi-vim/issues/726.
2017-08-06 14:48:09 +02:00
Daniel Hahler
6394614017 Define PythonJedi command always (#727)
This is meant to help in case of issues where the Python initialization
fails (https://github.com/davidhalter/jedi-vim/issues/726#issue-248054145),
so that `JediDebuginfo` can still provide some more information.
2017-08-06 01:00:51 +02:00
Daniel Hahler
6411de0cd1 auto_vim_configuration: improve check for changed completeopt setting
The user might want to use the default actually.
2017-06-10 12:38:33 +02:00
Antony Lee
0ee2ed0bc6 help: do not highlight rst indented sections as python (#717)
Fixes https://github.com/davidhalter/jedi-vim/issues/716.
2017-06-06 18:09:14 +02:00
Daniel Hahler
e2d79c6434 popup_on_dot: document that it needs completions_enabled
It would be ignored already with completions_enabled=0.
This documents it and makes the default follow it.
2017-06-03 20:49:14 +02:00
BennyYip
53358dc0fa Fix unwanted fold in __doc__ 2017-06-03 20:39:14 +02:00
David D Lowe
18af876d6b Clarify how to use minimal.vimrc to report issues (#709) 2017-05-25 14:46:44 +02:00
Dawson Botsford
40a02a7fd1 📄 Make Travis badge unpixely 2017-04-27 20:00:55 +02:00
Daniel Hahler
eef60e056a JediDebugInfo: settings: display full name 2017-04-19 23:53:11 +02:00
Daniel Hahler
8e34a59045 initialize.py: handle reloading of the plugin (#659)
Do not keep adding jedi_vim_path to sys.path.
2017-04-13 22:47:31 +02:00
Daniel Hahler
c1e279cab7 Update Jedi to 0.10.2 2017-04-06 20:13:28 +02:00
Daniel Hahler
2ee9ec64d3 Improve GitHub issue template and JediDebugInfo 2017-03-01 23:52:55 +01:00
Daniel Hahler
682f37792d Move Travis targets to Makefile
This allows for calling them easily locally.
2017-02-22 11:36:01 +01:00
Thúlio Costa
0844b14866 rename: use new Jedi interface
Fixes https://github.com/davidhalter/jedi-vim/issues/671.
Closes https://github.com/davidhalter/jedi-vim/pull/684.
2017-02-21 20:06:19 +01:00
Daniel Hahler
ac6756a466 Fix default of jedi#auto_vim_configuration back to 1 (#682)
This was broken in eba90e6.
2017-02-17 22:11:21 +01:00
Daniel Hahler
b885e10e0d Make jedi#debug_info more robust
Fixes https://github.com/davidhalter/jedi-vim/issues/675.
2017-02-15 12:14:47 +01:00
Dave Halter
0dea756fd9 Update the Jedi subrepository to 0.10.0 (#669) 2017-02-03 00:49:42 +01:00
Daniel Hahler
8cf616b088 Correctly fix return value of jedi#complete_opened (#664)
Fixes https://github.com/davidhalter/jedi-vim/issues/663.
Fixes https://github.com/davidhalter/jedi-vim/issues/667.
2017-01-31 11:12:25 +01:00
Daniel Hahler
63ecc1dbd7 Add omnifunc/completeopt to jedi#debug_info 2017-01-31 10:54:33 +01:00
Daniel Hahler
52772e171f Fix return value of jedi#complete_opened (#664)
Fixes https://github.com/davidhalter/jedi-vim/issues/663.
2017-01-31 09:25:43 +01:00
Daniel Hahler
eba90e615d Style fixes (via vint) (#662)
This also adds a augroup for `jedi#add_goto_window`.
2017-01-29 11:55:55 +01:00
Dave Halter
f100ffad4d Merge pull request #661 from blueyed/remove-obsolete-s-jedi_changedtick-and-fix-style
Remove obsolete s:jedi_changedtick and fix style
2017-01-27 19:23:51 +01:00
Daniel Hahler
702da51cbe Remove obsolete s:jedi_changedtick and fix style
It became obsolete in 794af5b, but setting it was not removed then.
2017-01-27 18:47:48 +01:00
Dave Halter
fe30fa485b Merge pull request #660 from blueyed/debuginfo-settings
jedi#debug_info: output non-default settings
2017-01-25 23:31:37 +01:00
Daniel Hahler
3582fa6bc2 jedi#debug_info: output non-default settings 2017-01-25 21:49:39 +01:00
Dave Halter
4a3dc9da84 Merge pull request #658 from blueyed/debug-info-improved
Improve :JediDebugInfo: verify that JediPython works / sys_path
2017-01-23 00:21:06 +01:00
Daniel Hahler
f99d86073b jedi#debug_info: add Jedi's sys_path
Ref: https://github.com/davidhalter/jedi/issues/828
2017-01-14 20:26:11 +01:00
Daniel Hahler
636d393114 jedi#debug_info: check that PythonJedi can be called 2017-01-14 20:25:18 +01:00
Rick van Hattem
4baf4b27f7 Update incorrect documentation url (#657)
Fixes #656.
2017-01-14 15:37:12 +01:00
Francisco Souza
3dc61513af Update jedi (#650)
Picking up support for Python 3.6
2017-01-08 23:21:00 +01:00
Daniel Hahler
80378d857b Use re.escape for the g:jedi#call_signature_escape setting (#646)
Fixes https://github.com/davidhalter/jedi-vim/issues/641.
2016-12-09 00:10:20 +01:00
Dave Halter
671f9f5780 Merge pull request #640 from Aulddays/master
Change default g:jedi#call_signature_escape to avoid collision
2016-12-05 00:52:56 +01:00
Aulddays
b96dad9d50 add to author list 2016-12-04 22:40:50 +08:00
Aulddays
a69e6b8cc0 Change default g:jedi#call_signature_escape to avoid collision
Syntax highlighting on chars in g:jedi#call_signature_escape may
break the funciton parameter hint from jedi-vim. Change its default
value to non python syntax symbols to reduce chance of collision
2016-12-04 22:13:51 +08:00
Dave Halter
f191ccd6fb Merge pull request #635 from blueyed/update-jedi
Update jedi submodule to current master
2016-11-16 18:02:45 +01:00
Daniel Hahler
8243015479 Update jedi submodule to current master
Comparison: 995a653122...2ba78ab725.
2016-11-16 13:42:24 +01:00
Daniel Hahler
01787a9988 Fix typo in README (#634) 2016-11-14 17:15:20 +01:00
Christian Geier
4ed33a8600 Fix typo in README. 2016-11-14 14:30:28 +01:00
Dave Halter
e66c2e12e6 Merge pull request #625 from blueyed/add-JediClearCache
Add JediClearCache command
2016-10-24 10:19:28 +02:00
Dave Halter
d0c3ddb9ff Merge pull request #619 from blueyed/reset-python-init-status-when-autoload-jedi.vim-is-resourced
Reset python init status when autoload/jedi.vim is resourced
2016-10-23 18:47:49 +02:00
Daniel Hahler
12db7ad364 Add JediClearCache command
This can be used to work around issues like
https://github.com/davidhalter/jedi/issues/784.
2016-10-06 19:15:52 +02:00
Dave Halter
9384d464ec Merge pull request #620 from blueyed/check-health
Hook into Neovim's :CheckHealth with jedi#debug_info
2016-09-27 20:23:56 +02:00
Daniel Hahler
d86039ea89 Hook into Neovim's :CheckHealth with jedi#debug_info
See https://github.com/neovim/neovim/blob/master/runtime/doc/pi_health.txt.
2016-09-25 18:11:06 +02:00
Daniel Hahler
b32b731767 Reset python init status when autoload/jedi.vim is resourced 2016-09-25 18:02:44 +02:00
Daniel Hahler
6a6595f5c5 Improve jedi#debug_info / :JediDebugInfo (#618) 2016-09-25 17:47:09 +02:00
Dave Halter
026ae6be03 Merge pull request #613 from otommod/patch-1
Fix doc link
2016-09-06 17:18:09 +02:00
Otto Modinos
b7163d615c Fix doc link
Stars are not correct here.
2016-09-06 17:06:32 +03:00
Dave Halter
443e7fe555 Merge pull request #608 from blueyed/github-issue-template
Add an ISSUE_TEMPLATE file for GitHub
2016-08-17 22:32:12 +02:00
Daniel Hahler
b3f7f3c0b5 fixup! fixup! Add an ISSUE_TEMPLATE file for GitHub 2016-08-17 12:25:38 +02:00
Daniel Hahler
8753bf2e16 fixup! Add an ISSUE_TEMPLATE file for GitHub 2016-08-17 12:24:05 +02:00
Dave Halter
f95ac1e8e0 Merge pull request #606 from blueyed/remove-mark-hack-for-jumplist
Do not set the '`' mark in goto
2016-08-16 23:03:14 +02:00
Daniel Hahler
f0c63f1172 Do not set the '`' mark in goto
This was meant as a hack to make the jumplist work (7520290), but it
works without it.  Maybe the underlying code to go to the definition has
been changed/improved.
Tested both in Vim (7.4.2143) and Neovim.
2016-08-16 00:52:27 +02:00
Daniel Hahler
02c2de1c51 Add an ISSUE_TEMPLATE file for GitHub 2016-08-16 00:52:17 +02:00
Daniel Hahler
99132ec545 Fix Travis: remove --use-mirrors for pip (#609)
* Travis: use sudo: false (container based builds)

* Travis: remove --use-mirrors for pip-install

The option is not valid anymore with pip 8.1.2 apparently
(https://travis-ci.org/davidhalter/jedi-vim/builds/152006664).
2016-08-16 00:51:45 +02:00
Dave Halter
5ea9ee7a63 Merge pull request #602 from blueyed/improve-jedi-load-error
Improve error msg when the jedi submodule fails to load
2016-08-06 18:23:42 +02:00
Daniel Hahler
ba0b44b65d echo_highlight: cast msg to str
This helps to avoid errors with incomplete traceback/exception details
when using it with e.g. `echo_highlight(dir(jedi))`.
2016-08-03 11:19:11 +02:00
Daniel Hahler
369284a6bc README: enhance Installation section 2016-08-03 11:18:41 +02:00
Daniel Hahler
3882c5dd32 Improve error message when the jedi module fails to load
Fixes https://github.com/davidhalter/jedi-vim/issues/560.
2016-08-03 11:08:30 +02:00
Dave Halter
c94a143bfb VIM apparently cannot deal with zero bytes in strings. Fixes #551 2016-07-30 15:59:15 +02:00
Tommy Allen
b7e42e6ad5 Fix preview autocmd being cleared for all buffers (#597)
Fixes https://github.com/davidhalter/jedi-vim/pull/582#issuecomment-235986169.
2016-07-28 23:02:21 +02:00
Dave Halter
2eabe57616 Make the equals available in the completion list, fixes #350. 2016-07-21 23:30:36 +02:00
Dave Halter
d9f92d5b24 Move the vim import to top. 2016-07-21 23:26:04 +02:00
Dave Halter
6b7dfe1c1a Merge pull request #577 from blueyed/more-robust-initialize.py
Make initialize.py more robust
2016-06-16 21:18:44 +02:00
Tommy Allen
70360437cd Prevent duplication of InsertLeave autocmds in buffers (#582) 2016-06-12 00:35:09 +02:00
Daniel Hahler
19ad3063d9 Make initialize.py more robust
Ref: https://github.com/davidhalter/jedi-vim/issues/574
2016-05-28 20:46:02 +02:00
Asher256
8334e505b3 Bug fix: E492: Not an editor command: jedi_vim.clear_call_signatures() (#576)
I got this error after I updated my local copy of jedi-vim to
the commit 'e8b88f0161ef2adabda97d4e083585a3becdcb53':
```
Error detected while processing function jedi#clear_call_signatures:
line    6:
E492: Not an editor command:     jedi_vim.clear_call_signatures()
``
`
The error below happened because 'PythonJedi' was missing before
jedi_vim.clear_call_signatures() in autoload/jedi.vim.

I put back 'PythonJedi' and it solved the issue.
2016-05-27 20:57:22 +02:00
Dave Halter
e8b88f0161 When jedi-vim cannot load jedi, show_call_signatures should not throw errors all the time. One error at the beginning is enough. 2016-05-27 13:22:37 +02:00
Dave Halter
a0c3269420 Merge pull request #557 from blueyed/vim_eval-int
Cast integers with vim_eval
2016-04-08 14:49:24 +02:00
Daniel Hahler
75e9141111 Cast integers with vim_eval
This makes it clearer/more strict altogether and is future-proof in the
sense that `vim.eval` might return integers for numbers in Vim after all.

See #553 for a very noisy discussion of what led to this.
Although it might be a regression in neovim-python after all it is good
to be on the safe side.

The bonus here is that we get "notified" in case of a option that is
expected to be an integer is a string instead.

Fixes https://github.com/davidhalter/jedi-vim/issues/553.
2016-04-08 14:37:44 +02:00
Dave Halter
5ccdd11282 Merge pull request #556 from blueyed/clarify-_catch_exception
Clarify arguments with _catch_exception
2016-04-07 22:30:42 +02:00
Dave Halter
5bcb17a8ad Merge pull request #554 from blueyed/improve-error-with-use_splits_not_buffers
minor: improve error msg with invalid use_splits_not_buffers setting
2016-04-07 22:10:08 +02:00
Daniel Hahler
0f7b743b4e Clarify arguments with _catch_exception
The whole int/string conversion with `vim.eval` is confusing enough, use
a boolean for `is_eval`.
2016-04-06 17:22:47 +02:00
Daniel Hahler
48ad42de86 minor: improve error msg with invalid use_splits_not_buffers setting
Ref: https://github.com/davidhalter/jedi-vim/issues/553
2016-04-06 14:01:03 +02:00
Daniel Hahler
0d613b5cf9 Merge pull request #549 from mozbugbox/rename-fix
Fix renaming: cursor pos and undo tracking (#545, #502)
2016-03-21 22:19:59 +01:00
mozbugbox
794af5b90a Track undo properly in rename(). Fix #502
Use vim changenr() call to track change and undo. This is more
robust than bindly call 'normal! u'
2016-03-21 09:53:57 +08:00
mozbugbox
221d7dbee4 Fix: rename() kept wrong cursor position #545
The cursor would change to something else once in the insert mode. If
the new name was longer than the old one, the Parser couldn't get
the stmt at the wrong cursor position, thus rename failed.

Now save the cursor position before entering the insert mode. Then pass
the saved position to the 2nd call to the rename().
2016-03-20 23:05:15 +08:00
Dave Halter
e7193b5e5f Merge pull request #547 from blueyed/improve-error-on-init
Improve error messages during init
2016-03-20 04:34:08 +01:00
Dave Halter
9ae6da6467 Merge pull request #548 from blueyed/use-m-with-search
jedi#smart_auto_mappings: use `\m` with `search()` for `magic`
2016-03-20 04:33:53 +01:00
Daniel Hahler
f08abefa31 jedi#smart_auto_mappings: use \m with search() for magic
With `nomagic` being set (not recommended, but might happen), the
pattern would not work.
This patch sets `\m` explicitly.
2016-03-18 23:16:07 +01:00
Daniel Hahler
cdfb7a5b4f initialize.py: catch and handle any exception when import jedi_vim
This adds the traceback to it, which then will be displayed with
`v:exception` in the Vim part.
2016-03-18 23:08:49 +01:00
Daniel Hahler
de793216f5 minor: move code out of 'try' block in jedi#setup_py_version 2016-03-18 23:07:43 +01:00
Daniel Hahler
6b8d900b05 Use echoerr in jedi#init_python
This will abort the script, instead of finishing there only.
2016-03-18 23:06:43 +01:00
Daniel Hahler
df39189578 Fix no_jedi_warning: display actual error
Never really worked as intended in 676b378.
Ref: https://github.com/davidhalter/jedi-vim/issues/460
2016-03-18 23:05:07 +01:00
Dave Halter
625c568b12 Merge pull request #527 from prologic/master
Fixes Python 2.6 compatibility issues with `str.format()`
2016-01-14 14:14:44 +01:00
James Mills
8215b220f9 Fixed Python 2.6 str.format() compatibility 2016-01-13 14:00:41 -08:00
Dave Halter
dc23f0b859 Merge pull request #501 from kashiro/fix/auto-selected-last-opt
check "noselect" and "noinsert" before <C-p>
2015-11-19 13:15:06 +01:00
Tomoyuki Kashiro
217e56d9bd check "noselect" and "noinsert" before <C-p>
to prevent from selecting last option check "noselect" and "noinsert" before <C-p>
  @see https://github.com/Shougo/neocomplete.vim/blob/master/doc/neocomplete.txt#L1817-L1826
2015-11-19 18:49:15 +09:00
Jacob Niehus
0c2831d9a6 Fix parameters missing from command line call signatures
Parameters (or ellipsis) should show up in call signatures even when the
index of the current argument is unknown.

Closes https://github.com/davidhalter/jedi-vim/pull/499.
2015-11-12 02:03:46 +01:00
Dave Halter
b3e91e8de2 Merge pull request #497 from wilywampa/buffer_autocmds
Fix signatures only working in a single buffer
2015-11-07 21:15:14 +01:00
Jacob Niehus
13a4a0c0c4 Fix signatures only working in a single buffer 2015-11-07 11:43:56 -07:00
Jacob Niehus
2cf1d42fff Fix handling of temporary tags file on Windows
Fixes https://github.com/davidhalter/jedi-vim/issues/482.
Closes https://github.com/davidhalter/jedi-vim/pull/489.
2015-11-02 01:04:16 +01:00
Bagrat Aznauryan
84f5cd92c7 Use escape_file_path in new_buffer
Fix: If a definition file path contains a space, the "open in split"
     fails with an error.

Fixes https://github.com/davidhalter/jedi-vim/issues/491.
Closes https://github.com/davidhalter/jedi-vim/issues/492.
2015-11-02 01:02:22 +01:00
Daniel Hahler
9af06424fb doc/jedi-vim.txt: retab with expandtab
Fixes https://github.com/davidhalter/jedi-vim/issues/437.
Closes https://github.com/davidhalter/jedi-vim/pull/487.
2015-10-26 23:53:55 +01:00
Jacob Niehus
4b32847110 Fix issues with wildignore and tag stack
Closes https://github.com/davidhalter/jedi-vim/pull/483.
Fixes https://github.com/davidhalter/jedi-vim/issues/482.
2015-10-23 00:31:28 +02:00
Daniel Hahler
a5be01fb0b Merge pull request #481 from blueyed/improve-taglist-hack
Improve use_tag_stack-hack: use context managers, short 'tags'
2015-10-19 23:47:00 +02:00
Daniel Hahler
267df8b3da Improve use_tag_stack-hack: use context managers, short 'tags'
Use a NamedTemporaryFile context manager, which removes the temporary
file again, and use it as the only entry for the 'tags' setting to
improve lookup performance.
2015-10-19 18:29:54 +02:00
Daniel Hahler
005cb5225f Use string.ascii_lowercase instead of string.lowercase
Fixes https://github.com/davidhalter/jedi-vim/issues/478.
Closes https://github.com/davidhalter/jedi-vim/pull/480.
2015-10-18 22:14:31 +02:00
Dave Halter
95d8eb1b08 Merge pull request #479 from blueyed/fix-cached-signature-call
Handle parenthesis with show_call_signatures' cache
2015-10-18 21:45:18 +02:00
Daniel Hahler
431a0b11e5 Handle parenthesis with show_call_signatures' cache
After `o`, call signatures should show up after `abs(`.
2015-10-18 21:22:11 +02:00
Daniel Hahler
9a258c74f5 Merge branch 'wilywampa-callsig_columns'
Truncate command line call signature as described in #474 when the full
signature is too long to display.

Closes https://github.com/davidhalter/jedi-vim/issues/474.
Closes https://github.com/davidhalter/jedi-vim/pull/475.
2015-10-18 21:16:48 +02:00
Daniel Hahler
5c868b9a1f Use utf8 ellipsis char instead of 3 dots 2015-10-18 21:16:37 +02:00
Jacob Niehus
62c423bf29 Add test case for truncation of cmdline signatures 2015-10-18 21:16:37 +02:00
Jacob Niehus
7abc3ad8d4 Truncate long command line call signatures 2015-10-18 21:16:37 +02:00
Jacob Niehus
9633044332 Allow fewer columns in call signatures if 'ruler' is set 2015-10-18 21:16:37 +02:00
Dave Halter
067ab1ea4b Merge pull request #477 from blueyed/fix-cached-signature-call
Invalidate `show_call_signatures_delay` on InsertEnter
2015-10-18 21:01:37 +02:00
Daniel Hahler
e38981fc4f Invalidate show_call_signatures_delay on InsertEnter
Followup to e241cf87fd.
Ref: https://github.com/davidhalter/jedi-vim/pull/420.
Ref: https://github.com/davidhalter/jedi-vim/pull/475#issuecomment-149013542.
2015-10-18 16:07:09 +02:00
Dave Halter
8ee4e12d3e Merge pull request #458 from wilywampa/goto_tagstack
Add g:jedi#use_tag_stack feature for jedi#goto()
2015-10-18 11:51:11 +02:00
Jacob Niehus
b38ec94646 Improve documentation of use_tag_stack option 2015-10-16 12:55:40 -07:00
Jacob Niehus
9c235c79ac Fix hidden check again 2015-10-16 12:55:40 -07:00
Jacob Niehus
8cfa121b4d Fix using tabs/splits instead of buffers 2015-10-16 12:55:40 -07:00
Jacob Niehus
c94fe6fcee Check if buffer can be hidden before tjump 2015-10-16 12:55:40 -07:00
Jacob Niehus
5041224c13 Use vim tempname() instead of Python tempfile 2015-10-16 12:55:40 -07:00
Jacob Niehus
4867831ad0 Add g:jedi#use_tag_stack feature for jedi#goto() 2015-10-16 12:55:40 -07:00
Dave Halter
610cbcacb7 Merge pull request #436 from blueyed/delayed-call-signatures
Delayed call signatures
2015-10-14 15:05:58 +02:00
Dave Halter
b5ec9ac3ed Merge pull request #472 from blueyed/CONTRIBUTING.md-debug-info
CONTRIBUTING.md: request :version and :JediDebugInfo output
2015-10-09 00:23:21 +02:00
Daniel Hahler
253eb5102c CONTRIBUTING.md: request :version and :JediDebugInfo output
Also add sections, and fix style instructions.

[ci skip]
2015-10-08 17:30:35 +02:00
Daniel Hahler
9ec2fb44b0 smart_auto_mappings: look for from only at the start of a line
Fixes https://github.com/davidhalter/jedi-vim/issues/469.
Closes https://github.com/davidhalter/jedi-vim/pull/470.
2015-10-06 01:44:26 +02:00
Daniel Hahler
e241cf87fd Conditionally skip calls to jedi_vim.show_call_signatures
Skip calls to `jedi_vim.show_call_signatures` if the (position of the) current
function's argument did not change (by means of comma positions before
and after the cursor).

Ref: https://github.com/davidhalter/jedi-vim/pull/420
2015-10-03 15:43:39 +02:00
Dave Halter
525524b5cf Merge pull request #464 from itchyny/fix-global-env-pollution
make `key` and `val` script local
2015-09-28 00:49:33 +02:00
itchyny
267f66755d make key and val script local 2015-09-28 07:02:30 +09:00
Daniel Hahler
6b96313930 Add show_call_signatures_delay option
This will use CursorHoldI instead of CursorMovedI for displaying call
signatures, with a delay of 500ms by default.

This greatly enhances the experience with slow call signatures while typing
(depending on how fast Jedi is for the given context).
2015-09-10 11:55:04 +02:00
Daniel Hahler
afc02a3621 Wrap jedi#configure_call_signatures in augroup 2015-09-10 11:55:03 +02:00
Dave Halter
bcf24529fa Merge pull request #461 from blueyed/importerror-with-no_jedi_warning
Pass ImportError to no_jedi_warning and display it there
2015-09-08 16:42:38 +02:00
Daniel Hahler
676b37812b Pass ImportError to no_jedi_warning and display it there
Ref: https://github.com/davidhalter/jedi-vim/issues/460
2015-09-08 14:33:40 +02:00
Daniel Hahler
0d52b56a72 Merge pull request #455 from blueyed/add-reinit_python
Add jedi#reinit_python
2015-08-20 23:38:13 +02:00
Dave Halter
45c0b91c5e Merge pull request #456 from blueyed/add-debug-info
Add JediDebugInfo command: display used Python version
2015-08-20 10:32:38 +02:00
Dave Halter
261261af3d Merge pull request #457 from blueyed/warn-auto-nvim-not-available
nvim: add a warning in case the auto-detected version is not functional
2015-08-20 10:28:57 +02:00
Daniel Hahler
3f259c2a9e Followup to 0703494: use <silent> with <C-R> mapping
Without this, the mapping/function will be displayed on Vim's cmdline.
2015-08-20 00:07:27 +02:00
Daniel Hahler
83e62d56ba Add jedi#reinit_python
This is meant to be used in case you want to re-init the Python version
used by jedi-vim, without restarting Vim.

I had this laying around.. it might be better to just export
`s:init_python` as `jedi#init_python`?!
2015-08-19 23:58:47 +02:00
Daniel Hahler
ed09c7c1af Add JediDebugInfo command: display used Python version
This command is meant to come in handy to debug problems with jedi-vim.
For now, it will display the Python version that jedi-vim is using.
2015-08-19 23:57:29 +02:00
Daniel Hahler
2fbcc5b991 nvim: add a warning in case the auto-detected version is not functional
This usually means that the `neovim` module is not installed, which
commonly happens in a virtualenv.
2015-08-19 23:54:30 +02:00
Daniel Hahler
7890339ca8 Merge pull request #454 from davidhalter/smart-import-mapping
Smart import mapping

Closes https://github.com/davidhalter/jedi-vim/pull/453.
Closes https://github.com/davidhalter/jedi-vim/pull/454.
2015-08-19 23:46:22 +02:00
Daniel Hahler
91c2a031df Add tests for smart_auto_mappings 2015-08-19 22:37:32 +02:00
Daniel Hahler
0703494188 smart_auto_mappings: use C-r instead of expr-mapping
This makes it work in tests.  Using `<expr>` instead will not trigger
the expansion of the mapping.
This is likely a bug in vim-vspec; I have tried 1.4.1 (currently pinned)
and 1.6.1.
2015-08-19 22:37:13 +02:00
Daniel Hahler
6dedbf339e smart_auto_mappings: improve pattern 2015-08-19 22:36:23 +02:00
Daniel Hahler
889feae117 jedi#smart_auto_mappings: always 'popup_on_dot'
`popup_on_dot=1` means that it should not auto-select the first entry,
which is the case for the new smart-import-mapping.
2015-08-19 22:34:52 +02:00
Ali Aliyev
ac1615c647 Smart completion after "from foo": add "import" and complete
This adds a new setting `jedi#smart_auto_mappings` (default 1).
2015-08-17 23:36:48 +02:00
Dave Halter
d3484afe20 Merge pull request #442 from maxamillion/add_fedora
Add entry for Fedora Linux vim-jedi package
2015-08-09 13:51:45 +02:00
Bohr Shaw
dc9688602c Use shellescape with system call
This properly escapes the shell argument on Windows.

`cmd.exe` would strip off the first and last quote on a command.

Closes https://github.com/davidhalter/jedi-vim/pull/443/files.
2015-07-27 02:04:21 +02:00
Daniel Hahler
ed4a8be12e Revert "Use " with the shell argument for system()"
This reverts commit 95b8dd77ba.
2015-07-27 02:04:02 +02:00
Daniel Hahler
924b4db962 Add myself to AUTHORS
According to my first contribution as of:

> commit b6bef9a
> Date:   Tue Mar 3 12:59:52 2015 +0100
2015-07-27 00:50:49 +02:00
Daisuke Suzuki
95b8dd77ba Use " with the shell argument for system()
This is required on Windows.

Closes https://github.com/davidhalter/jedi-vim/pull/441.
2015-07-27 00:49:40 +02:00
Adam Miller
2e0be9069a Add entry for Fedora Linux vim-jedi package 2015-07-23 17:20:25 -05:00
Dave Halter
b3978bc4aa Merge pull request #431 from blueyed/fix-valueerror-cmdline-callsigs
Fix ValueError with cmdline call signatures
2015-07-01 03:09:27 +02:00
Daniel Hahler
91b4332774 Fix ValueError with cmdline call signatures
Commit 8016665 escaped the newlines in `text`, which requires to use the
escaped version with `text.index` and `len`, too.

This fixes the following error:

    Traceback (most recent call last):
      File "…/jedi/jedi_vim.py", line 110, in wrapper
        return func(*args, **kwargs)
      File "…/jedi/jedi_vim.py", line 414, in cmdline_call_signatures
        left = text.index(params[index])
    ValueError: substring not found
2015-06-26 17:07:23 +02:00
Dave Halter
133281a021 Merge pull request #430 from blueyed/no-use_tabs_not_buffers-by-default
Use use_tabs_not_buffers=0 by default
2015-06-26 14:09:04 +02:00
Daniel Hahler
439e50e9d1 Use use_tabs_not_buffers=0 by default
Ref: https://github.com/davidhalter/jedi-vim/issues/408#issuecomment-101997691
2015-06-21 22:06:24 +02:00
Daniel Hahler
56b2268df3 Merge pull request #422 from wilywampa/winwidth
Find first column using winwidth instead of wincmds/undojoin
2015-06-08 09:24:35 +02:00
Jacob Niehus
a135f3b75b Find first column with winwidth instead of wincmds 2015-05-17 15:10:17 -07:00
Dave Halter
bce599fc9c Merge pull request #417 from blueyed/fix-rename
Fix rename behaviour with empty cword; honor b:changedtick
2015-05-14 11:05:53 +02:00
Daniel Hahler
0dd1b9fd44 Fix PEP8 style 2015-05-12 22:08:39 +02:00
Daniel Hahler
6c1719a68a Fix rename behaviour with empty cword; honor b:changedtick
Ref: https://github.com/davidhalter/jedi-vim/issues/416
2015-05-12 22:08:30 +02:00
Daniel Hahler
d79f41149f Fix wrong call of goto in do_rename
This was overseen in dd33e38.

This is the main fix for https://github.com/davidhalter/jedi-vim/issues/41.
2015-05-12 22:04:15 +02:00
Daniel Hahler
651eac91ff goto: fix return value to always be a list
Fixes https://github.com/davidhalter/jedi-vim/issues/414#issuecomment-101341260
2015-05-12 19:43:09 +02:00
Daniel Hahler
abc0c07d0f echo_highlight: escape quotes in msg 2015-05-11 13:22:21 +02:00
Dave Halter
0747189516 Merge pull request #407 from blueyed/goto-auto
Better goto functionality
2015-05-10 20:02:38 +02:00
Daniel Hahler
dd33e38631 Add auto-goto command/function
This adds g:jedi#goto_command, and uses `<Leader>d` by default for it -
the old default for `g:jedi#goto_definitions_command`, which is now
empty.

It will try `script.goto_definitions()` first, and falls back to
`script.goto_assignments()` for builtins.

Closes https://github.com/davidhalter/jedi-vim/pull/407
2015-05-10 18:07:42 +02:00
Daniel Hahler
9a13f143a8 rename: fix saving/restoring of the view
This seemed(?) to work with Python 3, but not for Python 2.  Just get a
string (instead of dict) from Vim, and re-use that as-is.

This fixes afb84a8.
2015-05-09 19:14:54 +02:00
Dave Halter
6025f59945 Dropping the dev branch. Changed the notes about using it. Fixes #406. 2015-05-04 15:36:27 +02:00
Daniel Hahler
1bf69c5844 Merge pull request #360 from wilywampa/escape_newline
Escape newlines in call signatures with show_call_signatures=2
2015-05-04 00:41:51 +02:00
Daniel Hahler
054285e2b7 rename: fix opening new windows with &shellslash (Windows)
Ref: https://github.com/davidhalter/jedi-vim/pull/364#issuecomment-98418501
2015-05-03 17:16:08 +02:00
Dave Halter
fb77981040 Merge pull request #403 from blueyed/fix-rename
Fix rename
2015-05-03 15:48:37 +02:00
Daniel Hahler
de410d9347 Merge pull request #402 from blueyed/add-max_doc_height
Add max_doc_height setting
2015-05-03 15:40:35 +02:00
Dave Halter
299c9b26d3 Merge pull request #401 from blueyed/reorder-jedi_vim
Reorder jedi_vim.py / improved error handling
2015-05-03 03:46:19 +02:00
Daniel Hahler
4d67c1a6e3 rename: refactor into do_rename, add rename_visual
This adds a visual mode map for renaming, which asks for the new name
via input().

`rename` itself could be changed to use `input()`, too - but I've left
it for now.
2015-05-02 18:51:10 +02:00
Daniel Hahler
154e2dbae3 rename: use original word's length for replacing
Ref: https://github.com/davidhalter/jedi-vim/pull/403#discussion_r29548013
2015-05-02 18:46:52 +02:00
Daniel Hahler
b9ba141069 rename: display error in case new_buffer should fail and continue
Previously it would `return`, which would not restore the previous
state.  While I am not sure that it should continue, it should at least
not return.
2015-05-02 16:42:36 +02:00
Daniel Hahler
bf281dabda rename: fix _tabnew to go to the correct window 2015-05-02 16:42:28 +02:00
Daniel Hahler
afb84a837c rename: save and restore view before/after changes 2015-05-02 16:42:04 +02:00
Daniel Hahler
7539614f09 rename: display number of affected buffers 2015-05-02 16:41:13 +02:00
Daniel Hahler
fc95545378 rename: save/restore tab/windows; not via new_buffer
Ref: https://github.com/davidhalter/jedi-vim/pull/364#discussion-diff-25785992
2015-05-02 16:38:47 +02:00
Daniel Hahler
676c558110 VimError: set self.message
`self.message` is used in `__str__`.

Without this, tracebacks end like this:

    Traceback (most recent call last):
    [...]
      File "…/vim/neobundles/jedi/jedi_vim.py", line 87, in _catch_
    exception
        raise VimError(result['exception'], result['throwpoint'], string)
    jedi_vim.VimError: <unprintable VimError object>
2015-05-02 11:51:27 +02:00
Daniel Hahler
65c06553fd Move max_doc_height default to s:default_settings 2015-05-02 10:41:31 +02:00
petobens
4095d0efef Add variable to control the height of the buffer showing documentation 2015-05-02 10:34:43 +02:00
Daniel Hahler
527562208c jedi_vim: reorder to use echo_highlight in try-import block
This uses `echo_highlight` for exceptions caused by an empty "jedi"
folder.
2015-05-02 00:44:45 +02:00
Daniel Hahler
baa2969427 minor: use 'jedi-vim' in no_jedi_warning; fix typo 'too old' 2015-05-02 00:44:37 +02:00
Daniel Hahler
dd4cb80911 Move jedi#_vim_exceptions before call to jedi#init_python
It might be used during setup, in the case of errors and needs to be
defined then already.
2015-05-02 00:44:33 +02:00
Daniel Hahler
e5038cc9fa Merge branch 'master' into dev 2015-05-01 04:46:13 +02:00
Daniel Hahler
2f06d90f95 Fix jedi#complete_opened for completeopt with "longest"
jedi#complete_opened: move <C-p> for is_popup_on_dot below "longest"
handling.

Fixes #399.
2015-05-01 04:41:33 +02:00
Dave Halter
03805f87f5 Merge pull request #397 from blueyed/select-mode-mapping
Select mode mapping for completion trigger
2015-04-30 19:22:00 +02:00
Dave Halter
c38b549a95 Merge pull request #398 from blueyed/auto-config-in-plugin
auto-config: set completeopt only if it's the default
2015-04-30 16:56:05 +02:00
Daniel Hahler
83d398bc5d auto-config: set completeopt only if it's the default
The setting is also moved from "ftplugin" to "plugin", which allows for
easier customization, e.g. via a FileType plugin.

Ref: https://github.com/davidhalter/jedi-vim/issues/374#issuecomment-97621368
2015-04-30 02:37:36 +02:00
Daniel Hahler
0f203c12b9 Add select-mode mapping for completion trigger
This deletes the selection (by going to visual mode, and "c"), and then
triggers the completion.

This is useful with e.g. UltiSnips, when you want to start completion
with an expanded snippet argument selected.

Ref: https://github.com/davidhalter/jedi-vim/pull/339#issuecomment-97612632
2015-04-30 01:53:01 +02:00
Daniel Hahler
cfb76259f1 Mapping: remap of <C-Space>: use <buffer> and map to <C-Space>
Mapping it to <C-Space> should be enough, and makes it unnecessary to
map everything twice.
2015-04-30 01:50:23 +02:00
Dave Halter
78ac52a26e Merge remote-tracking branch 'origin/dev' 2015-04-29 23:41:37 +02:00
Dave Halter
3b26cf376b Merge pull request #396 from blueyed/fix-dot-completion-dev
Fix popup-on-dot completion: use <C-p> to deselect the first entry
2015-04-29 23:20:36 +02:00
Daniel Hahler
d76c00eff4 jedi#init_python: add v:throwpoint to error message 2015-04-29 23:11:44 +02:00
Daniel Hahler
3c79979c50 Move functions used by jedi#init_python before it 2015-04-29 23:11:44 +02:00
Daniel Hahler
1837cdee1f Move Python init to top of autoloading; finish in case of error
This will not define jedi-vim's functions in case initialization failed.
2015-04-29 23:11:44 +02:00
Daniel Hahler
e43012afc8 Refactor init method: add jedi#init_python
- jedi#init_python is used to init the Python environment.
 - jedi#setup_py_version is the single point where PythonJedi is
   defined, and will configure `PythonJedi` to output an error in case
   initialization failed.
 - jedi#force_py_version_switch will throw an error when
   g:jedi#force_py_version is not handled (e.g. invalid or "auto" and
   unresolved).
 - When g:jedi#force_py_version is provided, it will be used always.
 - Use WarningMsg highlight for errors, which are centralized and
   handled through exceptions.
2015-04-29 23:11:44 +02:00
Daniel Hahler
2d74fe6c51 Use PythonJedi instead of Python as command wrapper
`:Python` is more likely to interfere with other plugins / user
commands.
2015-04-29 23:11:44 +02:00
Daniel Hahler
9779628322 Refactor 'auto' handling 2015-04-29 23:11:44 +02:00
Daniel Hahler
3497a9644e jedi#force_py_version: catch errors
This prevents the script from aborting, in case e.g. `py3file` is not
defined, but should be forced.
2015-04-29 23:11:44 +02:00
Daniel Hahler
0cd664d8f7 Drop jedi#get_force_py_version again, handle 'auto' once 2015-04-29 23:11:44 +02:00
Daniel Hahler
7784c29a59 Optimize python check for Neovim: skip has() calls 2015-04-29 23:11:43 +02:00
Daniel Hahler
8f7f07fb58 Support for force_py_version = "auto"
This will call `python` to look up its major version number.
2015-04-29 23:11:43 +02:00
Daniel Hahler
63dc0badac Fix popup-on-dot completion: use <C-p> to deselect the first entry
Without this, the <C-x><C-o> triggered by jedi-vim would cause the first
match to be inserted (and selected).  When using completopt=longest,
this was less so an issue.
2015-04-29 23:09:18 +02:00
Dave Halter
cc254432b6 Merge remote-tracking branch 'origin/dev' 2015-04-29 22:52:03 +02:00
Dave Halter
ae8a2505bc Merge branch 'master' of github.com:davidhalter/jedi-vim 2015-04-29 22:40:10 +02:00
Dave Halter
839e1b5b85 We've had some issues in running the tests with vim-vspec > 1.4.1, so we're just defaulting to that. 2015-04-29 22:39:58 +02:00
Dave Halter
27df21c7bf Merge pull request #393 from blueyed/better-builtin-error
Use `desc_with_module` in "Builtin modules cannot be displayed" error
2015-04-29 15:41:13 +02:00
Dave Halter
acdd711d84 Merge pull request #395 from blueyed/improve-tests
Improve tests: use pytest.fail
2015-04-29 15:40:40 +02:00
Dave Halter
9b11e70afe Merge pull request #394 from blueyed/no-echoerr
Use "echohl WarningMsg" instead of "echoerr" in no_jedi_warning
2015-04-29 15:39:09 +02:00
Daniel Hahler
ab04982d63 pep8 fixes; sort imports 2015-04-29 11:52:36 +02:00
Daniel Hahler
a0bb09e891 tests: use pytest.fail instead of assert False 2015-04-29 11:51:52 +02:00
Daniel Hahler
2611ea3c27 Use "echohl WarningMsg" instead of "echoerr" in no_jedi_warning
`echoerr` causes Vim to throw an error, but like the function name
indicates, this is only a warning.
2015-04-29 11:29:27 +02:00
Daniel Hahler
fe517fae74 Use desc_with_module in "Builtin modules cannot be displayed" error 2015-04-29 10:57:40 +02:00
Dave Halter
401731c98b Merge branch 'dev' of github.com:davidhalter/jedi-vim 2015-04-28 19:43:14 +02:00
Dave Halter
b78f1d74c5 Merge branch 'master' of github.com:davidhalter/jedi-vim 2015-04-28 19:42:31 +02:00
Dave Halter
2bfae0acfa Jedi 0.9.0 release. 2015-04-28 19:42:21 +02:00
Dave Halter
b7bdb5a06e Merge pull request #383 from blueyed/qf-min-height
add_goto_window: pass len of list and use min()
2015-04-08 23:52:37 +02:00
Daniel Hahler
a233d603e3 add_goto_window: pass len of list and use min()
With less than `g:jedi#quickfix_window_height` entries in quickfix list,
this now only makes the window that large, effectively saving screen
space.
2015-04-08 16:10:56 +02:00
Dave Halter
1005d1ad64 Merge pull request #382 from d7415/dev
Add Debian and Ubuntu packages to README.rst
2015-04-07 00:46:17 +02:00
Martin Stone
c22e2bcdf5 Add linux packages to docs. 2015-04-02 15:33:27 +01:00
Dave Halter
bf96f7d611 jedi#auto_vim_configuration might not have been set before loading plugin. Therefore check if it was set. 2015-04-02 16:16:17 +02:00
d7415
a120f428ff Add Debian and Ubuntu packages to README.rst 2015-04-02 12:18:35 +01:00
Dave Halter
d3fadd54c7 Simplification. 2015-03-31 02:17:33 +02:00
Dave Halter
d65c35a69d Problem with multi definitions tokenize tests. Jedi behaves different now, therefore I have disabled the tests. Once we find another example where it actually makes sense to test it, we can reenable the tests. 2015-03-31 00:54:58 +02:00
Dave Halter
f714b58300 Update the submodule to the latest Jedi module. 2015-03-31 00:50:50 +02:00
Dave Halter
e87e7db0e9 Trying to improve jedi-vim, when Jedi is not found. Fixes #263. 2015-03-30 19:11:05 +02:00
Dave Halter
cc9837dc23 Trying to fix the issue of non-disappearing call signatures, #276, #278. 2015-03-28 03:00:58 +01:00
Dave Halter
43dcc4809f Test if this helps fixing the online tests that are not working. 2015-03-27 12:25:40 +01:00
Dave Halter
620b538f34 Make the test error output more readable. 2015-03-26 15:38:45 +01:00
Dave Halter
2ee17b3be6 Correct the signatures test again. 2015-03-26 15:21:58 +01:00
Dave Halter
69160c329a Matching fat symbols (current params) in a better way. 2015-03-26 15:06:25 +01:00
Dave Halter
3071700635 Match the new longer call_signature_escape symbol better. 2015-03-26 14:59:05 +01:00
Dave Halter
075cd9ce69 call signature escape characters moved from == to =`=, because that's something way less common. 2015-03-25 16:29:06 +01:00
Dave Halter
2ba5656606 Forgot to replace the call signature character in the tests. 2015-03-25 14:57:06 +01:00
Dave Halter
d82df60392 Replace the call_signature_escape character with == (was a weird unicode character before), fixes #238. 2015-03-25 14:29:24 +01:00
Dave Halter
c9c0198467 Settin nocompatible and filetype pluin n should be part of a jedi#auto_vim_configuration check. Fixes #373. 2015-03-25 14:05:01 +01:00
Dave Halter
6dcebb4644 Remove the zt call, as discussed in #310, fixed #310. 2015-03-25 13:35:54 +01:00
Dave Halter
28497ec3a9 Merge branch 'dont-overwrite-syntax-regions' of https://github.com/blueyed/jedi-vim 2015-03-24 17:23:42 +01:00
Dave Halter
78fc26456a Merge pull request #369 from pearofducks/documentation_toggle
Set 'hide documentation' to jedi#documentation_command
2015-03-07 18:39:58 +01:00
pearofducks
55929b2713 Set 'hide documentation' to the same mapping as jedi#documentation_command - instead of K 2015-03-07 15:08:07 +01:00
Daniel Hahler
b6bef9a056 Do not overwrite/re-define pythonString syntax regions
Use `containedin` instead with `jediFunction`.
2015-03-03 13:43:16 +01:00
Dave Halter
59c98d61cf Merge pull request #363 from petobens/master
Add 'winwidth' split option
2015-02-18 13:12:52 +01:00
petobens
733ba775b0 Improve 'winwidth' split option documentation 2015-02-17 16:04:14 -03:00
petobens
b71ef1176c Add 'winwidth' split option 2015-02-15 19:11:38 -03:00
Jacob Niehus
8016665639 Escape newlines in call signatures 2015-02-08 13:59:37 -07:00
Dave Halter
bf4a8bfd5a Merge pull request #356 from hackstedt/master
wording
2015-02-07 02:36:26 +01:00
Sven
789d06b573 wording 2015-02-04 11:47:37 +01:00
Dave Halter
9eaede84b2 Merge pull request #347 from wilywampa/remove_clearsigs
Don't clear command line call signatures in completions()
2015-01-06 10:23:08 +01:00
Dave Halter
18b9f08336 Merge pull request #346 from wilywampa/callsigs_showmode
Document 'showmode' requirement for command line call signatures
2015-01-06 10:22:47 +01:00
Jacob Niehus
e3f4474dd7 Add reason for clear_call_signatures logic 2015-01-05 19:02:51 -07:00
Jacob Niehus
c5c69f0ee1 Don't clear command line call signatures in completions() 2015-01-04 20:55:52 -07:00
Jacob Niehus
74d51815a5 Document 'showmode' requirement for command line call signatures 2015-01-04 20:47:34 -07:00
Dave Halter
43d16b9966 Merge pull request #344 from louima/patch-1
Fix completion function name
2015-01-02 17:13:52 +01:00
Mathieu Louis
2bccea9b5d Fix completion function name 2015-01-02 12:15:06 +01:00
Dave Halter
05f2565dac Merge pull request #342 from wilywampa/master
Escape quotes in command line call signatures
2014-12-28 11:19:06 +01:00
Jacob Niehus
57e476c214 Escape quotes in command line call signatures 2014-12-27 22:14:50 -06:00
Dave Halter
48c9420136 Merge pull request #315 from wilywampa/master
Add option to show call signatures in command line
2014-12-19 14:14:59 +01:00
Dave Halter
a3210ce7b6 Merge pull request #337 from jochenvdv/master
Correct documention for g:jedi#auto_close_doc
2014-12-19 00:59:50 +01:00
Jochen Van de Velde
409da304b4 Correct doc for g:jedi#auto_close_doc (fixes #331) 2014-12-18 22:25:16 +01:00
Jacob Niehus
8ce612e3a6 Describe call signature options in readme 2014-12-06 14:47:45 -07:00
Jacob Niehus
f44ae4efe0 Fix autocmd error in Vim <7.3.867 2014-12-06 14:47:45 -07:00
Jacob Niehus
9ea98e2e81 Fix obscure undojoin bug 2014-12-06 14:47:45 -07:00
Jacob Niehus
fb1eaa611e Add vspec tests for cmdline call signatures 2014-12-06 14:47:45 -07:00
Jacob Niehus
e1a49790cb Remove manual width calculation and handle horizontal scroll 2014-12-06 14:47:45 -07:00
Jacob Niehus
048b9dc286 Fix autocmd outside of if statement 2014-12-06 14:47:45 -07:00
Jacob Niehus
cfd71a6b54 Add option to show call signatures in command line 2014-12-06 14:47:45 -07:00
Dave Halter
0ce1af78b2 Merge pull request #336 from davidhalter/dev
Merge the dangling dev branch stuff back into master
2014-12-06 16:10:47 +01:00
Dave Halter
3a8560ac58 Merge pull request #332 from itchyny/global-function-names
replace function names starting with g: to CamelCase (fix #326)
2014-11-30 12:06:14 +01:00
itchyny
6cc1d8c34a replace function names starting with g: to CamelCase (fix #326) 2014-11-30 10:01:04 +09:00
Dave Halter
10cd4c6cfb Merge pull request #328 from itchyny/fix-global-variables
fix global variables (fix #324)
2014-11-25 00:51:27 +01:00
Dave Halter
2a6f35a91e Merge pull request #329 from itchyny/add-scriptencoding
add scriptencoding (fix #325)
2014-11-25 00:50:24 +01:00
itchyny
d477ee6557 add scriptencoding (fix #325) 2014-11-25 08:32:26 +09:00
itchyny
4ec0edafd8 fix global variables (#fix 324) 2014-11-25 08:26:47 +09:00
Dave Halter
2192f41442 Merge pull request #327 from beaumartinez/patch-1
Use newer Vundle syntax
2014-11-18 13:53:37 +01:00
Beau
8fded9837e Use newer Vundle syntax
Vundle has deprecated the `Bundle` syntax, replacing it with `Plugin`.

I've also added the abbreviated GitHub syntax (simply `username/repo`,
no need to pass the full git URL).
2014-11-18 12:12:38 +00:00
Dave Halter
6fabdd2fab Merge pull request #319 from Alir3z4/master
Fix 404 link on jedi-vim for AUR packages
2014-10-31 19:47:07 +01:00
Alireza Savand
997220d3a5 Fix 404 link on jedi-vim for AUR packages
it has been moved to official repositories
2014-10-30 17:57:30 +04:00
Dave Halter
21efb8a0e8 Merge pull request #312 from genzj/issue-#311
Fix upstream #311
2014-10-14 13:28:56 +02:00
ZHU Jie M
1e0ae6bd35 Fix upstream #311
Use method `docstring()` instead of property `doc`
Use property `description` instead of `get_code`
2014-10-14 18:33:05 +08:00
Dave Halter
b25db7ff5d Merge pull request #305 from MadAnd/patch-1
Fix typo
2014-09-07 13:27:10 +04:30
MadAnd
a6f711fbbc Fix typo 2014-09-06 15:53:22 +03:00
Dave Halter
12e9235bfd Merge pull request #293 from matatk/dev
Documentation about the need for `+conceal`
2014-07-30 16:38:00 +04:30
Matthew Tylee Atkinson
43eaec0aee Documentation about the need for +conceal
* Make README link to the text file point to the file (not the repo)
* Replace the one 'Jedi-Vim' with 'jedi-vim' in README
* Minor grammar tweak to VIM >= 7.3 requirement in the docs
* Explain the need for `+conceal` in the docs
* Update last-changed date on first line of the docs
* Hint at the need for `+conceal` in the README
2014-07-29 23:16:50 +01:00
Dave Halter
089f9b0027 Merge pull request #273 from talha81/doc_window_reuse
Find __doc__ window if opened in current tab
2014-05-26 20:45:03 +04:30
Talha Ahmed
671b12da9a updated AUTHORS.txt 2014-05-20 23:42:12 +05:00
Talha Ahmed
e620b5bf50 fixed mismatched parenthesis :| 2014-05-14 10:49:19 +05:00
Talha Ahmed
1792fb9e1b Find __doc__ window if opened in current tab 2014-05-14 09:47:18 +05:00
Dave Halter
c32844dfec fix a few jedi-vim tests that have either broken due to the new jedi version or because they were wrong. 2014-05-05 12:17:38 +02:00
Dave Halter
4e9aa671a7 Python 3 compatibility 2014-05-05 11:56:41 +02:00
Dave Halter
61e1f46626 update jedi to jedi 0.8.0 2014-05-05 00:40:15 +02:00
Dave Halter
f8e5b8dbec update Jedi to the latest dev branch 2014-04-23 12:11:43 +02:00
Dave Halter
503fe3da67 revert to old doc property, the doc.full() call was not backwards compatible and has since been reverted within Jedi 2014-04-23 12:08:58 +02:00
Dave Halter
0f591e1283 Use stackoverflow for general usage questions. 2014-04-16 11:16:06 +02:00
Dave Halter
21192f55f4 temporary compatibility with the doc changes in Jedi 0.8 2014-03-31 12:46:54 +02:00
Dave Halter
aa1d83cf68 Merge remote-tracking branch 'origin/master' into dev 2014-03-31 12:46:14 +02:00
Dave Halter
feb7688d07 Merge pull request #260 from haconeco/master
modified mapping to :call goto_window_on_enter()
2014-03-08 13:34:00 +04:30
haconeco
5e0bf55972 Update jedi.vim 2014-03-07 22:53:09 +09:00
Dave Halter
c9bede82b6 Merge pull request #256 from justincheevers/patch-1
Add example installation command
2014-03-06 13:38:29 +04:30
justincheevers
fa08586a94 Update README.rst 2014-03-01 13:21:02 -07:00
justincheevers
bbe2861fa1 Add example installation command
It's easier if an example installation command is there for you.
2014-03-01 12:52:39 -07:00
Dave Halter
bb5c473633 get rid of the compatibility layer of jedi 2014-01-15 12:20:26 +01:00
Dave Halter
4724e18b63 new version stuff 2014-01-15 12:17:51 +01:00
Dave Halter
d9a43db019 remove unused jedi.keywords import that caused jedi-vim not to work because the file was moved internally in the Jedi package 2014-01-13 15:38:48 +01:00
Dave Halter
ce7ba53224 pep8 styling 2014-01-13 15:37:49 +01:00
Dave Halter
154d9b8295 Merge pull request #243 from toupeira/master
Fix typo in jedi-vim.txt (closes #242)
2014-01-09 07:34:56 -08:00
Markus Koller
8f1e8f62fb Update AUTHORS.txt 2014-01-09 16:00:56 +01:00
Markus Koller
ee46c28669 Fix typo in jedi-vim.txt (closes #242) 2014-01-09 11:18:25 +01:00
Dave Halter
38f966092e Merge pull request #240 from ShengYun/bugfix-wrong-sys-path-insert-with-space-paths
add expand to make paths which contains spaces work correctly
2014-01-02 11:35:34 -08:00
Sheng Yun
99a9445acb add expand to make paths which contains spaces work correctly 2014-01-02 14:26:48 +08:00
David Halter
90f0bff2de merge documentation change of #231 of @tndoan and resolve authors conflict 2013-12-23 20:49:51 +01:00
David Halter
d43768c7b5 merge master to dev 2013-12-23 20:47:20 +01:00
Dave Halter
8aa53ee576 Merge pull request #214 from gotgenes/patch-1
Fixes goto_definitions_command documentation.
2013-12-23 03:23:48 -08:00
Chris Lasher
51802fa151 Update AUTHORS.txt
Adds Chris Lasher to list of contributors.
2013-12-22 21:10:34 -08:00
Chris Lasher
1388f46137 Fixes goto_definitions_command documentation. 2013-12-22 21:09:41 -08:00
Dave Halter
57a2cc787b Merge pull request #232 from eyetracker/dev
Implemented: force python 2 or 3 with ability to switch during runtime
2013-12-15 13:48:07 -08:00
Asa Jay
b1205ce779 Load only default/forced py_version, changed names and variable type
1. Changed pycmd: renamed to py_version, changed type, resulting in
...#force_py_version = <int> (2 or 3)
2. Changed structure of initialization, changes broke functionality
(<sfile> behaviour changes inside a function)
3. Cleaned up.
2013-12-15 17:01:28 +01:00
Asa Jay
3ad63c9458 Implemented: force python 2 or 3 with ability to switch during runtime
Simultaneous python2 and python3 support, switchable during runtime
calling a function as well as setting a variable in .vimrc! Closes
issues #200 and #210 (which gave the idea for this commit, thank you
@Shtucer).
2013-12-13 20:51:24 +01:00
tndoan
3d4a594519 update my name in authors list 2013-12-12 20:43:49 +08:00
tndoan
c1ff868cb4 add the recommendation of version for Vim to enjoy the full feature of Jedi-Vim 2013-12-12 19:57:48 +08:00
Dave Halter
44b8165ba3 Merge pull request #230 from np1/master
Small error in help text
2013-12-11 09:00:17 -08:00
nagev
e324a34c69 Update jedi-vim.txt
correction in help text for jedi#goto_definitions_command
2013-12-11 15:43:18 +00:00
nagev
7b8e6bd6ed Update AUTHORS.txt 2013-12-11 15:38:35 +00:00
David Halter
485e02d3b5 Merge pull request #225 from justinmk/master
fix #223: nnoremap instead of noremap
2013-12-06 14:47:35 -08:00
Justin M. Keyes
17bfd3b276 fix #223: nnoremap instead of noremap
- mapping operator-pending-mode and selection-mode has undesirable
side-effects, and isn't actually used by jedi-vim.
- also, wrap 'for' loops in s:init() functions to avoid polluting the
global namespace ('for key in keys' assigns g:key).
2013-12-06 15:00:38 -05:00
David Halter
0d50a1caec Merge pull request #222 from ShengYun/bugfix-enclose-dot-mapping-with-completions_enabled
Disable dot mapping at initialization if completion_enable is 0
2013-12-06 11:47:05 -08:00
Sheng Yun
e8b9fcb5d1 Disable dot mapping at initialization if completion_enable is 0 2013-12-07 00:22:52 +08:00
David Halter
4e0d196e92 Merge pull request #220 from justinmk/master
fix doc tag reference
2013-12-06 02:41:12 -08:00
justinmk
493d89302a Update AUTHORS.txt 2013-12-05 20:12:14 -05:00
justinmk
bd68a98848 fix doc tag reference 2013-12-05 19:08:57 -05:00
David Halter
eceba1e675 resolve merge conflict in authors 2013-09-28 19:48:20 +04:30
David Halter
4508fc22f8 switch to the MIT license - fixes #184 2013-09-28 19:47:37 +04:30
David Halter
21ce925ccb Merge pull request #194 from inside/dev
after/ftplugin/python/jedi.vim takes care of setting the omnifunc, it's not needed in ftplugin/python/jedi.vim anymore.
2013-09-24 02:58:31 -07:00
Yann Thomas-Gerard
04c3fc9d1b Moves completion settings to the after directory 2013-09-23 13:48:06 +02:00
Yann Thomas-Gerard
a9ffcbbda9 after/ftplugin/python/jedi.vim takes care of setting the omnifunc,
it's not needed here anymore.
2013-09-20 14:29:48 +02:00
David Halter
882c5f0611 Merge pull request #193 from inside/dev
Fix issue #96
2013-09-18 07:20:18 -07:00
Yann Thomas-Gerard
7bf66ebab2 Adds myself to AUTHORS.txt 2013-09-18 11:44:17 +02:00
Yann Thomas-Gerard
20a63f6c0f Sets our own omnifunc and allows loading of the distribution's python ftplugin 2013-09-18 11:44:06 +02:00
David Halter
0ba4993d5d Merge pull request #191 from littleq0903/goto_split_support
added split support for goto action
2013-09-14 12:19:28 -07:00
LittleQ
b8269d70d4 added tests for checking other goto will perform in only one window, no other split buffer will be opened accidentially 2013-09-15 03:03:59 +08:00
LittleQ
a247e9b1c7 make sure it really opened a split window 2013-09-15 02:19:48 +08:00
LittleQ
aa56af0d9c only need to check the opening direction is correct 2013-09-15 02:06:17 +08:00
LittleQ
b8edeef966 added myself to AUTHORS.txt 2013-09-15 01:18:21 +08:00
LittleQ
2a3eaeb2dc this is better 2013-09-15 00:59:28 +08:00
LittleQ
e1cac7d3f7 updated README.rst for use_splits_not_buffers 2013-09-15 00:57:47 +08:00
LittleQ
27d35b4fc0 fixed wrong title in doc 2013-09-15 00:54:10 +08:00
LittleQ
df81a593ec generate list by keys() for join() 2013-09-15 00:48:19 +08:00
LittleQ
63162524c2 moved up the split_options 2013-09-15 00:29:56 +08:00
LittleQ
ec405fa3b2 fixed type and set default value to 1 to avoid testing error 2013-09-15 00:20:20 +08:00
LittleQ
1c24594c70 added split support for goto action 2013-09-14 23:33:40 +08:00
David Halter
45dd72b557 Merge pull request #186 from ShengYun/bugfix-set-fileencoding
force jedi.vim's fileencoding to utf-8
2013-09-09 22:43:16 -07:00
Sheng Yun
e31fcf8580 add Sheng Yun in AUTHORS.txt 2013-09-10 13:39:27 +08:00
Sheng Yun
f082e2b75a force jedi.vim's fileencoding to utf-8 2013-09-10 11:20:33 +08:00
David Halter
90d2208554 Merge pull request #183 from fuhrysteve/master
NameError: global name 'PythonToVimStr' is not defined
2013-09-08 21:59:30 -07:00
Stephen J. Fuhry
dd89f6ba6b adding self to authors 2013-09-08 14:15:22 -04:00
Stephen J. Fuhry
d1f8a91fd3 moving if to end of file 2013-09-08 14:14:19 -04:00
Stephen J. Fuhry
f405ce625a Revert "moving PythonToVimStr to before _catch_exception"
This reverts commit 320809c211.
2013-09-08 14:07:29 -04:00
Stephen J. Fuhry
320809c211 moving PythonToVimStr to before _catch_exception 2013-09-08 10:53:01 -04:00
Danilo Bargen
acfbc6850b Typo, I'm sorry :( 2013-09-08 02:25:59 +02:00
Danilo Bargen
e053a78c01 Added link to issue reference in README 2013-09-08 02:25:27 +02:00
Danilo Bargen
7939ef7298 Added notes about conflict with python-mode (refs #163) 2013-09-08 02:22:43 +02:00
David Halter
4672275d62 Merge pull request #181 from lodagro/vim74_ValueError
Catch ValueError, close #180.
2013-09-04 06:43:07 -07:00
Wouter Overmeire
ed629d5ec1 Add myself to AUTHORS.txt. 2013-09-04 10:21:12 +02:00
Wouter Overmeire
f0c46450c9 Catch ValueError, close #180. 2013-09-04 09:31:31 +02:00
David Halter
81b752f606 indentation 2013-08-28 22:38:00 +04:30
David Halter
d85413feaa add highlight defaults instead of statically defined jedi syntax, if a colorscheme exists - fixes #142 2013-08-28 22:37:22 +04:30
David Halter
b618e5b863 signatures disabled tests 2013-08-28 20:36:27 +04:30
David Halter
39eba902c4 test call signatures 2013-08-28 20:33:36 +04:30
David Halter
02a7c89a37 fix problems with error reporting 2013-08-28 20:24:49 +04:30
David Halter
c3f9f03065 failing signatures tests 2013-08-28 20:01:04 +04:30
David Halter
fe3840770a don't use the call_signatures_func 2013-08-28 20:00:35 +04:30
David Halter
48d0370387 completion tests 2013-08-28 19:44:56 +04:30
David Halter
dd426c6369 change some more complete_string details 2013-08-28 19:36:57 +04:30
David Halter
3934359666 also move popup_on_dot_string method 2013-08-28 19:01:30 +04:30
David Halter
8a385ffa54 little corrections 2013-08-28 17:48:47 +04:30
David Halter
d2106d73c6 little test for cycling 2013-08-28 17:46:12 +04:30
David Halter
36e84dd112 jedi-vim doesn't work in compatible mode 2013-08-28 17:10:26 +04:30
David Halter
87ac865919 cleanup + all commands should cycle through entries, fixes #136 2013-08-28 15:44:21 +04:30
David Halter
3ce655f428 autocomplete function simplified, #136 2013-08-28 15:42:02 +04:30
David Halter
111cca5106 move supertab info to faq 2013-08-28 11:52:47 +04:30
David Halter
63f159aa76 show a no documentation warning, fixes #164 2013-08-28 09:43:18 +04:30
David Halter
505c067c54 fix problems with relocating plugin (did it the wrong way around 2013-08-28 09:40:23 +04:30
David Halter
e534aeee4b move jedi_vim.py to main folder 2013-08-27 21:49:51 +04:30
David Halter
3154c4ab08 variable loaded_jedi doesn't exist anymore (tests) 2013-08-27 21:31:20 +04:30
David Halter
178b064821 better warning when python is not available 2013-08-27 21:30:19 +04:30
David Halter
b9154c7353 plugin is now almost empty, fixes #113 2013-08-27 21:29:45 +04:30
David Halter
eae610a88d move also the whole python initialization away from plugin.vim 2013-08-27 21:25:05 +04:30
David Halter
c1ec986732 move defaults initialization to autoload 2013-08-27 21:18:24 +04:30
David Halter
c7b3ad9e2c documentation tests 2013-08-27 20:34:26 +04:30
David Halter
c4980738bd cleanup 2013-08-27 20:28:51 +04:30
David Halter
ed3748a9b9 pyimport completions tests 2013-08-27 20:10:58 +04:30
David Halter
a83489e62a change faq typo, thanks for noticing @ Rahul Agrawal 2013-08-27 11:39:43 +04:30
David Halter
ac754b4785 add unused auto-initialization (Python is not a valid filetype) 2013-08-27 11:29:31 +04:30
David Halter
d29bd89d58 improve a warning that wasn't working 2013-08-26 20:04:58 +04:30
David Halter
fa405c2e3d add a faq section to readme, fixes #168 2013-08-25 21:00:58 +04:30
David Halter
8adc9d1eda updated authors with email addresses and added all the unmentioned contributors 2013-08-25 20:49:30 +04:30
David Halter
3a96300d65 Merge pull request #167 from zekzekus/master
fixed variable typo in deprecation function
2013-08-25 08:57:56 -07:00
Zekeriya Koc
45c34d5e93 added my name to authors file 2013-08-25 18:36:33 +03:00
Zekeriya Koc
7245dff650 fixed variable typo in deprecation function 2013-08-25 17:58:08 +03:00
David Halter
bb4d5a6504 change to the right jedi version 2013-08-24 21:43:56 +04:30
David Halter
32a1593d10 completions_enable documenation 2013-08-24 21:27:06 +04:30
David Halter
a9c654fe48 added a way to disable completions, as mentioned in #166 2013-08-24 21:22:04 +04:30
David Halter
6c9b115661 testing completion disabling 2013-08-24 21:21:00 +04:30
David Halter
9d2259a63d make it possible to disable commands 2013-08-24 21:08:03 +04:30
David Halter
11681e2aa7 typo 2013-08-24 20:51:01 +04:30
David Halter
6fa00cd548 Pyimport in now mentioned in documentation. 2013-08-24 20:50:04 +04:30
David Halter
429f402675 fix problem with opening pyimport tabs 2013-08-24 20:42:19 +04:30
David Halter
70d65d6981 try to fix travis problems 2013-08-24 20:36:47 +04:30
David Halter
3d53e26298 remove mistakes in readme 2013-08-24 20:27:43 +04:30
David Halter
89208a798e shorten settings section 2013-08-24 20:22:21 +04:30
David Halter
5d9d48b15b contributing in readme 2013-08-24 20:15:31 +04:30
David Halter
6e360a4f15 mention contributing in docs 2013-08-24 20:13:26 +04:30
David Halter
1e08c815e5 mention testing in docs 2013-08-24 20:11:12 +04:30
David Halter
4e0f5d7ab9 mention testing in README 2013-08-24 20:08:17 +04:30
David Halter
683257be6b mention features in readme 2013-08-24 20:03:40 +04:30
David Halter
bdc6a03ac2 link to jedi-vim documentation 2013-08-24 19:55:24 +04:30
David Halter
0fe47ce214 reformat docs that I messed up 2013-08-24 15:55:37 +04:30
David Halter
22149611a3 fix a problem with the quickfix window 2013-08-24 15:45:08 +04:30
David Halter
8672280054 goto definition tests for multiple results (opens quickfix window) 2013-08-24 15:43:21 +04:30
David Halter
c7c266ed29 pyimport tests 2013-08-24 14:34:34 +04:30
David Halter
2b52548b37 use safe vim.eval/vim.command if possible (better tracebacks) 2013-08-24 01:59:41 +04:30
David Halter
bdf86d53f1 finally working goto with buffers tests 2013-08-24 01:35:47 +04:30
David Halter
d9d5a329f0 good exceptions 2013-08-24 01:30:35 +04:30
David Halter
b5b31aa0e6 huge refactoring, moved new_buffer completely to python code 2013-08-23 23:38:52 +04:30
David Halter
dcf884a6ca move vim version stuff to travis config 2013-08-23 11:29:34 +04:30
David Halter
c3bea09d74 rename methods 2013-08-23 11:24:10 +04:30
David Halter
3fb703f0a7 forgot to add utils 2013-08-23 10:29:52 +04:30
David Halter
8fb8d9903c tab tests that are working with goto 2013-08-23 10:14:45 +04:30
David Halter
592d19f29e tests goto tabs 2013-08-23 01:13:14 +04:30
David Halter
2991ec7d55 more completions tests 2013-08-23 00:17:05 +04:30
David Halter
10bad3310d completion tests 2013-08-23 00:02:36 +04:30
David Halter
83540e66a4 goto tests that are working 2013-08-22 23:23:46 +04:30
David Halter
eba0689bff have to add the jedi-vim directory automatically 2013-08-22 23:22:30 +04:30
David Halter
90bdf0c106 readme corrections 2013-08-22 22:19:37 +04:30
David Halter
7e116d8295 added travis badge 2013-08-22 22:17:44 +04:30
David Halter
52ff4176ed fix a few problems with conftest 2013-08-22 22:12:14 +04:30
David Halter
53137b85a7 first goto tests 2013-08-22 21:54:57 +04:30
David Halter
c6de6c3425 show vim version 2013-08-22 21:34:57 +04:30
David Halter
23d7b99f96 remove gitignore stuff that is not really being needed 2013-08-22 21:07:59 +04:30
David Halter
d1d453b891 tests should now be working 2013-08-22 21:06:34 +04:30
David Halter
c49b68a25d add .cache to gitignore 2013-08-22 21:05:53 +04:30
David Halter
b8ff144ed5 jedi-vim tests basics 2013-08-22 17:48:58 +04:30
David Halter
c8c4399d45 Remove a name conflict with show_call_signatures 2013-08-22 17:24:16 +04:30
David Halter
5993b0c599 Warning if Jedi is not installed. 2013-08-22 17:22:27 +04:30
David Halter
0b8448804d show_call_signatures shows now all call signatures if there are multiple, and not just one. 2013-08-22 17:18:25 +04:30
David Halter
59be959a3d show messages when py_import fails 2013-08-22 12:09:53 +04:30
David Halter
1247e258d0 enforce using jedi 0.7 2013-08-22 11:52:47 +04:30
David Halter
100e1ed8cd move py_import function finally to jedi_vim.py 2013-08-22 11:49:08 +04:30
David Halter
63029f5ea2 some function don't need to be in the jedi namespace 2013-08-22 11:31:44 +04:30
David Halter
c58fc7c952 moved some Pyimport stuff to autoload and added a new_buffer option 2013-08-22 11:27:38 +04:30
David Halter
748a47e6e9 Pyimport command should respect tab setting 2013-08-22 10:47:13 +04:30
David Halter
a74c3bd29a fix a few remaining name problems, that have been forgotten 2013-08-20 16:19:42 +04:30
David Halter
6ed0b78c90 deprecate a lot of old definitions how to use functions, use instead the names of jedi functions 2013-08-20 16:17:39 +04:30
David Halter
99b53f200f update jedi-vim doc with new functions 2013-08-20 16:16:29 +04:30
David Halter
9f683c4cbf update README with new functions 2013-08-20 16:16:15 +04:30
David Halter
6ee05f976d use call_signature_escape instead of the old function_definition_escape, to be compatible with jedi 2013-08-20 15:13:55 +04:30
David Halter
bba9682197 call_signatures instead of function_definition 2013-08-20 15:07:32 +04:30
David Halter
00814ef58d completions instead of complete 2013-08-20 15:01:09 +04:30
David Halter
e01eadb9ed automatically initialize filetype plugin on 2013-08-19 15:27:40 +04:30
David Halter
7c1aa736ff jedi version upgrade: 0.7.0 2013-08-18 20:49:14 +04:30
David Halter
e93976ad44 fix position of call defs cursor 2013-08-18 20:47:04 +04:30
David Halter
6028e0d379 builtin modules cannot be displayed, but show the path where they are located 2013-08-07 10:59:23 +04:30
David Halter
cf6551f17e Merge remote-tracking branch 'origin/master' into dev 2013-08-07 10:37:31 +04:30
David Halter
33b58d894c removed an old description 2013-08-05 16:40:48 +04:30
David Halter
be4039995a changed contributing 2013-08-05 16:40:30 +04:30
David Halter
64aeebb12b Merge branch 'dev' of github.com:davidhalter/jedi-vim into dev 2013-08-05 16:33:17 +04:30
David Halter
5e5d308348 remove a deprecated line 2013-08-05 16:32:37 +04:30
Danilo Bargen
ddad7b8a90 Merge pull request #157 from twymer/patch-2
Update README.rst
2013-07-30 12:58:39 -07:00
Tyler Wymer
bbebff8a21 Update README.rst
Correct documentation link text
2013-07-30 15:08:39 -04:00
David Halter
380ab946e5 Merge pull request #149 from gpoulin/lookuperror
Modify IndexError to LookupError in tabnew
2013-07-04 09:29:22 -07:00
Guillaume Poulin
ca50a02a86 Modify IndexError to LookupError in tabnew 2013-07-03 02:57:55 +08:00
David Halter
26492d1d32 Merge pull request #147 from rogererens/patch-1
Update jedi-vim.txt
2013-06-25 01:32:52 -07:00
rogererens
bf62eebca4 Update jedi-vim.txt
fix github URLs for submodule commands
2013-06-25 02:54:59 +03:00
Danilo Bargen
dbafc2c0e3 Merge pull request #140 from heavenshell/fix_pep8_violation
Add whitespace after =
2013-06-03 05:14:46 -07:00
heavenshell
108cfbdd5d Add whitespace after . 2013-06-03 20:55:38 +09:00
David Halter
622331afa4 Merge pull request #138 from heavenshell/fix_deprecation_warning
Fix not to use deprecated method
2013-05-31 12:07:00 -07:00
heavenshell
9c3e9dbe03 Fix goto() deprecation. 2013-06-01 00:59:49 +09:00
heavenshell
a8422d3682 Fix get_in_function_call() deprecation. 2013-06-01 00:56:04 +09:00
heavenshell
6f107578ee Fix related_names() deprecation. 2013-06-01 00:50:02 +09:00
heavenshell
355203cab0 Fix goto() deprecation. 2013-06-01 00:47:11 +09:00
heavenshell
e4a2a0f30e Fix get_definition() deprecation. 2013-06-01 00:41:04 +09:00
heavenshell
efb1997218 Fix show_pydoc() get_definition() deprecation. 2013-06-01 00:37:15 +09:00
heavenshell
cf3182e549 Fix complete() deprecation. 2013-06-01 00:27:14 +09:00
David Halter
2cc0adcc65 Merge pull request #135 from mlmoses/fix-python3-errors
Fix errors when vim is compiled with +python3.
2013-05-19 01:06:18 -07:00
Matthew Moses
d56bf264e7 Fix some errors when vim is compiled with +python3.
When vim is compiled with `-python` and `+python3`, jedi-vim generates
errors because of two points in the code which are not compatible with
Python 3 (because of the `str`/`unicode` vs. `bytes`/`str` thing).
2013-05-19 03:41:46 -04:00
David Halter
b9fef7b969 renamed Pyedit to Pyimport, refs #117 2013-05-19 00:25:00 +04:30
David Halter
dd70fa0891 Merge branch 'dev' into newtab 2013-05-19 00:13:42 +04:30
David Halter
ccc901f360 use is_keyword instead of hack 2013-05-19 00:11:27 +04:30
David Halter
f88c11e353 Merge branch 'bugfix-newtab-syntax' of git://github.com/artnez/jedi-vim into newtab 2013-05-18 22:44:49 +04:30
David Halter
e8e1cc7d47 improve indentation of #117 2013-05-18 21:53:44 +04:30
David Halter
34bf4479d8 Merge branch 'master' of git://github.com/coot/jedi-vim into pyedit 2013-05-18 21:36:50 +04:30
David Halter
403028a50c ctrl space cycles now through results, when used multiple times, fixes #118 2013-05-18 19:55:30 +04:30
David Halter
3ae35c1ea1 add doc/tags to gitignore 2013-05-18 13:46:23 +04:30
David Halter
fcc8cf5185 new jedi version also in sub repository 2013-05-18 13:14:11 +04:30
David Halter
ab5065753e update jedi notification 2013-05-14 22:20:39 +04:30
David Halter
daa7f1c60c Merge remote-tracking branch 'origin/master' into dev 2013-05-14 22:12:54 +04:30
David Halter
42b240c366 Merge branch 'dev' of github.com:davidhalter/jedi-vim into dev 2013-05-14 22:12:17 +04:30
Danilo Bargen
211cbf1fb7 Changed jedi submodule protocol (fixes #129) 2013-04-27 17:22:11 +02:00
Danilo Bargen
001db4bfe5 Changed jedi submodule protocol (fixes #129) 2013-04-25 10:27:58 +02:00
Marcin Szamotulski
422ad483c1 g:jedi#quickfix_window_height
This commit adds an option g:jedi#quickfix_window_height, with the
    default value 10 (as this is the default value for :copen)
2013-03-17 13:47:17 +00:00
Marcin Szamotulski
165dea0a2c added :Pyedit vim command
:Pyedit [++opt] [+cmd] module

    module is a python module, there is a completion for them as well.
    [opt] and [cmd] are like for the :edit command.
2013-03-17 13:32:04 +00:00
Artem Nezvigin
5b1a253e9b Fix new tabs overriding default syntax rules
Calling `syntax on` will override existing syntax rules with default
ones. This ends up adding a bunch of syntax rules that users have
disabled.

See `:help syntax` for this snippet:

    The ":syntax enable" command will keep your current color settings. This
    allows using ":highlight" commands to set your preferred colors before or
    after using this command.  If you want Vim to overrule your settings with
    the defaults, use: `:syntax on`

Calling `:syntax enable` doesn't appear to work either. It does the same thing
as `:syntax on`. So the solution implemented here is to conditionally set the
filetype and syntax rules when they aren't already set.
2013-03-02 11:14:57 -08:00
David Halter
8c482c72db Merge pull request #108 from runiq/vimdoc
Add vimdoc help file
2013-03-01 22:26:59 -08:00
Patrice Peterson
354f8da568 Minor capitalization and awkward wording fixes
- Replace all occurences of Jedi-Vim/Jedi with jedi-vim/jedi
- Capitalize first letter on bullet points
- oh god how do i english
- Fix wrong description of g:jedi#auto_close_doc option
2013-03-02 05:17:09 +01:00
Patrice Peterson
31611335b4 Out of beta, yay 2013-03-02 04:58:47 +01:00
Patrice Peterson
a8726171bf Add license section 2013-03-01 21:11:50 +01:00
Patrice Peterson
4c0652064a Added blurb about configuration in .vimrc
I don't know if this should even be in there because it seems kind of
like a bug.
2013-03-01 20:57:04 +01:00
Patrice Peterson
0d27821064 Add usage section and goto/find_def explanation
The usage section feels sort of superfluous. I don't know. >:(

The distinction between jedi#goto() and jedi#fund_definition() was a bit
unclear, so I expanded it a bit.
2013-03-01 20:57:04 +01:00
Patrice Peterson
93e49bb888 Add install, intro, and features sections 2013-03-01 20:57:04 +01:00
Patrice Peterson
84a982ee26 Document keybindings and options
All keybindings and options have at least a short description added to
them.

With this commit the general structure of a Vim help file is in place.
2013-03-01 20:57:04 +01:00
Patrice Peterson
4bc8a44453 Cosmetic and formatting fixes
- Remove images in introduction
- Replace all occurences of VIM with Vim
- Use Vim code blocks
- Surround all keybindings with <>
2013-03-01 20:57:04 +01:00
Patrice Peterson
e6ef96412e Add vimdoc documentation
For now, this is just the README.rst file with appropriate sections. The
content of the file itself is completely unchanged.

Section name suggestions are taken from Steve Losh's Learn Vimscript the
Hard Way [1]. Formatting suggestions are taken from Vim's own
documentation on writing help files (:help help-writing).

The spiffy header was created using the figlet program [2] and the
starwars.flf font found in the figlet fonts database [3].

[1] http://learnvimscriptthehardway.stevelosh.com/chapters/54.html
[2] http://www.figlet.org
[3] http://www.figlet.org/fonts/starwars.flf
2013-03-01 20:57:04 +01:00
David Halter
c1026023f2 Merge pull request #107 from runiq/silent-dot-mappings
Silence dot completion mappings
2013-03-01 07:35:44 -08:00
Patrice Peterson
15605d77d6 Silence dot completion mappings
I find the long line that pops up in the command-line whenever I press
`.` a bit distracting, and it would potentially overwrite other useful
information displayed in there. This change silences the dot completion
commands.
2013-03-01 13:06:00 +01:00
David Halter
a763f12b4e default encoding for VIM compiled with -multibyte, fixes #100 2013-02-24 08:57:36 +04:30
David Halter
d0b0413e7b Merge branch 'dev' of github.com:davidhalter/jedi-vim into dev 2013-02-24 08:50:02 +04:30
David Halter
7d1d5bd492 Merge pull request #101 from ricobl/tabnew-drop
Improved opening file in existing or new tab.
2013-02-23 11:37:55 -08:00
Enrico
7577ddc7a7 Removed has_gui variable. 2013-02-23 16:16:59 -03:00
Enrico
61f457b666 Used tab drop only when gui is available. 2013-02-23 15:57:09 -03:00
Enrico
f9ea25ec4e Improved opening file in existing or new tab. 2013-02-22 10:48:56 -03:00
David Halter
6a4d7c40ca Merge pull request #89 from ethinx/issue80
Fix #80 "Not an editor command: Python << PYTHONEOF"
2013-02-05 02:18:20 -08:00
York Wong
ed8dcf6f5d Fix #80 "Not an editor command: Python << PYTHONEOF" 2013-02-05 17:35:45 +08:00
David Halter
c2cbe4133e Merge branch 'dev' of github.com:davidhalter/jedi-vim into dev 2013-01-25 14:28:59 +01:00
David Halter
1d14abfff8 updated AUTHORS.txt, added @mattn, @ming13, @hattya, @flupke, @lilix, @strycore, @ganwell, @todesschaf, @Tinche 2013-01-25 14:28:48 +01:00
David Halter
fdcc192def Merge pull request #83 from andviro/master
fix for #81
2013-01-25 01:37:24 -08:00
Andrew Rodionoff
d5ba11971b removed unneeded ignores 2013-01-25 13:21:03 +04:00
Andrew Rodionoff
70f4c16ae3 fixed find related names 2013-01-25 12:04:17 +04:00
David Halter
bf7a5b82bb Merge remote-tracking branch 'origin/master' into dev 2013-01-22 06:56:40 +01:00
David Halter
f2354d3700 Merge pull request #79 from ganwell/master
Selecting the first completion menu line
2013-01-21 21:56:00 -08:00
Jean-Louis Fuchs
f234bf4376 Select first line of completion popup. Improves typing flow and saves one keypress. 2013-01-21 18:08:19 +01:00
Danilo Bargen
5a5c383aa6 Added note about installation on arch 2013-01-17 14:39:32 +01:00
David Halter
2b0e66b565 set the cursor to the right position, messed that up in the previous commit, #65 2013-01-14 16:15:06 +01:00
David Halter
69e4cead81 turn syntax highlighting on again if it's turned off by renaming (possible vim bug). 2013-01-14 15:37:59 +01:00
39 changed files with 4039 additions and 781 deletions

7
.coveragerc Normal file
View File

@@ -0,0 +1,7 @@
[run]
branch = 1
# Used by/for neovim-python-client.
concurrency = greenlet
[report]
include = pythonx/jedi_*.py,test/*

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
github: [davidhalter]

44
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,44 @@
### Issue
<!--
Please describe the issue here.
If you are not using jedi-vim from Git (but e.g. from a distribution's package,
please try it with jedi-vim's Git master, too).
-->
### Steps to reproduce
<!--
Include if relevant.
Please provide steps to reproduce it here, preferably based on a minimal Vim
configuration.
You can use the following template (save it as `minimal.vimrc` in the directory
where jedi-vim is installed, `cd` into that directory, and run Vim with
`vim -u minimal.vimrc`):
```
set nocompatible
let script_dir = fnamemodify(expand('<sfile>'), ':h')
let &runtimepath .= ','.script_dir.','.script_dir.'/after'
" Put your config changes here.
" let g:jedi#show_call_signatures=1
syntax on
filetype plugin indent on
```
Please provide the `minimal.vimrc` you have used here, too.
-->
### Output of “:verbose JediDebugInfo”
<!--
Please execute `:redir @+> | silent verb JediDebugInfo | redir END` in a
Python buffer to copy debug information into your clipboard.
Then paste it here.
-->

63
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,63 @@
name: ci
on: [push, pull_request]
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//./}

10
.gitignore vendored
View File

@@ -1,2 +1,8 @@
*.swp
*.pyc
*~
*.sw?
*.py[cod]
.ropeproject
doc/tags
.pytest-cache
build
.coverage*

7
.gitmodules vendored
View File

@@ -1,3 +1,6 @@
[submodule "jedi"]
path = jedi
url = git://github.com/davidhalter/jedi.git
path = pythonx/jedi
url = https://github.com/davidhalter/jedi.git
[submodule "pythonx/parso"]
path = pythonx/parso
url = https://github.com/davidhalter/parso.git

31
.travis.yml Normal file
View File

@@ -0,0 +1,31 @@
dist: bionic
language: python
python: 3.8
env:
- ENV=test
- ENV=check
- ENV=test_coverage
install:
- |
if [ "$ENV" = "test" ]; then
pip install pytest
elif [ "$ENV" = "test_coverage" ]; then
sudo add-apt-repository ppa:neovim-ppa/stable -y
sudo apt-get update -q
sudo apt-get install neovim -y
pip install pynvim pytest-cov
pip list
nvim --version
else
vim --version
fi
script:
- make --keep-going "$ENV" BUILD_VIRTUAL_ENV=$VIRTUAL_ENV
after_script:
- |
if [ "$ENV" = "test_coverage" ]; then
coverage xml
travis_retry bash <(curl -s https://codecov.io/bash) -X fix -f coverage.xml -F py${TRAVIS_PYTHON_VERSION//./}
fi

View File

@@ -1,11 +1,61 @@
Main Authors
============
David Halter (@davidhalter)
David Halter (@davidhalter) <davidhalter88@gmail.com>
Contributors
============
Contributors (in order of contributions)
========================================
Danilo Bargen (@gwrtheyrn)
Patrice Peterson (@runiq)
tek (@tek)
heavenshell (@heavenshell) <heavenshell.jp@gmail.com>
Danilo Bargen (@dbrgn) <gezuru@gmail.com>
mattn (@mattn) <mattn.jp@gmail.com>
Enrico Batista da Luz (@ricobl) <rico.bl@gmail.com>
coot (@coot) <mszamot@gmail.com>
Artur Dryomov (@ming13) <artur.dryomov@gmail.com>
andviro (@andviro)
Jean-Louis Fuchs (@ganwell) <ganwell@fangorn.ch>
Mathieu Comandon (@strycore) <strider@strycore.com>
Nick Hurley (@todesschaf) <hurley@todesschaf.org>
gpoulin (@gpoulin)
Akinori Hattori (@hattya)
Luper Rouch (@flupke)
Matthew Moses (@mlmoses) <moses.matthewl@gmail.com>
Tyler Wymer (@twymer)
Artem Nezvigin (@artnez)
rogererens (@rogererens)
Emily Strickland (@emilyst) <mail@emily.st>
Tin Tvrtković (@Tinche) <tinchester@gmail.com>
Zekeriya Koc (@zekzekus) <zekzekus@gmail.com>
ethinx (@ethinx) <eth2net@gmail.com>
Wouter Overmeire (@lodagro) <lodagro@gmail.com>
Stephen J. Fuhry (@fuhrysteve) <fuhrysteve@gmail.com>
Sheng Yun (@ShengYun) <uewing@gmail.com>
Yann Thomas-Gérard (@inside) <inside@gmail.com>
Colin Su (@littleq0903) <littleq0903@gmail.com>
Arthur Jaron (@eyetracker)
Justin M. Keyes (@justinmk)
nagev (@np1)
Chris Lasher (@gotgenes) <chris.lasher@gmail.com>
Doan Thanh Nam (@tndoan)
Markus Koller (@toupeira)
Justin Cheevers @justincheevers
Talha Ahmed (@talha81) <talha.ahmed@gmail.com>
Matthew Tylee Atkinson (@matatk)
Pedro Ferrari (@petobens)
Daniel Hahler (@blueyed)
Dave Honneffer (@pearofducks)
Bagrat Aznauryan (@n9code)
Tomoyuki Kashiro (@kashiro)
Tommy Allen (@tweekmonster)
Mingliang (@Aulddays)
Brian Mego (@brianmego)
Stevan Milic (@stevanmilic) <stevan.milic@yahoo.com>
Konstantin Glukhov (@Konstantin-Glukhov)
Seungchan An (@SeungChan92) <dev.issea1015@gmail.com>
Thomas Blauth (@ThomasBlauth) <thomas.blauth@protonmail.com>
James Cherti (@jamescherti)
@something are github user names.

View File

@@ -1,11 +1,12 @@
Pull Requests are great (on the **dev** branch)!
# We <3 pull requests!
1. Fork the Repo on github.
2. If you are adding functionality or fixing a bug, please add a test!
3. Push to your fork and submit a **pull request to the dev branch**.
2. Add yourself to AUTHORS.txt
3. Add a test if possible.
4. Push to your fork and submit a pull request.
My **master** branch is a 100% stable (should be). I only push to it after I am
certain that things are working out. Many people are using Jedi directly from
the github master branch.
Please use PEP8 as a Python code style. For VIM, just try to style your
code similar to the jedi-vim code that is already there.
Please use Pep8 to style your code.
# Bug reports
Please include the output of `:version` and `:JediDebugInfo`.

View File

@@ -1,170 +1,21 @@
Licensed under the GNU LGPL v3 or later.
Copyright (C) 2012 David Halter <davidhalter88@gmail.com>.
The MIT License (MIT)
===============================================================================
Copyright (c) <2013> <David Halter and others, see AUTHORS.txt>
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

35
Makefile Normal file
View File

@@ -0,0 +1,35 @@
BUILD_VIRTUAL_ENV:=build/venv
test:
pytest
test_nvim:
VSPEC_VIM=nvim pytest
test_coverage: export PYTEST_ADDOPTS:=--cov pythonx --cov test --cov-report=term-missing:skip-covered
test_coverage: test_nvim
$(dir $(BUILD_VIRTUAL_ENV)):
mkdir -p $@
$(BUILD_VIRTUAL_ENV): | $(dir $(BUILD_VIRTUAL_ENV))
python -m venv $@
$(BUILD_VIRTUAL_ENV)/bin/vint: | $(BUILD_VIRTUAL_ENV)
$|/bin/python -m pip install vim-vint==0.3.21
$(BUILD_VIRTUAL_ENV)/bin/flake8: | $(BUILD_VIRTUAL_ENV)
$|/bin/python -m pip install -q flake8==3.7.8
vint: $(BUILD_VIRTUAL_ENV)/bin/vint
$(BUILD_VIRTUAL_ENV)/bin/vint after autoload ftplugin plugin
flake8: $(BUILD_VIRTUAL_ENV)/bin/flake8
$(BUILD_VIRTUAL_ENV)/bin/flake8 pythonx/jedi_*.py
check: vint flake8
clean:
rm -rf build
.PHONY: test check clean vint flake8

View File

@@ -1,13 +1,15 @@
.. image:: https://github.com/davidhalter/jedi-vim/blob/master/doc/logotype-a.svg
#################################################
jedi-vim - awesome Python autocompletion with VIM
#################################################
**now in beta testing phase**
.. image:: https://travis-ci.org/davidhalter/jedi-vim.svg?branch=master
:target: https://travis-ci.org/davidhalter/jedi-vim
:alt: Travis-CI build status
*If you have any comments or feature requests, please tell me! I really want to
know, what you think about Jedi and jedi-vim.*
jedi-vim is a is a VIM binding to the awesome autocompletion library *Jedi*.
jedi-vim is a VIM binding to the autocompletion library
`Jedi <http://github.com/davidhalter/jedi>`_.
Here are some pictures:
@@ -21,41 +23,119 @@ Display of function/class bodies, docstrings.
.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_pydoc.png
Pydoc support (with highlighting, Shift+k).
Documentation (Pydoc) support (with highlighting, Shift+k).
There is also support for goto and renaming.
Get the latest from `github <http://github.com/davidhalter/jedi-vim>`_.
You can get the Jedi library is documented
`here <http://github.com/davidhalter/jedi>`_.
Documentation
=============
Documentation is available in your vim: ``:help jedi-vim``. You can also look
it up `on github <http://github.com/davidhalter/jedi-vim/blob/master/doc/jedi-vim.txt>`_.
You can read the Jedi library documentation `here <http://jedi.readthedocs.io/en/latest/>`_.
If you want to report issues, just use the github issue tracker. In case of
questions about the software, please use `stackoverflow
<https://stackoverflow.com/questions/tagged/jedi-vim>`_ and tag your question with ``jedi-vim``.
Support
=======
Contributing
============
The Jedi library supports most of Python's core features. From decorators to
We love Pull Requests! Read the instructions in ``CONTRIBUTING.md``.
Features
========
The Jedi library understands most of Python's core features. From decorators to
generators, there is broad support.
Apart from that, jedi-vim supports the following commands
- Completion ``<C-Space>``
- Goto assignment ``<leader>g`` (typical goto function)
- Goto definition ``<leader>d`` (follow identifier as far as possible,
includes imports and statements)
- Goto (typing) stub ``<leader>s``
- Show Documentation/Pydoc ``K`` (shows a popup with assignments)
- Renaming ``<leader>r``
- Usages ``<leader>n`` (shows all the usages of a name)
- Open module, e.g. ``:Pyimport os`` (opens the ``os`` module)
Installation
============
You might want to use `pathogen <https://github.com/tpope/vim-pathogen>`_ to
install jedi in VIM. Also you need a VIM version that was compiled with
``+python``, which is typical for most distributions on Linux.
Requirements
------------
You need a VIM version that was compiled with Python 3 or later
(``+python3``). You can check this from within VIM using
``:python3 import sys; print(sys.version)``.
The first thing you need after that is an up-to-date version of Jedi. You can
either get it via ``pip install jedi`` or with ``git submodule update --init``
in your jedi-vim repository.
Manual installation
-------------------
The autocompletion can be used with <ctrl+space>, if you want it to work with
<tab> you can use `supertab <https://github.com/ervandew/supertab>`_.
You might want to use `pathogen <https://github.com/tpope/vim-pathogen>`_ or
`Vundle <https://github.com/gmarik/vundle>`_ to install jedi-vim.
The first thing you need after that is an up-to-date version of Jedi. Install
``git submodule update --init --recursive`` in your jedi-vim repository.
Example installation command using Pathogen:
.. code-block:: sh
git clone --recursive https://github.com/davidhalter/jedi-vim.git ~/.vim/bundle/jedi-vim
Example installation using Vundle:
Add the following line in your `~/.vimrc`
.. code-block:: vim
Plugin 'davidhalter/jedi-vim'
For installing Jedi, ``pip install jedi`` will also work, but you might run
into issues when working in virtual environments. Please use git submodules.
Options
=======
Installation with your distribution
-----------------------------------
On Arch Linux, you can also install jedi-vim from official repositories as
`vim-jedi <https://www.archlinux.org/packages/community/any/vim-jedi/>`__.
It is also available on
`Debian (≥8) <https://packages.debian.org/vim-python-jedi>`__ and
`Ubuntu (≥14.04) <http://packages.ubuntu.com/vim-python-jedi>`__ as
vim-python-jedi.
On Fedora Linux, it is available as
`vim-jedi <https://packages.fedoraproject.org/pkgs/vim-jedi/vim-jedi/>`__.
Please note that this version might be quite old compared to using jedi-vim
from Git.
Caveats
-------
Note that the `python-mode <https://github.com/klen/python-mode>`_ VIM plugin seems
to conflict with jedi-vim, therefore you should disable it before enabling
jedi-vim.
To enjoy the full features of jedi-vim, you should have VIM >= 7.3, compiled with
``+conceal`` (which is not the case on some platforms, including OS X). If your VIM
does not meet these requirements, the parameter recommendation list may not appear
when you type an open bracket after a function name. Please read
`the documentation <http://github.com/davidhalter/jedi-vim/blob/master/doc/jedi-vim.txt>`_
for details.
Settings
========
Jedi is by default automatically initialized. If you don't want that I suggest
you disable the auto-initialization in your ``.vimrc``:
@@ -64,37 +144,27 @@ you disable the auto-initialization in your ``.vimrc``:
let g:jedi#auto_initialization = 0
There are also some VIM options (like ``completeopt``) which are automatically
initialized, if you don't want that:
There are also some VIM options (like ``completeopt`` and key defaults) which
are automatically initialized, but you can skip this:
.. code-block:: vim
let g:jedi#auto_vim_configuration = 0
The goto is by default on <leader g>. If you want to change that:
You can make jedi-vim use tabs when going to a definition etc:
.. code-block:: vim
let g:jedi#goto_command = "<leader>g"
let g:jedi#use_tabs_not_buffers = 1
``get_definition`` is by default on <leader d>. If you want to change that:
If you are a person who likes to use VIM-splits, you might want to put this in your ``.vimrc``:
.. code-block:: vim
let g:jedi#get_definition_command = "<leader>d"
let g:jedi#use_splits_not_buffers = "left"
Showing the pydoc is by default on ``K`` If you want to change that:
.. code-block:: vim
let g:jedi#pydoc = "K"
If you are a person who likes to use VIM-buffers not tabs, you might want to
put that in your ``.vimrc``:
.. code-block:: vim
let g:jedi#use_tabs_not_buffers = 0
This options could be "left", "right", "top", "bottom" or "winwidth". It will decide the direction where the split open.
Jedi automatically starts the completion, if you type a dot, e.g. ``str.``, if
you don't want this:
@@ -103,27 +173,122 @@ you don't want this:
let g:jedi#popup_on_dot = 0
There's some support for refactoring:
Jedi selects the first line of the completion menu: for a better typing-flow
and usually saves one keypress.
.. code-block:: vim
let g:jedi#popup_select_first = 0
Jedi displays function call signatures in insert mode in real-time, highlighting
the current argument. The call signatures can be displayed as a pop-up in the
buffer (set to 1 by default (with the conceal feature), 2 otherwise),
which has the advantage of being easier to refer to (but is a hack with
many drawbacks since it changes the buffer's contents),
or in Vim's command line aligned with the function call (set to 2), which
can improve the integrity of Vim's undo history.
.. code-block:: vim
let g:jedi#show_call_signatures = "1"
Here are a few more defaults for actions, read the docs (``:help jedi-vim``) to
get more information. If you set them to ``""``, they are not assigned.
.. code-block:: vim
NOTE: subject to change!
let g:jedi#goto_command = "<leader>d"
let g:jedi#goto_assignments_command = "<leader>g"
let g:jedi#goto_stubs_command = "<leader>s"
let g:jedi#goto_definitions_command = ""
let g:jedi#documentation_command = "K"
let g:jedi#usages_command = "<leader>n"
let g:jedi#completions_command = "<C-Space>"
let g:jedi#rename_command = "<leader>r"
let g:jedi#rename_command_keep_name = "<leader>R"
And you can list all names that are related (have the same origin):
An example for setting up your project:
.. code-block:: vim
let g:jedi#related_names_command = "<leader>n"
let g:jedi#environment_path = "/usr/bin/python3.9"
If you want to change the default autocompletion command:
jedi-vim tries its best to guess your virtual env. If you want to work with a
specific virtual environment however, you can point jedi-vim towards it:
.. code-block:: vim
let g:jedi#autocompletion_command = "<C-Space>"
let g:jedi#environment_path = "venv"
By default you get a window that displays the function definition you're
currently in. If you don't want that:
Finally, if you don't want completion, but all the other features, use:
.. code-block:: vim
let g:jedi#show_function_definition = "0"
let g:jedi#completions_enabled = 0
FAQ
===
I want to use Jedi with a Python 2 Environment, but it's not listed under "Known environments"
----------------------------------------------------------------------------------------------
Starting with version 0.18.0 Jedi dropped support for Python 2.
I don't want the docstring window to popup during completion
------------------------------------------------------------
This depends on the ``completeopt`` option. Jedi initializes it in its
``ftplugin``. Add the following line to your ``.vimrc`` to disable it:
.. code-block:: vim
autocmd FileType python setlocal completeopt-=preview
I want <Tab> to do autocompletion
---------------------------------
Don't even think about changing the Jedi command to ``<Tab>``,
use `supertab <https://github.com/ervandew/supertab>`_!
The completion is too slow!
---------------------------
1. Completion of complex libraries (like Numpy) should only be slow the first
time you complete them. After that the results should be cached and very fast.
2. If it is still slow after the initial completion and you have installed the
python-mode Vim plugin, try disabling its rope mode:
.. code-block:: vim
let g:pymode_rope = 0
See issue `#163 <https://github.com/davidhalter/jedi-vim/issues/163>`__.
3. You can also use `deoplete-jedi <https://github.com/zchee/deoplete-jedi>`__
for completions, which uses Jedi, but does completions asynchronously
(requires Neovim).
It makes sense to use both jedi-vim and deoplete-jedi, but you should disable
jedi-vim's completions then:
.. code-block:: vim
let g:jedi#completions_enabled = 0
Testing
=======
jedi-vim is being tested with a combination of `vspec
<https://github.com/kana/vim-vspec>`_ and `py.test <http://pytest.org/>`_.
The tests are in the ``test`` subdirectory, you can run them calling::
py.test
The tests are automatically run with `travis
<https://travis-ci.org/davidhalter/jedi-vim>`_.

View File

@@ -0,0 +1,3 @@
if jedi#init_python() && g:jedi#auto_initialization && g:jedi#completions_enabled
call jedi#setup_completion()
endif

View File

@@ -1,34 +1,34 @@
if g:jedi#show_function_definition == 1 && has('conceal')
" conceal is normal for vim >= 7.3
let e = g:jedi#function_definition_escape
let l1 = e.'jedi=[^'.e.']*'.e.'[^'.e.']*'.e.'jedi'.e
let l2 = e.'jedi=\?[^'.e.']*'.e
exe 'syn match jediIgnore "'.l2.'" contained conceal'
setlocal conceallevel=2
syn match jediFatSymbol "*" contained conceal
syn match jediFat "\*[^*]\+\*" contained contains=jediFatSymbol
syn match jediSpace "\v[ ]+( )@=" contained
exe 'syn match jediFunction "'.l1.'" keepend extend contains=jediIgnore,jediFat,jediSpace'
hi def link jediIgnore Ignore
hi def link jediFatSymbol Ignore
hi def link jediSpace Normal
hi jediFat term=bold,underline cterm=bold,underline gui=bold,underline ctermbg=0 guibg=#555555
hi jediFunction term=NONE cterm=NONE ctermfg=6 guifg=Black gui=NONE ctermbg=0 guibg=Grey
" override defaults (add jediFunction to contains)
syn match pythonComment "#.*$" contains=pythonTodo,@Spell,jediFunction
syn region pythonString
\ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
\ contains=pythonEscape,@Spell,jediFunction
syn region pythonString
\ start=+[uU]\=\z('''\|"""\)+ end="\z1" keepend
\ contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell,jediFunction
syn region pythonRawString
\ start=+[uU]\=[rR]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
\ contains=@Spell,jediFunction
syn region pythonRawString
\ start=+[uU]\=[rR]\z('''\|"""\)+ end="\z1" keepend
\ contains=pythonSpaceError,pythonDoctest,@Spell,jediFunction
if !jedi#init_python()
finish
endif
if g:jedi#show_call_signatures > 0 && has('conceal')
" +conceal is the default for vim >= 7.3
let s:e = g:jedi#call_signature_escape
let s:full = s:e.'jedi=.\{-}'.s:e.'.\{-}'.s:e.'jedi'.s:e
let s:ignore = s:e.'jedi.\{-}'.s:e
exe 'syn match jediIgnore "'.s:ignore.'" contained conceal'
setlocal conceallevel=2
syn match jediFatSymbol "\*_\*" contained conceal
syn match jediFat "\*_\*.\{-}\*_\*" contained contains=jediFatSymbol
syn match jediSpace "\v[ ]+( )@=" contained
exe 'syn match jediFunction "'.s:full.'" keepend extend '
\ .' contains=jediIgnore,jediFat,jediSpace'
\ .' containedin=pythonComment,pythonString,pythonRawString'
unlet! s:e s:full s:ignore
hi def link jediIgnore Ignore
hi def link jediFatSymbol Ignore
hi def link jediSpace Normal
if exists('g:colors_name')
hi def link jediFunction CursorLine
hi def link jediFat TabLine
else
hi def jediFunction term=NONE cterm=NONE ctermfg=6 guifg=Black gui=NONE ctermbg=0 guibg=Grey
hi def jediFat term=bold,underline cterm=bold,underline gui=bold,underline ctermbg=0 guibg=#555555
endif
endif
hi def jediUsage cterm=reverse gui=standout

4
autoload/health/jedi.vim Normal file
View File

@@ -0,0 +1,4 @@
function! health#jedi#check() abort
call health#report_start('jedi')
silent call jedi#debug_info()
endfunction

View File

@@ -1,57 +1,442 @@
scriptencoding utf-8
" ------------------------------------------------------------------------
" Settings initialization
" ------------------------------------------------------------------------
let s:deprecations = {
\ 'get_definition_command': 'goto_definitions_command',
\ 'pydoc': 'documentation_command',
\ 'related_names_command': 'usages_command',
\ 'autocompletion_command': 'completions_command',
\ 'show_function_definition': 'show_call_signatures',
\ }
let s:default_settings = {
\ 'use_tabs_not_buffers': 0,
\ 'use_splits_not_buffers': 1,
\ 'auto_initialization': 1,
\ 'auto_vim_configuration': 1,
\ 'goto_command': "'<leader>d'",
\ 'goto_assignments_command': "'<leader>g'",
\ 'goto_definitions_command': "''",
\ 'goto_stubs_command': "'<leader>s'",
\ 'completions_command': "'<C-Space>'",
\ 'call_signatures_command': "'<leader>n'",
\ 'usages_command': "'<leader>n'",
\ 'rename_command': "'<leader>r'",
\ 'rename_command_keep_name': "'<leader>R'",
\ 'completions_enabled': 1,
\ 'popup_on_dot': 'g:jedi#completions_enabled',
\ 'documentation_command': "'K'",
\ 'show_call_signatures': has('conceal') ? 1 : 2,
\ 'show_call_signatures_delay': 500,
\ 'call_signature_escape': "'?!?'",
\ 'auto_close_doc': 1,
\ 'max_doc_height': 30,
\ 'popup_select_first': 1,
\ 'quickfix_window_height': 10,
\ 'force_py_version': "'auto'",
\ 'environment_path': "'auto'",
\ 'added_sys_path': '[]',
\ 'project_path': "'auto'",
\ 'smart_auto_mappings': 0,
\ 'case_insensitive_completion': 1,
\ 'use_tag_stack': 1
\ }
for [s:key, s:val] in items(s:deprecations)
if exists('g:jedi#'.s:key)
echom "'g:jedi#".s:key."' is deprecated. Please use 'g:jedi#".s:val."' instead. Sorry for the inconvenience."
exe 'let g:jedi#'.s:val.' = g:jedi#'.s:key
endif
endfor
for [s:key, s:val] in items(s:default_settings)
if !exists('g:jedi#'.s:key)
exe 'let g:jedi#'.s:key.' = '.s:val
endif
endfor
let s:supports_buffer_usages = has('nvim') || exists('*prop_add')
" ------------------------------------------------------------------------
" Python initialization
" ------------------------------------------------------------------------
let s:script_path = expand('<sfile>:p:h:h')
function! s:init_python() abort
" Use g:jedi#force_py_version for loading Jedi, or fall back to using
" `has()` - preferring Python 3.
if !has('python3')
throw 'jedi-vim requires Vim with support for Python 3.'
endif
call jedi#setup_python_imports()
return 1
endfunction
function! jedi#reinit_python() abort
let s:_init_python = -1
call jedi#init_python()
endfunction
" This is meant to be called with `:unsilent` (for &shortmess+=F).
function! s:display_exception() abort
let error_lines = split(v:exception, '\n')
let msg = 'Error: jedi-vim failed to initialize Python: '
\ .error_lines[0].' (in '.v:throwpoint.')'
if len(error_lines) > 1
echohl ErrorMsg
echom 'jedi-vim error: '.error_lines[0]
for line in error_lines[1:]
echom line
endfor
echohl None
let help_cmd = ':JediDebugInfo'
if exists(':checkhealth') == 2
let help_cmd .= ' / :checkhealth'
endif
let msg .= printf('. See :messages and/or %s for more information.',
\ help_cmd)
endif
redraw " Redraw to only have the main message by default.
echoerr msg
endfunction
let s:_init_python = -1
function! jedi#init_python() abort
if s:_init_python == -1
let s:_init_python = 0
try
let s:_init_python = s:init_python()
let s:_init_python = 1
catch /^jedi/
" Only catch errors from jedi-vim itself here, so that for
" unexpected Python exceptions the traceback will be shown
" (e.g. with NameError in jedi#setup_python_imports's code).
if !exists('g:jedi#squelch_py_warning')
unsilent call s:display_exception()
endif
endtry
endif
return s:_init_python
endfunction
function! jedi#setup_python_imports() abort
let g:_jedi_init_error = 0
let init_lines = [
\ 'import vim',
\ 'def _jedi_handle_exc(exc_info):',
\ ' try:',
\ ' from jedi_vim_debug import format_exc_info',
\ ' vim.vars["_jedi_init_error"] = format_exc_info(exc_info)',
\ ' except Exception:',
\ ' import traceback',
\ ' vim.vars["_jedi_init_error"] = "\\n".join(traceback.format_exception(*exc_info))',
\ 'try:',
\ ' import jedi_vim',
\ ' if hasattr(jedi_vim, "jedi_import_error"):',
\ ' _jedi_handle_exc(jedi_vim.jedi_import_error)',
\ 'except Exception as exc:',
\ ' _jedi_handle_exc(sys.exc_info())',
\ ]
exe 'python3 exec('''.escape(join(init_lines, '\n'), "'").''')'
if g:_jedi_init_error isnot 0
throw printf('jedi#setup_python_imports: %s', g:_jedi_init_error)
endif
return 1
endfunction
function! jedi#debug_info() abort
if &verbose
if &filetype !=# 'python'
echohl WarningMsg | echo 'You should run this in a buffer with filetype "python".' | echohl None
endif
endif
let spath = shellescape(s:script_path)
echo '#### Jedi-vim debug information'
echo "\n"
echo '##### jedi-vim version'
echo "\n"
echo ' - jedi-vim git version: '
echon substitute(system('git -C '.spath.' describe --tags --always --dirty'), '\v\n$', '', '')
echo ' - jedi git submodule status: '
echon substitute(system('git -C '.spath.' submodule status pythonx/jedi'), '\v\n$', '', '')
echo ' - parso git submodule status: '
echon substitute(system('git -C '.spath.' submodule status pythonx/parso'), '\v\n$', '', '')
echo "\n"
echo '##### Global Python'
echo "\n"
echo 'Using Python version 3 to access Jedi.'
let s:pythonjedi_called = 0
try
python3 import vim; vim.command('let s:pythonjedi_called = 1')
catch
echo 'Error when trying to import vim: '.v:exception
endtry
if !s:pythonjedi_called
echohl WarningMsg
echom 'python3 failed to run, likely a Python config issue.'
if exists(':checkhealth') == 2
echom 'Try :checkhealth for more information.'
endif
echohl None
else
try
python3 from jedi_vim_debug import display_debug_info
python3 display_debug_info()
catch
echohl WarningMsg
echo 'Error when running display_debug_info: '.v:exception
echohl None
endtry
endif
echo "\n"
echo '##### Settings'
echo "\n"
echo '```'
let jedi_settings = items(filter(copy(g:), "v:key =~# '\\v^jedi#'"))
let has_nondefault_settings = 0
for [k, V] in jedi_settings
exe 'let default = '.get(s:default_settings,
\ substitute(k, '\v^jedi#', '', ''), "'-'")
" vint: -ProhibitUsingUndeclaredVariable
if default !=# V
echo printf('g:%s = %s (default: %s)', k, string(V), string(default))
unlet! V " Fix variable type mismatch with Vim 7.3.
let has_nondefault_settings = 1
endif
" vint: +ProhibitUsingUndeclaredVariable
endfor
if has_nondefault_settings
echo "\n"
endif
verb set omnifunc? completeopt?
echo '```'
if &verbose
echo "\n"
echo '#### :version'
echo '```'
version
echo '```'
echo "\n"
echo '#### :messages'
echo '```'
messages
echo '```'
echo "\n"
echo '<details><summary>:scriptnames</summary>'
echo "\n"
echo '```'
scriptnames
echo '```'
echo '</details>'
endif
endfunction
" Helper function instead of `python vim.eval()`, and `.command()` because
" these also return error definitions.
function! jedi#_vim_exceptions(str, is_eval) abort
let l:result = {}
try
if a:is_eval
let l:result.result = eval(a:str)
else
execute a:str
let l:result.result = ''
endif
catch
let l:result.exception = v:exception
let l:result.throwpoint = v:throwpoint
endtry
return l:result
endfunction
call jedi#init_python() " Might throw an error.
" ------------------------------------------------------------------------
" functions that call python code
" ------------------------------------------------------------------------
function! jedi#goto()
Python jedi_vim.goto()
function! jedi#goto() abort
python3 jedi_vim.goto(mode="goto")
endfunction
function! jedi#get_definition()
Python jedi_vim.goto(is_definition=True)
function! jedi#goto_assignments() abort
python3 jedi_vim.goto(mode="assignment")
endfunction
function! jedi#related_names()
Python jedi_vim.goto(is_related_name=True)
function! jedi#goto_definitions() abort
python3 jedi_vim.goto(mode="definition")
endfunction
function! jedi#rename(...)
Python jedi_vim.rename()
function! jedi#goto_stubs() abort
python3 jedi_vim.goto(mode="stubs")
endfunction
function! jedi#complete(findstart, base)
Python jedi_vim.complete()
function! jedi#usages() abort
if exists('#jedi_usages#BufWinEnter')
call jedi#clear_usages()
endif
python3 jedi_vim.usages()
endfunction
if !s:supports_buffer_usages
" Hide usages in the current window.
" Only handles the current window due to matchdelete() restrictions.
function! jedi#_hide_usages_in_win() abort
let winnr = winnr()
let matchids = getwinvar(winnr, '_jedi_usages_vim_matchids', [])
function! jedi#show_func_def()
Python jedi_vim.show_func_def()
for matchid in matchids[1:]
call matchdelete(matchid)
endfor
call setwinvar(winnr, '_jedi_usages_vim_matchids', [])
" Remove the autocommands that might have triggered this function.
augroup jedi_usages
exe 'autocmd! * <buffer='.winbufnr(winnr).'>'
augroup END
unlet! b:_jedi_usages_needs_clear
endfunction
function! jedi#enable_speed_debugging()
Python jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
" Show usages for current window (Vim without textprops only).
function! jedi#_show_usages_in_win() abort
python3 jedi_vim.highlight_usages_for_vim_win()
if !exists('#jedi_usages#TextChanged#<buffer>')
augroup jedi_usages
" Unset highlights on any changes to this buffer.
" NOTE: Neovim's API handles movement of highlights, but would only
" need to clear highlights that are changed inline.
autocmd TextChanged <buffer> call jedi#_clear_buffer_usages()
" Hide usages when the buffer is removed from the window, or when
" entering insert mode (but keep them for later).
autocmd BufWinLeave,InsertEnter <buffer> call jedi#_hide_usages_in_win()
augroup END
endif
endfunction
function! jedi#enable_debugging()
Python jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)
endfunction
function! jedi#disable_debugging()
Python jedi_vim.jedi.set_debug_function(None)
endfunction
" ------------------------------------------------------------------------
" show_pydoc
" ------------------------------------------------------------------------
function! jedi#show_pydoc()
Python jedi_vim.show_pydoc()
if bufnr("__doc__") > 0
" If the __doc__ buffer is open in the current window, jump to it
silent execute "sbuffer ".bufnr("__doc__")
" Remove usages for the current buffer (and all its windows).
function! jedi#_clear_buffer_usages() abort
let bufnr = bufnr('%')
let nvim_src_ids = getbufvar(bufnr, '_jedi_usages_src_ids', [])
if !empty(nvim_src_ids)
for src_id in nvim_src_ids
" TODO: could only clear highlights below/after changed line?!
call nvim_buf_clear_highlight(bufnr, src_id, 0, -1)
endfor
else
split '__doc__'
call jedi#_hide_usages_in_win()
endif
endfunction
endif
" Remove/unset global usages.
function! jedi#clear_usages() abort
augroup jedi_usages
autocmd! BufWinEnter
autocmd! WinEnter
augroup END
if !s:supports_buffer_usages
" Vim without textprops: clear current window,
" autocommands will clean others on demand.
call jedi#_hide_usages_in_win()
" Setup autocommands to clear remaining highlights on WinEnter.
augroup jedi_usages
for b in range(1, bufnr('$'))
if getbufvar(b, '_jedi_usages_needs_clear')
exe 'autocmd WinEnter <buffer='.b.'> call jedi#_hide_usages_in_win()'
endif
endfor
augroup END
endif
python3 jedi_vim.clear_usages()
endfunction
function! jedi#rename(...) abort
python3 jedi_vim.rename()
endfunction
function! jedi#rename_visual(...) abort
python3 jedi_vim.rename_visual()
endfunction
function! jedi#rename_keep_name(...) abort
python3 jedi_vim.rename(delete_word=False)
endfunction
function! jedi#rename_visual_keep_name(...) abort
python3 jedi_vim.rename_visual(use_selected_text_as_prompt_answer=True)
endfunction
function! jedi#completions(findstart, base) abort
python3 jedi_vim.completions()
endfunction
function! jedi#enable_speed_debugging() abort
python3 jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
endfunction
function! jedi#enable_debugging() abort
python3 jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)
endfunction
function! jedi#disable_debugging() abort
python3 jedi_vim.jedi.set_debug_function(None)
endfunction
function! jedi#py_import(args) abort
python3 jedi_vim.py_import()
endfun
function! jedi#choose_environment(args) abort
python3 jedi_vim.choose_environment()
endfun
function! jedi#load_project(args) abort
python3 jedi_vim.load_project()
endfun
function! jedi#py_import_completions(argl, cmdl, pos) abort
python3 jedi_vim.py_import_completions()
endfun
function! jedi#clear_cache(bang) abort
if a:bang
python3 jedi_vim.jedi.cache.clear_time_caches(True)
else
python3 jedi_vim.jedi.cache.clear_time_caches(False)
endif
endfunction
" ------------------------------------------------------------------------
" show_documentation
" ------------------------------------------------------------------------
function! jedi#show_documentation() abort
python3 if jedi_vim.show_documentation() is None: vim.command('return')
let bn = bufnr('__doc__')
if bn > 0
let wi=index(tabpagebuflist(tabpagenr()), bn)
if wi >= 0
" If the __doc__ buffer is open in the current tab, jump to it
silent execute (wi+1).'wincmd w'
else
silent execute 'sbuffer '.bn
endif
else
split __doc__
endif
setlocal modifiable
@@ -63,80 +448,95 @@ function! jedi#show_pydoc()
setlocal nomodifiable
setlocal nomodified
setlocal filetype=rst
setlocal foldlevel=200 " do not fold in __doc__
if l:doc_lines > 30 " max lines for plugin
let l:doc_lines = 30
if l:doc_lines > g:jedi#max_doc_height " max lines for plugin
let l:doc_lines = g:jedi#max_doc_height
endif
execute "resize ".l:doc_lines
execute 'resize '.l:doc_lines
" quit comands
nnoremap <buffer> q ZQ
nnoremap <buffer> K ZQ
" highlight python code within rst
unlet! b:current_syntax
syn include @rstPythonScript syntax/python.vim
" 4 spaces
syn region rstPythonRegion start=/^\v {4}/ end=/\v^( {4}|\n)@!/ contains=@rstPythonScript
" >>> python code -> (doctests)
syn region rstPythonRegion matchgroup=pythonDoctest start=/^>>>\s*/ end=/\n/ contains=@rstPythonScript
let b:current_syntax = "rst"
if len(g:jedi#documentation_command)
execute 'nnoremap <buffer> '.g:jedi#documentation_command.' ZQ'
endif
endfunction
" ------------------------------------------------------------------------
" helper functions
" ------------------------------------------------------------------------
function! jedi#new_buffer(path)
if g:jedi#use_tabs_not_buffers
Python jedi_vim.tabnew(jedi_vim.escape_file_path(vim.eval('a:path')))
else
if !&hidden && &modified
w
endif
Python vim.command('edit ' + jedi_vim.escape_file_path(vim.eval('a:path')))
endif
endfunction
function! s:add_goto_window()
set lazyredraw
cclose
execute 'belowright copen 3'
set nolazyredraw
function! jedi#add_goto_window(for_usages, len) abort
let height = min([a:len, g:jedi#quickfix_window_height])
" Use :copen to go to the window always - the user should select an entry.
execute 'belowright copen '.height
if &filetype !=# 'qf'
echoerr printf('jedi-vim: unexpected ft with current window (%s), please report!', &filetype)
endif
if g:jedi#use_tabs_not_buffers == 1
map <buffer> <CR> :call jedi#goto_window_on_enter()<CR>
noremap <buffer> <CR> :call jedi#goto_window_on_enter()<CR>
endif
au WinLeave <buffer> q " automatically leave, if an option is chosen
redraw!
augroup jedi_goto_window
if a:for_usages
autocmd BufWinLeave <buffer> call jedi#clear_usages()
else
autocmd WinLeave <buffer> q " automatically leave, if an option is chosen
endif
augroup END
if a:for_usages && !has('nvim')
if s:supports_buffer_usages
" Setup autocommand for pending highlights with Vim's textprops.
" (cannot be added to unlisted buffers)
augroup jedi_usages
autocmd! BufWinEnter * call s:usages_for_pending_buffers()
augroup END
else
" Setup global autocommand to display any usages for a window.
" Gets removed when closing the quickfix window that displays them, or
" when clearing them (e.g. on TextChanged).
augroup jedi_usages
autocmd! BufWinEnter,WinEnter * call jedi#_show_usages_in_win()
augroup END
endif
endif
endfunction
" Highlight usages for a buffer if not done so yet (Neovim only).
function! s:usages_for_pending_buffers() abort
python3 jedi_vim._handle_pending_usages_for_buf()
endfunction
function! jedi#goto_window_on_enter()
function! jedi#goto_window_on_enter() abort
let l:list = getqflist()
let l:data = l:list[line('.') - 1]
if l:data.bufnr
" close goto_window buffer
normal ZQ
jedi#new_buffer(bufname(l:data.bufnr))
normal! ZQ
python3 jedi_vim.set_buffer(vim.eval('bufname(l:data.bufnr)'))
call cursor(l:data.lnum, l:data.col)
else
echohl WarningMsg | echo "Builtin module cannot be opened." | echohl None
echohl WarningMsg | echo 'Builtin module cannot be opened.' | echohl None
endif
endfunction
function! jedi#syn_stack()
if !exists("*synstack")
function! s:syn_stack() abort
if !exists('*synstack')
return []
endif
return map(synstack(line('.'), col('.') - 1), 'synIDattr(v:val, "name")')
return map(synstack(line('.'), col('.') - 1), "synIDattr(v:val, 'name')")
endfunc
function! jedi#do_popup_on_dot()
let highlight_groups = jedi#syn_stack()
function! jedi#do_popup_on_dot_in_highlight() abort
let highlight_groups = s:syn_stack()
for a in highlight_groups
if a == 'pythonDoctest'
if a ==# 'pythonDoctest'
return 1
endif
endfor
@@ -144,38 +544,198 @@ function! jedi#do_popup_on_dot()
for a in highlight_groups
for b in ['pythonString', 'pythonComment', 'pythonNumber']
if a == b
return 0
return 0
endif
endfor
endfor
return 1
endfunc
function! jedi#configure_function_definition()
autocmd InsertLeave <buffer> Python jedi_vim.clear_func_def()
autocmd CursorMovedI <buffer> call jedi#show_func_def()
let s:show_call_signatures_last = [0, 0, '']
function! jedi#show_call_signatures() abort
if s:_init_python == 0
return 1
endif
let [line, col] = [line('.'), col('.')]
let curline = getline(line)
let reload_signatures = 1
" Caching. On the same line only.
if line == s:show_call_signatures_last[0]
" Check if the number of special signs before or after the
" cursor has not changed since the last call, which means that the
" argument position was not changed and we can skip repainting.
let prevcol = s:show_call_signatures_last[1]
let prevline = s:show_call_signatures_last[2]
let no_special = '[^,()=]'
if substitute(curline[:col-2], no_special, '', 'g')
\ == substitute(prevline[:prevcol-2], no_special, '', 'g')
\ && substitute(curline[(col-2):], no_special, '', 'g')
\ == substitute(prevline[(prevcol-2):], no_special, '', 'g')
let reload_signatures = 0
endif
endif
let s:show_call_signatures_last = [line, col, curline]
if reload_signatures
python3 jedi_vim.show_call_signatures()
endif
endfunction
Python << PYTHONEOF
""" here we initialize the jedi stuff """
import vim
function! jedi#clear_call_signatures() abort
if s:_init_python == 0
return 1
endif
# update the system path, to include the jedi path
import sys
import os
sys.path.insert(0, os.path.join(vim.eval('expand("<sfile>:p:h:h")'), 'jedi'))
let s:show_call_signatures_last = [0, 0, '']
python3 jedi_vim.clear_call_signatures()
endfunction
# to display errors correctly
import traceback
# update the sys path to include the jedi_vim script
sys.path.insert(1, os.path.join(vim.eval('expand("<sfile>:p:h:h")'), 'plugin'))
import jedi_vim
sys.path.pop(1)
function! jedi#configure_call_signatures() abort
augroup jedi_call_signatures
autocmd! * <buffer>
if g:jedi#show_call_signatures == 2 " Command line call signatures
autocmd InsertEnter <buffer> let g:jedi#first_col = s:save_first_col()
endif
autocmd InsertEnter <buffer> let s:show_call_signatures_last = [0, 0, '']
autocmd InsertLeave <buffer> call jedi#clear_call_signatures()
if g:jedi#show_call_signatures_delay > 0
autocmd InsertEnter <buffer> let b:_jedi_orig_updatetime = &updatetime
\ | let &updatetime = g:jedi#show_call_signatures_delay
autocmd InsertLeave <buffer> if exists('b:_jedi_orig_updatetime')
\ | let &updatetime = b:_jedi_orig_updatetime
\ | unlet b:_jedi_orig_updatetime
\ | endif
autocmd CursorHoldI <buffer> call jedi#show_call_signatures()
else
autocmd CursorMovedI <buffer> call jedi#show_call_signatures()
endif
augroup END
endfunction
PYTHONEOF
"Python jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
"Python jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)
" Determine where the current window is on the screen for displaying call
" signatures in the correct column.
function! s:save_first_col() abort
if bufname('%') ==# '[Command Line]' || winnr('$') == 1
return 0
endif
let startwin = winnr()
let winwidth = winwidth(0)
if winwidth == &columns
return 0
elseif winnr('$') == 2
return startwin == 1 ? 0 : (winwidth(1) + 1)
elseif winnr('$') == 3
if startwin == 1
return 0
endif
let ww1 = winwidth(1)
let ww2 = winwidth(2)
let ww3 = winwidth(3)
if ww1 + ww2 + ww3 + 2 == &columns
if startwin == 2
return ww1 + 1
else
return ww1 + ww2 + 2
endif
elseif startwin == 2
if ww2 + ww3 + 1 == &columns
return 0
else
return ww1 + 1
endif
else " startwin == 3
if ww2 + ww3 + 1 == &columns
return ww2 + 1
else
return ww1 + 1
endif
endif
endif
return 0
endfunction
function! jedi#complete_string(autocomplete) abort
if a:autocomplete
if !(g:jedi#popup_on_dot && jedi#do_popup_on_dot_in_highlight())
return ''
endif
let s:saved_completeopt = &completeopt
set completeopt-=longest
set completeopt+=menuone
set completeopt-=menu
if &completeopt !~# 'noinsert\|noselect'
" Patch 775 introduced noinsert and noselect, previously these
" options didn't exist. Setting them in earlier versions results in
" errors (E474).
if has('patch-7.4-775')
if g:jedi#popup_select_first
set completeopt+=noinsert
else
set completeopt+=noselect
endif
else
" To pass the tests we use this, it seems to get the closest to
" the other options. I'm really not sure if this properly
" works, but VIM 7.4-775 is already pretty old, so it might not
" be a problem anymore in a few years.
set completeopt+=longest
endif
endif
elseif pumvisible()
return "\<C-n>"
endif
return "\<C-x>\<C-o>\<C-r>=jedi#complete_opened(".a:autocomplete.")\<CR>"
endfunction
function! jedi#complete_opened(autocomplete) abort
if a:autocomplete
let &completeopt = s:saved_completeopt
unlet s:saved_completeopt
elseif pumvisible() && g:jedi#popup_select_first && stridx(&completeopt, 'longest') > -1
return "\<Down>"
endif
return ''
endfunction
function! jedi#smart_auto_mappings() abort
" Auto put import statement after from module.name<space> and complete
if search('\m^\s*from\s\+[A-Za-z0-9._]\{1,50}\%#\s*$', 'bcn', line('.'))
" Enter character and start completion.
return "\<space>import \<C-r>=jedi#complete_string(1)\<CR>"
endif
return "\<space>"
endfunction
function! jedi#setup_completion() abort
" We need our own omnifunc, so this overrides the omnifunc set by
" $VIMRUNTIME/ftplugin/python.vim.
setlocal omnifunc=jedi#completions
" map ctrl+space for autocompletion
if g:jedi#completions_command ==# '<C-Space>'
" In terminals, <C-Space> sometimes equals <Nul>.
imap <buffer> <Nul> <C-Space>
smap <buffer> <Nul> <C-Space>
endif
if len(g:jedi#completions_command)
execute 'inoremap <expr> <buffer> '.g:jedi#completions_command.' jedi#complete_string(0)'
" A separate mapping for select mode: deletes and completes.
execute 'snoremap <expr> <buffer> '.g:jedi#completions_command." '\<C-g>c'.jedi#complete_string(0)"
endif
endfunction
"python3 jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
"python3 jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)
" vim: set et ts=4:

7
codecov.yml Normal file
View File

@@ -0,0 +1,7 @@
coverage:
status:
project: true
patch: true
changes: true
comment: off

594
doc/jedi-vim.txt Normal file
View File

@@ -0,0 +1,594 @@
*jedi-vim.txt* - For Vim version 7.3 - Last change: 2014/07/29
__ _______ _______ __ ____ ____ __ .___ ___.~
| | | ____|| \ | | \ \ / / | | | \/ |~
| | | |__ | .--. || | _____\ \/ / | | | \ / |~
.--. | | | __| | | | || | |______\ / | | | |\/| |~
| `--' | | |____ | '--' || | \ / | | | | | |~
\______/ |_______||_______/ |__| \__/ |__| |__| |__|~
jedi-vim - awesome Python autocompletion with Vim
==============================================================================
Contents *jedi-vim-contents*
1. Introduction |jedi-vim-introduction|
2. Installation |jedi-vim-installation|
2.0. Requirements |jedi-vim-installation-requirements|
2.1. Manually |jedi-vim-installation-manually|
2.2. Using Pathogen |jedi-vim-installation-pathogen|
2.3. Using Vundle |jedi-vim-installation-vundle|
2.4. Installing from Repositories |jedi-vim-installation-repos|
3. Supported Python features |jedi-vim-support|
4. Usage |jedi-vim-usage|
5. Mappings |jedi-vim-keybindings|
5.1. Start completion |g:jedi#completions_command|
5.2. Go to definition |g:jedi#goto_command|
5.3. Go to assignment |g:jedi#goto_assignments_command|
5.4 Go to stub |g:jedi#goto_stubs_command|
5.5. Show documentation |g:jedi#documentation_command|
5.6. Rename variables |g:jedi#rename_command|
5.7. Rename variables (Reuse name) |g:jedi#rename_command_keep_name|
5.8. Show name usages |g:jedi#usages_command|
5.9. Open module by name |:Pyimport|
6. Configuration |jedi-vim-configuration|
6.1. auto_initialization |g:jedi#auto_initialization|
6.2. auto_vim_configuration |g:jedi#auto_vim_configuration|
6.3. popup_on_dot |g:jedi#popup_on_dot|
6.4. popup_select_first |g:jedi#popup_select_first|
6.5. auto_close_doc |g:jedi#auto_close_doc|
6.6. show_call_signatures |g:jedi#show_call_signatures|
6.7. show_call_signatures_delay |g:jedi#show_call_signatures_delay|
6.8. use_tabs_not_buffers |g:jedi#use_tabs_not_buffers|
6.9. squelch_py_warning |g:jedi#squelch_py_warning|
6.10. completions_enabled |g:jedi#completions_enabled|
6.11. use_splits_not_buffers |g:jedi#use_splits_not_buffers|
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|
|b:jedi_environment_path|
6.16. added_sys_path |g:jedi#added_sys_path|
|b:jedi_added_sys_path|
6.17. case_insensitive_completion |g:jedi#case_insensitive_completion|
|b:jedi_case_insensitive_completion|
7. Testing |jedi-vim-testing|
8. Contributing |jedi-vim-contributing|
9. License |jedi-vim-license|
==============================================================================
1. Introduction *jedi-vim-introduction*
Jedi-vim is a Vim binding to the awesome Python autocompletion library
`jedi`. Among jedi's (and, therefore, jedi-vim's) features are:
- Completion for a wide array of Python features (see |jedi-vim-support|)
- Robust in dealing with syntax errors and wrong indentation
- Parses complex module/function/class structures
- Infers function arguments from Sphinx/Epydoc strings
- Doesn't execute Python code
- Supports Virtualenv
- Supports Python 2.7 and 3.4+
By leveraging this library, jedi-vim adds the following capabilities to Vim:
- Displaying function/class bodies
- "Go to definition" command
- Displaying docstrings
- Renaming and refactoring
- Looking up related names
==============================================================================
2. Installation *jedi-vim-installation*
------------------------------------------------------------------------------
2.0. Requirements *jedi-vim-installation-requirements*
First of all, jedi-vim requires Vim to be compiled with the `+python` option.
It is best if you have VIM >= 7.3, compiled with the `+conceal` option. With
older versions, you will probably not see the parameter recommendation list
for functions after typing the open bracket. Some platforms (including OS X
releases) do not ship a VIM with `+conceal`. You can check if your VIM has the
feature with >
:ver
and look for "`+conceal`" (as opposed to "`-conceal`") or >
:echo has('conceal')
which will report 0 (not included) or 1 (included). If your VIM lacks this
feature and you would like function parameter completion, you will need to
build your own VIM, or use a package for your operating system that has this
feature (such as MacVim on OS X, which also contains a console binary).
------------------------------------------------------------------------------
2.1. Installing manually *jedi-vim-installation-manually*
1. If you want to install jedi as a submodule instead, issue this command: >
git clone --recursive http://github.com/davidhalter/jedi-vim
2. Put the plugin files into their respective folders in your vim runtime
directory (usually ~/.vim). Be sure to pay attention to the directory
structure!
3. Update the Vim help tags with >
:helptags <path/to/vimruntime>/doc
------------------------------------------------------------------------------
2.2. Installing using Pathogen *jedi-vim-installation-pathogen*
Pathogen simplifies installation considerably.
1.a Clone the git repository into your bundles directory: >
git clone http://github.com/davidhalter/jedi-vim path/to/bundles/jedi-vim
1b. Again, if you want to install jedi as a submodule, use this command
instead: >
git clone --recursive http://github.com/davidhalter/jedi-vim
------------------------------------------------------------------------------
2.3. Installing using Vundle *jedi-vim-installation-vundle*
1. Vundle automatically downloads subrepositories as git submodules, so you
will automatically get the jedi library with the jedi-vim plugin. Add the
following to the Bundles section in your .vimrc file: >
Plugin 'davidhalter/jedi-vim'
2. Issue the following command in Vim: >
:PluginInstall
Help tags are generated automatically, so you should be good to go.
------------------------------------------------------------------------------
2.4. Installing from Repositories *jedi-vim-installation-repos*
Some Linux distributions have jedi-vim packages in their official
repositories. On Arch Linux, install vim-jedi. On Debian (8+) or Ubuntu
(14.04+) install vim-python-jedi.
==============================================================================
3. Supported Python features *jedi-vim-support*
The Jedi library does all the hard work behind the scenes. It understands most
Python features, among them:
- Builtins
- Multiple `return`s or `yield`s
- Tuple assignments/array indexing/dictionary indexing
- `with`-statement/exception handling
- `*args` and `**kwargs`
- Decorators, lambdas, closures
- Generators, iterators
- Some descriptors: `property`/`staticmethod`/`classmethod`
- Some magic methods: `__call__`, `__iter__`, `__next__`, `__get__`,
`__getitem__`, `__init__`
- `list.append()`, `set.add()`, `list.extend()`, etc.
- (Nested) list comprehensions and ternary expressions
- Relative `import`s
- `getattr()`/`__getattr__`/`__getattribute__`
- Function annotations (py3k feature, are being ignored at the moment, but are
parsed)
- Class decorators (py3k feature, are being ignored at the moment, but are
parsed)
- Simple/usual `sys.path` modifications
- `isinstance` checks for `if`/`while`/`assert` case, that doesn't work with
Jedi
- Stubs
- And more...
Note: This list is not necessarily up to date. For a complete list of
features, please refer to the Jedi documentation at
http://jedi.readthedocs.io.
==============================================================================
4. Usage *jedi-vim-usage*
With the default settings, autocompletion can be triggered by typing
<Ctrl-Space>. The first entry will automatically be selected, so you can press
<Return> to insert it into your code or keep typing and narrow down your
completion options. The usual <C-X><C-O> and <C-P>/<C-N> keybindings work as
well. Autocompletion is also triggered by typing a period in insert mode.
Since periods rarely occur in Python code outside of method/import lookups,
this is handy to have (but can be disabled).
When it encounters a new module, jedi might take a few seconds to parse that
module's contents. Afterwards, the contents are cached and completion will be
almost instantaneous.
==============================================================================
5. Key Bindings *jedi-vim-keybindings*
All keybindings can be mapped by setting the appropriate global option. For
example, to set the keybinding for starting omnicompletion to <C-N> instead of
<Ctrl-Space>, add the following setting to your .vimrc file: >
let g:jedi#completions_command = "<C-N>"
Note: If you have |g:jedi#auto_initialization| set to 0, you have to create
a mapping yourself by calling a function: >
" Using <C-N> for omnicompletion
inoremap <silent> <buffer> <C-N> <c-x><c-o>
" Use <localleader>r (by default <\-r>) for renaming
nnoremap <silent> <buffer> <localleader>r :call jedi#rename()<cr>
" etc.
Note: You can set commands to '', which means that they are empty and not
assigned. It's an easy way to "disable" functionality of jedi-vim.
------------------------------------------------------------------------------
5.1. `g:jedi#completions_command` *g:jedi#completions_command*
Function: n/a; see above
Default: <Ctrl-Space> Start completion
Performs autocompletion (or omnicompletion, to be precise).
Note: If you want to use <Tab> for completion, please install Supertab:
https://github.com/ervandew/supertab.
------------------------------------------------------------------------------
5.2. `g:jedi#goto_command` *g:jedi#goto_command*
Function: `jedi#goto()`
Default: <leader>d Go to definition (or assignment)
This function first tries |jedi#goto_definitions|, and falls back to
|jedi#goto_assignments| for builtin modules. It produces an error if nothing
could be found.
NOTE: this implementation is subject to change.
Ref: https://github.com/davidhalter/jedi/issues/570
This command tries to find the original definition of the function/class under
the cursor. Just like the `jedi#goto_assignments()` function, it does not work
if the definition isn't in a Python source file.
The difference between `jedi#goto_assignments()` and `jedi#goto_definitions()`
is that the latter performs recursive lookups. Take, for example, the
following module structure: >
# file1.py:
from file2 import foo
# file2.py:
from file3 import bar as foo
# file3.py
def bar():
pass
The `jedi#goto_assignments()` function will take you to the >
from file2 import foo
statement in file1.py, while the `jedi#goto_definitions()` function will take
you all the way to the >
def bar():
line in file3.py.
------------------------------------------------------------------------------
5.3. `g:jedi#goto_assignments_command` *g:jedi#goto_assignments_command*
Function: `jedi#goto_assignments()`
Default: <leader>g Go to assignment
This function finds the first definition of the function/class under the
cursor. It produces an error if the definition is not in a Python file.
------------------------------------------------------------------------------
5.4. `g:jedi#goto_stubs_command` *g:jedi#goto_stubs_command*
Function: `jedi#goto_stubs()`
Default: <leader>s Go to stub
Finds the stub of the function/class under the cursor.
------------------------------------------------------------------------------
5.5. `g:jedi#documentation_command` *g:jedi#documentation_command*
Function: `jedi#show_documentation()`
Default: <K> Show pydoc documentation
This shows the pydoc documentation for the item currently under the cursor.
The documentation is opened in a horizontally split buffer. The height of this
buffer is controlled by `g:jedi#max_doc_height` (set by default to 30).
------------------------------------------------------------------------------
5.6. `g:jedi#rename_command` *g:jedi#rename_command*
Function: `jedi#rename()`
Default: <leader>r Rename variables
Jedi-vim deletes the word currently under the cursor and puts Vim in insert
mode, where the user is expected to enter the new variable name. Upon leaving
insert mode, jedi-vim then renames all occurrences of the old variable name
with the new one. The number of performed renames is displayed in the command
line.
------------------------------------------------------------------------------
5.7. `g:jedi#rename_command_keep_name` *g:jedi#rename_command_keep_name*
Function: `jedi#rename()`
Default: <leader>R Rename variables
(This key mapping does not delete the word under the cursor)
Jedi-vim keeps the word currently under the cursor, moves the cursor to the end
of the word, and puts Vim in insert mode, where the user is expected to enter
the new variable name. Upon leaving insert mode, Jedi-vim then renames all
occurrences of the old variable name with the new one. The number of performed
renames is displayed in the command line.
------------------------------------------------------------------------------
5.8. `g:jedi#usages_command` *g:jedi#usages_command*
Function: `jedi#usages()`
Default: <leader>n Show usages of a name.
The quickfix window is populated with a list of all names which point to the
definition of the name under the cursor.
------------------------------------------------------------------------------
5.9. Open module by name *:Pyimport*
Function: `jedi#py_import(args)`
Default: :Pyimport e.g. `:Pyimport os` shows os.py in VIM.
Simulate an import and open that module in VIM.
==============================================================================
6. Configuration *jedi-vim-configuration*
Note: You currently have to set these options in your .vimrc. Setting them in
an ftplugin (e.g. ~/.vim/ftplugin/python/jedi-vim-settings.vim) will not work
because jedi-vim is not set up as an filetype plugin, but as a "regular"
plugin.
------------------------------------------------------------------------------
6.1. `g:jedi#auto_initialization` *g:jedi#auto_initialization*
Upon initialization, jedi-vim performs the following steps:
1. Set the current buffers 'omnifunc' to its own completion function
`jedi#completions`
2. Create mappings to commands specified in |jedi-vim-keybindings|
3. Call `jedi#configure_call_signatures()` if
`g:jedi#show_call_signatures` is set
You can disable the default initialization routine by setting this option to
0. Beware that you have to perform the above steps yourself, though.
Options: 0 or 1
Default: 1 (Perform automatic initialization)
------------------------------------------------------------------------------
6.2. `g:jedi#auto_vim_configuration` *g:jedi#auto_vim_configuration*
Jedi-vim sets 'completeopt' to `menuone,longest` and `popup` (for Vim version
numbers higher than 8.1.1882) respectively `preview` by default, if
'completeopt' is not changed from Vim's default.
It also remaps <Ctrl-C> to <Esc> in insert mode.
If you want to keep your own configuration, disable this setting.
Options: 0 or 1
Default: 1 (Set 'completeopt' and mapping as described above)
------------------------------------------------------------------------------
6.3. `g:jedi#popup_on_dot` *g:jedi#popup_on_dot*
Jedi-vim automatically starts completion upon typing a period in insert mode.
However, when working with large modules, this can slow down your typing flow
since you have to wait for jedi to parse the module and show the completion
menu. By disabling this setting, completion is only started when you manually
press the completion key.
You need to also have `g:jedi#completions_enabled` enabled for this.
Options: 0 or 1
Default: 1 (Start completion on typing a period)
------------------------------------------------------------------------------
6.4. `g:jedi#popup_select_first` *g:jedi#popup_select_first*
Upon starting completion, jedi-vim can automatically select the first entry
that pops up (without actually inserting it).
This leads to a better typing flow: As you type more characters, the entries
in the completion menu are narrowed down. If they are narrowed down enough,
you can just press <Return> to insert the first match.
Options: 0 or 1
Default: 1 (Automatically select first completion entry)
------------------------------------------------------------------------------
6.5. `g:jedi#auto_close_doc` *g:jedi#auto_close_doc*
When doing completion and jedi-vim shows the docstring of the currently selected
item in a preview (not a popup) window, this window is being closed after
insertion of a completion item.
Set this to 0 to leave the preview window open even after leaving insert mode.
This could be useful if you want to browse longer docstrings.
This setting is ignored if a popup instead of a preview window is used.
Options: 0 or 1
Default: 1 (Automatically close preview window upon leaving insert mode)
------------------------------------------------------------------------------
6.6. `g:jedi#show_call_signatures` *g:jedi#show_call_signatures*
Jedi-vim can display a small window detailing the arguments of the currently
completed function and highlighting the currently selected argument. This can
be disabled by setting this option to 0. Setting this option to 2 shows call
signatures in the command line instead of a popup window.
Options: 0, 1, or 2
Default: 1 (Show call signatures window)
Note: 'showmode' must be disabled for command line call signatures to be
visible.
Note: This setting is ignored if |g:jedi#auto_initialization| is set to 0. In
that case, if you want to see call signatures, you have to set it up
manually by calling a function in your configuration file: >
call jedi#configure_call_signatures()
------------------------------------------------------------------------------
6.7. `g:jedi#show_call_signatures_delay` *g:jedi#show_call_signatures_delay*
The delay to be used with |g:jedi#show_call_signatures|. If it is greater
than 0 it will use Vim's |CursorHoldI| event instead of |CursorMovedI|.
It will temporarily set Vim's |'updatetime'| option during insert mode.
Options: delay in milliseconds
Default: 500
------------------------------------------------------------------------------
6.8. `g:jedi#use_tabs_not_buffers` *g:jedi#use_tabs_not_buffers*
You can make jedi-vim open a new tab if you use the "go to", "show
definition", or "related names" commands. When you leave this at the default
(0), they open in the current window instead.
Options: 0 or 1
Default: 0 (Command output reuses current window)
------------------------------------------------------------------------------
6.9. `g:jedi#squelch_py_warning` *g:jedi#squelch_py_warning*
When Vim has not been compiled with +python, jedi-vim shows a warning to that
effect and aborts loading itself. Set this to 1 to suppress that warning.
Options: 0 or 1
Default: 0 (Warning is shown)
------------------------------------------------------------------------------
6.10. `g:jedi#completions_enabled` *g:jedi#completions_enabled*
If you don't want Jedi completion, but all the other features, you can disable
it in favor of another completion engine (that probably also uses Jedi, like
YCM).
Options: 0 or 1
Default: 1
------------------------------------------------------------------------------
6.11. `g:jedi#use_splits_not_buffers` *g:jedi#use_splits_not_buffers*
If you want to open new split for "go to", you could set this option to the
direction which you want to open a split with.
Options: top, left, right, bottom or winwidth
Default: "" (not enabled by default)
Note: with the 'winwidth' option the window is split vertically or horizontally
depending on the width of the window relative to 'textwidth'. This essentially
means that if the window is big enough it will be split vertically but if it is
small a horizontal split happens.
------------------------------------------------------------------------------
6.12. `g:jedi#force_py_version` *g:jedi#force_py_version*
If you have installed multiple Python versions, you can force the Python
version that is going to be used.
You don't have to compile VIM with multiple Python versions.
The variable can be set in the .vimrc like this to force python 2:
let g:jedi#force_py_version = 2
By default jedi loads the latest Python version installed on your system that
can be found.
This variable can be changed during runtime.
Options: 2, 2.7, 3, 3.5, 3.6, ...
Default: "auto"
------------------------------------------------------------------------------
6.13. `g:jedi#smart_auto_mappings` *g:jedi#smart_auto_mappings*
When you start typing `from module.name<space>` jedi-vim automatically
can add the "import" statement and trigger the autocompletion popup.
You can enable this using: >
let g:jedi#smart_auto_mappings = 1
<
Options: 0 or 1
Default: 0 (disabled by default)
------------------------------------------------------------------------------
6.14. `g:jedi#use_tag_stack` *g:jedi#use_tag_stack*
Write results of |jedi#goto| to a temporary file and use the |:tjump| command
to enable full |tagstack| functionality. Use of the tag stack allows
returning to the usage of a function with CTRL-T after exploring the
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*
*b: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"
The buffer-local variable `b:jedi_environment_path` can be used to override the
global variable `g:jedi#environment_path`.
Default: "auto"
------------------------------------------------------------------------------
6.16. `g:jedi#added_sys_path` *g:jedi#added_sys_path*
*b:jedi_added_sys_path*
To add extra sys_path.
The buffer-local variable `b:jedi_added_sys_path` can be used to add
additional extra sys_path.
Examples: ["../site-packages"]
Default: []
------------------------------------------------------------------------------
6.17. `g:jedi#case_insensitive_completion` *g:jedi#case_insensitive_completion*
*b:jedi_case_insensitive_completion*
0 to disable case insensitive completion.
1 to enable case insensitive completion (default).
The buffer-local variable `b:jedi_case_insensitive_completion` can be used to
override the global variable `g:jedi#case_insensitive_completion`.
Default: 1
==============================================================================
7. Testing *jedi-vim-testing*
jedi-vim is being tested with a combination of vspec
https://github.com/kana/vim-vspec and py.test http://pytest.org/.
The tests are in the test subdirectory, you can run them calling::
py.test
The tests are automatically run with `travis
<https://travis-ci.org/davidhalter/jedi-vim>`_.
==============================================================================
8. Contributing *jedi-vim-contributing*
We love Pull Requests! Read the instructions in `CONTRIBUTING.md`.
==============================================================================
9. License *jedi-vim-license*
Jedi-vim is licensed with the MIT license.
vim: textwidth=78 et filetype=help:norightleft:

140
doc/logotype-a.svg Normal file
View File

@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="897.845px" height="247.51px" viewBox="0 0 897.845 247.51" enable-background="new 0 0 897.845 247.51"
xml:space="preserve">
<g>
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="287.3965" y1="65.2686" x2="287.3965" y2="106.4546">
<stop offset="0" style="stop-color:#E27817"/>
<stop offset="0.3906" style="stop-color:#E47519"/>
<stop offset="0.7116" style="stop-color:#E96B1F"/>
<stop offset="1" style="stop-color:#F15A29"/>
</linearGradient>
<polygon fill="url(#SVGID_1_)" points="285.068,66.556 272.054,95.664 302.739,95.664 302.739,66.556 "/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="216.8877" y1="65.2686" x2="216.8877" y2="106.4546">
<stop offset="0" style="stop-color:#E27817"/>
<stop offset="0.3906" style="stop-color:#E47519"/>
<stop offset="0.7116" style="stop-color:#E96B1F"/>
<stop offset="1" style="stop-color:#F15A29"/>
</linearGradient>
<polygon fill="url(#SVGID_2_)" points="180.483,95.664 193.893,95.664 240.172,95.664 253.292,66.556 180.483,66.556 "/>
<g>
<polygon fill="#019733" points="256.464,59.293 253.603,65.696 253.593,65.696 253.197,66.592 240.172,95.7 215.738,150.321
199.788,185.978 231.676,185.978 231.676,185.969 272.071,95.7 275.634,87.737 285.089,66.592 288.355,59.293 "/>
</g>
<g>
<polygon fill="#019733" points="215.738,150.321 194.605,95.7 180.483,95.7 180.483,135.118 199.788,185.969 199.788,185.978
"/>
</g>
<path fill="#019733" d="M151.355,59.294v100.005h-28.989h-11.292v-7.972c3.644-4.232,6.749-9.936,6.749-16.218
c0-2.846-0.456-5.578-1.294-8.104h0.011l-4.274-12.151c-0.238-1.16-0.633-2.257-1.15-3.281v-0.032l-5.878-11.59
c-1.201-2.808-3.975-4.897-7.34-5.362c0.281-4.969,2.837-8.87,5.932-8.87l-3.137-1.004l3.137-3.033
c-5.01,0-9.098,5.775-9.388,13.021c-3.116,0.609-5.672,2.598-6.79,5.258l-5.723,11.271c-0.052,0.104-0.104,0.197-0.155,0.3v0.01
c-0.528,1.057-0.932,2.174-1.169,3.344l-4.232,12.079c-0.012,0.02-0.012,0.03-0.021,0.042c-0.828,2.525-1.294,5.258-1.294,8.104
c0,6.282,3.25,11.985,6.904,16.218v35.616h29.112h11.294h58.105V59.294H151.355z M86.554,117.834
c-0.673,2.019-2.442,3.252-3.954,2.744c-1.51-0.508-2.194-2.547-1.521-4.565c0.673-2.017,2.443-3.25,3.953-2.742
C86.544,113.777,87.228,115.817,86.554,117.834z M110.163,120.578c-1.51,0.508-3.27-0.726-3.954-2.744
c-0.672-2.017,0.011-4.057,1.521-4.563c1.512-0.508,3.282,0.726,3.955,2.742C112.357,118.031,111.674,120.07,110.163,120.578z"/>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="134.6348" y1="65.2686" x2="134.6348" y2="106.4546">
<stop offset="0" style="stop-color:#E27817"/>
<stop offset="0.3906" style="stop-color:#E47519"/>
<stop offset="0.7116" style="stop-color:#E96B1F"/>
<stop offset="1" style="stop-color:#F15A29"/>
</linearGradient>
<polygon fill="url(#SVGID_3_)" points="151.292,66.556 117.914,66.556 117.914,95.664 145.981,95.664 151.292,95.664
151.355,95.664 151.355,66.592 151.292,66.592 "/>
<g opacity="0.5">
<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="244.0713" y1="198.6924" x2="244.0713" y2="111.1674">
<stop offset="0" style="stop-color:#019733"/>
<stop offset="0.1363" style="stop-color:#0B732D;stop-opacity:0.8637"/>
<stop offset="0.2826" style="stop-color:#145529;stop-opacity:0.7174"/>
<stop offset="0.4366" style="stop-color:#1A3D25;stop-opacity:0.5634"/>
<stop offset="0.5997" style="stop-color:#1F2C22;stop-opacity:0.4003"/>
<stop offset="0.778" style="stop-color:#222221;stop-opacity:0.222"/>
<stop offset="1" style="stop-color:#231F20;stop-opacity:0"/>
</linearGradient>
<polygon fill="url(#SVGID_4_)" points="256.464,59.293 253.603,65.696 253.593,65.696 253.197,66.592 240.172,95.7
215.738,150.321 199.788,185.978 231.676,185.978 231.676,185.969 272.071,95.7 275.634,87.737 285.089,66.592 288.355,59.293
"/>
</g>
<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="165.9131" y1="41.1123" x2="165.9131" y2="128.6277">
<stop offset="0" style="stop-color:#019733"/>
<stop offset="0.1363" style="stop-color:#0B732D;stop-opacity:0.8637"/>
<stop offset="0.2826" style="stop-color:#145529;stop-opacity:0.7174"/>
<stop offset="0.4366" style="stop-color:#1A3D25;stop-opacity:0.5634"/>
<stop offset="0.5997" style="stop-color:#1F2C22;stop-opacity:0.4003"/>
<stop offset="0.778" style="stop-color:#222221;stop-opacity:0.222"/>
<stop offset="1" style="stop-color:#231F20;stop-opacity:0"/>
</linearGradient>
<rect x="151.355" y="59.294" opacity="0.5" fill="url(#SVGID_5_)" width="29.116" height="127.649"/>
<g opacity="0.58">
<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="198.1104" y1="83.4141" x2="198.1104" y2="154.2879">
<stop offset="0" style="stop-color:#019733"/>
<stop offset="0.0409" style="stop-color:#038E32;stop-opacity:0.9591"/>
<stop offset="0.2465" style="stop-color:#0F662B;stop-opacity:0.7535"/>
<stop offset="0.4491" style="stop-color:#184726;stop-opacity:0.5509"/>
<stop offset="0.6453" style="stop-color:#1E3123;stop-opacity:0.3547"/>
<stop offset="0.8322" style="stop-color:#222421;stop-opacity:0.1678"/>
<stop offset="1" style="stop-color:#231F20;stop-opacity:0"/>
</linearGradient>
<polygon fill="url(#SVGID_6_)" points="215.738,150.321 194.605,95.7 180.483,95.7 180.483,135.118 199.788,185.969
199.788,185.978 "/>
</g>
<linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="127.7627" y1="192.1367" x2="127.7627" y2="137.5901">
<stop offset="0" style="stop-color:#019733"/>
<stop offset="0.0409" style="stop-color:#038E32;stop-opacity:0.9591"/>
<stop offset="0.2465" style="stop-color:#0F662B;stop-opacity:0.7535"/>
<stop offset="0.4491" style="stop-color:#184726;stop-opacity:0.5509"/>
<stop offset="0.6453" style="stop-color:#1E3123;stop-opacity:0.3547"/>
<stop offset="0.8322" style="stop-color:#222421;stop-opacity:0.1678"/>
<stop offset="1" style="stop-color:#231F20;stop-opacity:0"/>
</linearGradient>
<path opacity="0.6" fill="url(#SVGID_7_)" d="M151.355,59.294v100.005h-28.989h-11.292v-7.972
c3.644-4.232,6.749-9.936,6.749-16.218c0-2.846-0.456-5.578-1.294-8.104h0.011l-4.274-12.151c-0.238-1.16-0.633-2.257-1.15-3.281
v-0.032l-5.878-11.59c-1.201-2.808-3.975-4.897-7.34-5.362c0.281-4.969,2.837-8.87,5.932-8.87l-3.137-1.004l3.137-3.033
c-5.01,0-9.098,5.775-9.388,13.021c-3.116,0.609-5.672,2.598-6.79,5.258l-5.723,11.271c-0.052,0.104-0.104,0.197-0.155,0.3v0.01
c-0.528,1.057-0.932,2.174-1.169,3.344l-4.232,12.079c-0.012,0.02-0.012,0.03-0.021,0.042c-0.828,2.525-1.294,5.258-1.294,8.104
c0,6.282,3.25,11.985,6.904,16.218v35.616h29.112h11.294h58.105V59.294H151.355z M86.554,117.834
c-0.673,2.019-2.442,3.252-3.954,2.744c-1.51-0.508-2.194-2.547-1.521-4.565c0.673-2.017,2.443-3.25,3.953-2.742
C86.544,113.777,87.228,115.817,86.554,117.834z M110.163,120.578c-1.51,0.508-3.27-0.726-3.954-2.744
c-0.672-2.017,0.011-4.057,1.521-4.563c1.512-0.508,3.282,0.726,3.955,2.742C112.357,118.031,111.674,120.07,110.163,120.578z"/>
<g opacity="0.5">
<linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="244.0713" y1="53.3584" x2="244.0713" y2="78.0277">
<stop offset="0" style="stop-color:#019733"/>
<stop offset="0.1363" style="stop-color:#0B732D;stop-opacity:0.8637"/>
<stop offset="0.2826" style="stop-color:#145529;stop-opacity:0.7174"/>
<stop offset="0.4366" style="stop-color:#1A3D25;stop-opacity:0.5634"/>
<stop offset="0.5997" style="stop-color:#1F2C22;stop-opacity:0.4003"/>
<stop offset="0.778" style="stop-color:#222221;stop-opacity:0.222"/>
<stop offset="1" style="stop-color:#231F20;stop-opacity:0"/>
</linearGradient>
<polygon fill="url(#SVGID_8_)" points="256.464,59.293 253.603,65.696 253.593,65.696 253.197,66.592 240.172,95.7
215.738,150.321 199.788,185.978 231.676,185.978 231.676,185.969 272.071,95.7 275.634,87.737 285.089,66.592 288.355,59.293
"/>
</g>
<polygon fill="#019733" points="180.483,59.198 183.329,66.556 180.471,66.556 "/>
<polygon fill="#019733" points="180.483,59.198 183.329,66.556 180.471,66.556 "/>
<g>
<polygon fill="#019733" points="290.713,66.592 285.054,66.592 288.32,59.293 "/>
<polygon fill="#019733" points="308.417,120.554 283.562,95.7 300.261,95.7 "/>
<polygon opacity="0.6" fill="#019733" points="308.417,120.554 283.562,95.7 300.261,95.7 "/>
<polygon fill="#019733" points="290.713,66.592 285.054,66.592 288.32,59.293 "/>
</g>
</g>
<g>
<path fill="#666666" d="M358.849,130.077v23.827h28.81V77.887h16.547v91.732h-62.987v-39.542H358.849z"/>
<path fill="#666666" d="M434.61,93.602v22.677h45.356v14.949H434.61v22.677h45.356v15.715h-62.987V77.887h62.987v15.715H434.61z"
/>
<path fill="#666666" d="M492.744,169.619V77.887h56.342l6.643,8.05v75.634l-6.579,8.049H492.744z M539.184,93.602h-28.811v60.303
h28.811V93.602z"/>
<path fill="#666666" d="M586.136,169.619h-17.632V77.887h17.632V169.619z"/>
<path fill="#666666" d="M598.913,116.278h33.281v14.949h-33.281V116.278z"/>
<path fill="#666666" d="M691.412,77.887h16.544l-19.995,91.732h-21.462l-21.527-91.732h17.63l13.798,70.588L691.412,77.887z"/>
<path fill="#666666" d="M738.364,169.619h-17.631V77.887h17.631V169.619z"/>
<path fill="#666666" d="M768.77,169.619h-17.632V77.887h17.632l17.886,50.273l18.59-50.273h16.545v91.732h-16.545v-38.392
l-12.84,38.392h-10.35l-13.286-38.392V169.619z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@@ -1,6 +1,4 @@
let b:did_ftplugin = 1
if !has('python') && !has('python3')
if !jedi#init_python()
finish
endif
" ------------------------------------------------------------------------
@@ -8,45 +6,57 @@ endif
" ------------------------------------------------------------------------
if g:jedi#auto_initialization
setlocal omnifunc=jedi#complete
" map ctrl+space for autocompletion
if g:jedi#autocompletion_command == "<C-Space>"
" in terminals, <C-Space> sometimes equals <Nul>
inoremap <buffer><Nul> <C-X><C-O>
" goto / get_definition / usages
if len(g:jedi#goto_command)
execute 'nnoremap <buffer> '.g:jedi#goto_command.' :call jedi#goto()<CR>'
endif
if len(g:jedi#goto_assignments_command)
execute 'nnoremap <buffer> '.g:jedi#goto_assignments_command.' :call jedi#goto_assignments()<CR>'
endif
if len(g:jedi#goto_definitions_command)
execute 'nnoremap <buffer> '.g:jedi#goto_definitions_command.' :call jedi#goto_definitions()<CR>'
endif
if len(g:jedi#goto_stubs_command)
execute 'nnoremap <buffer> '.g:jedi#goto_stubs_command.' :call jedi#goto_stubs()<CR>'
endif
if len(g:jedi#usages_command)
execute 'nnoremap <buffer> '.g:jedi#usages_command.' :call jedi#usages()<CR>'
endif
execute "inoremap <buffer>".g:jedi#autocompletion_command." <C-X><C-O>"
" goto / get_definition / related_names
execute "noremap <buffer>".g:jedi#goto_command." :call jedi#goto()<CR>"
execute "noremap <buffer>".g:jedi#get_definition_command." :call jedi#get_definition()<CR>"
execute "noremap <buffer>".g:jedi#related_names_command." :call jedi#related_names()<CR>"
" rename
execute "noremap <buffer>".g:jedi#rename_command." :call jedi#rename()<CR>"
" pydoc
execute "nnoremap <silent> <buffer>".g:jedi#pydoc." :call jedi#show_pydoc()<CR>"
if g:jedi#show_function_definition == 1 && has('conceal')
call jedi#configure_function_definition()
if len(g:jedi#rename_command)
execute 'nnoremap <buffer> '.g:jedi#rename_command.' :call jedi#rename()<CR>'
execute 'vnoremap <buffer> '.g:jedi#rename_command.' :call jedi#rename_visual()<CR>'
endif
if len(g:jedi#rename_command_keep_name)
execute 'nnoremap <buffer> '.g:jedi#rename_command_keep_name.' :call jedi#rename_keep_name()<CR>'
execute 'vnoremap <buffer> '.g:jedi#rename_command_keep_name.' :call jedi#rename_visual_keep_name()<CR>'
endif
" documentation/pydoc
if len(g:jedi#documentation_command)
execute 'nnoremap <silent> <buffer>'.g:jedi#documentation_command.' :call jedi#show_documentation()<CR>'
endif
end
if g:jedi#auto_vim_configuration
setlocal completeopt=menuone,longest,preview
if len(mapcheck('<C-c>', 'i')) == 0
inoremap <C-c> <ESC>
if g:jedi#show_call_signatures > 0
call jedi#configure_call_signatures()
endif
if g:jedi#completions_enabled == 1
inoremap <silent> <buffer> . .<C-R>=jedi#complete_string(1)<CR>
endif
if g:jedi#smart_auto_mappings == 1
inoremap <silent> <buffer> <space> <C-R>=jedi#smart_auto_mappings()<CR>
end
end
if g:jedi#popup_on_dot
if stridx(&completeopt, 'longest') > -1
inoremap <buffer> . .<C-R>=jedi#do_popup_on_dot() ? "\<lt>C-X>\<lt>C-O>" : ""<CR>
else
inoremap <buffer> . .<C-R>=jedi#do_popup_on_dot() ? "\<lt>C-X>\<lt>C-O>\<lt>C-P>" : ""<CR>
end
end
if g:jedi#auto_close_doc
" close preview if its still open after insert
autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif
end
if g:jedi#auto_close_doc && (&g:completeopt =~# '\<preview\>' && &g:completeopt !~# '\<popup\>')
" close preview if its still open after insert
augroup jedi_preview
if v:version > 704
autocmd CompleteDone <buffer> pclose
else
autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif
autocmd CursorMovedI <buffer> if pumvisible() == 0|pclose|endif
endif
augroup END
endif
endif

1
jedi

Submodule jedi deleted from 89bd32e0d7

View File

@@ -1,60 +1,82 @@
"py_fuzzycomplete.vim - Omni Completion for python in vim
"jedi-vim - Omni Completion for python in vim
" Maintainer: David Halter <davidhalter88@gmail.com>
" Version: 0.1
"
" This part of the software is just the vim interface. The main source code
" lies in the python files around it.
" This part of the software is just the vim interface. The really big deal is
" the Jedi Python library.
if !has('python') && !has('python3')
if !exists("g:jedi#squelch_py_warning")
echomsg "Error: Required vim compiled with +python"
if get(g:, 'jedi#auto_vim_configuration', 1)
" jedi-vim doesn't work in compatible mode (vim script syntax problems)
if &compatible
" vint: -ProhibitSetNoCompatible
set nocompatible
" vint: +ProhibitSetNoCompatible
endif
finish
endif
" load plugin only once
if exists("g:loaded_jedi") || &cp
finish
endif
let g:loaded_jedi = 1
" jedi-vim really needs, otherwise jedi-vim cannot start.
filetype plugin on
" ------------------------------------------------------------------------
" defaults for jedi-vim
" ------------------------------------------------------------------------
let s:settings = {
\ 'use_tabs_not_buffers': 1,
\ 'auto_initialization': 1,
\ 'auto_vim_configuration': 1,
\ 'goto_command': "'<leader>g'",
\ 'autocompletion_command': "'<C-Space>'",
\ 'get_definition_command': "'<leader>d'",
\ 'related_names_command': "'<leader>n'",
\ 'rename_command': "'<leader>r'",
\ 'popup_on_dot': 1,
\ 'pydoc': "'K'",
\ 'show_function_definition': 1,
\ 'function_definition_escape': "'≡'",
\ 'auto_close_doc': 1
\ }
augroup jedi_pyi
au!
autocmd BufNewFile,BufRead *.pyi set filetype=python
augroup END
for [key, val] in items(s:settings)
if !exists('g:jedi#'.key)
exe 'let g:jedi#'.key.' = '.val
" Change completeopt, but only if it was not set already.
" This gets done on VimEnter, since otherwise Vim fails to restore the
" screen. Neovim is not affected, this is likely caused by using
" :redir/execute() before the (alternate) terminal is configured.
function! s:setup_completeopt()
if exists('*execute')
let completeopt = execute('silent verb set completeopt?')
else
redir => completeopt
silent verb set completeopt?
redir END
endif
if len(split(completeopt, '\n')) == 1
set completeopt=menuone,longest
if v:version > 801 || (v:version == 801 && has('patch-8.1.1882'))
set completeopt+=popup
else
set completeopt+=preview
endif
endif
endfunction
if has('nvim')
call s:setup_completeopt()
else
augroup jedi_startup
au!
autocmd VimEnter * call s:setup_completeopt()
augroup END
endif
endfor
if g:jedi#auto_initialization
" this is only here because in some cases the VIM library adds their
" autocompletion as a default, which may cause problems, depending on the
" order of invocation.
autocmd FileType Python setlocal omnifunc=jedi#complete switchbuf=useopen " needed for pydoc
if len(mapcheck('<C-c>', 'i')) == 0
inoremap <C-c> <ESC>
endif
endif
if has('python')
command! -nargs=1 Python python <args>
else
command! -nargs=1 Python python3 <args>
end
" 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).
let unset = {}
let saved_squelch_py_warning = get(g:, 'jedi#squelch_py_warning', unset)
let g:jedi#squelch_py_warning = 1
call jedi#init_python()
if saved_squelch_py_warning is unset
unlet g:jedi#squelch_py_warning
else
let g:jedi#squelch_py_warning = saved_squelch_py_warning
endif
call jedi#debug_info()
endfunction
command! -nargs=0 -bar JediDebugInfo call s:jedi_debug_info()
command! -nargs=0 -bang JediClearCache call jedi#clear_cache(<bang>0)
" vim: set et ts=4:

View File

@@ -1,336 +0,0 @@
"""
The Python parts of the Jedi library for VIM. It is mostly about communicating
with VIM.
"""
import traceback # for exception output
import re
import os
import vim
import jedi
import jedi.keywords
from jedi._compatibility import unicode
temp_rename = None # used for jedi#rename
class PythonToVimStr(unicode):
""" Vim has a different string implementation of single quotes """
__slots__ = []
def __repr__(self):
# this is totally stupid and makes no sense but vim/python unicode
# support is pretty bad. don't ask how I came up with this... It just
# works...
# It seems to be related to that bug: http://bugs.python.org/issue5876
s = self.encode('UTF-8')
return '"%s"' % s.replace('\\', '\\\\').replace('"', r'\"')
def echo_highlight(msg):
vim.command('echohl WarningMsg | echo "%s" | echohl None' % msg)
def get_script(source=None, column=None):
jedi.settings.additional_dynamic_modules = [b.name for b in vim.buffers
if b.name is not None and b.name.endswith('.py')]
if source is None:
source = '\n'.join(vim.current.buffer)
row = vim.current.window.cursor[0]
if column is None:
column = vim.current.window.cursor[1]
buf_path = vim.current.buffer.name
encoding = vim.eval('&encoding')
return jedi.Script(source, row, column, buf_path, encoding)
def complete():
row, column = vim.current.window.cursor
clear_func_def()
if vim.eval('a:findstart') == '1':
count = 0
for char in reversed(vim.current.line[:column]):
if not re.match('[\w\d]', char):
break
count += 1
vim.command('return %i' % (column - count))
else:
base = vim.eval('a:base')
source = ''
for i, line in enumerate(vim.current.buffer):
# enter this path again, otherwise source would be incomplete
if i == row - 1:
source += line[:column] + base + line[column:]
else:
source += line
source += '\n'
# here again hacks, because jedi has a different interface than vim
column += len(base)
try:
script = get_script(source=source, column=column)
completions = script.complete()
call_def = script.get_in_function_call()
out = []
for c in completions:
d = dict(word=PythonToVimStr(c.word[:len(base)] + c.complete),
abbr=PythonToVimStr(c.word),
# stuff directly behind the completion
menu=PythonToVimStr(c.description),
info=PythonToVimStr(c.doc), # docstr
icase=1, # case insensitive
dup=1 # allow duplicates (maybe later remove this)
)
out.append(d)
strout = str(out)
except Exception:
# print to stdout, will be in :messages
print(traceback.format_exc())
strout = ''
completions = []
call_def = None
#print 'end', strout
show_func_def(call_def, len(completions))
vim.command('return ' + strout)
def goto(is_definition=False, is_related_name=False, no_output=False):
definitions = []
script = get_script()
try:
if is_related_name:
definitions = script.related_names()
elif is_definition:
definitions = script.get_definition()
else:
definitions = script.goto()
except jedi.NotFoundError:
echo_highlight(
"Cannot follow nothing. Put your cursor on a valid name.")
except Exception:
# print to stdout, will be in :messages
echo_highlight("Some different eror, this shouldn't happen.")
print(traceback.format_exc())
else:
if no_output:
return definitions
if not definitions:
echo_highlight("Couldn't find any definitions for this.")
elif len(definitions) == 1 and not is_related_name:
# just add some mark to add the current position to the jumplist.
# this is ugly, because it overrides the mark for '`', so if anyone
# has a better idea, let me know.
vim.command('normal! m`')
d = list(definitions)[0]
if d.in_builtin_module():
if isinstance(d.definition, jedi.keywords.Keyword):
echo_highlight(
"Cannot get the definition of Python keywords.")
else:
echo_highlight("Builtin modules cannot be displayed.")
else:
if d.module_path != vim.current.buffer.name:
vim.eval('jedi#new_buffer(%s)' % \
repr(PythonToVimStr(d.module_path)))
vim.current.window.cursor = d.line_nr, d.column
vim.command('normal! zt') # cursor at top of screen
else:
# multiple solutions
lst = []
for d in definitions:
if d.in_builtin_module():
lst.append(dict(text=
PythonToVimStr('Builtin ' + d.description)))
else:
lst.append(dict(filename=PythonToVimStr(d.module_path),
lnum=d.line_nr, col=d.column + 1,
text=PythonToVimStr(d.description)))
vim.eval('setqflist(%s)' % repr(lst))
vim.eval('<sid>add_goto_window()')
return definitions
def show_pydoc():
script = get_script()
try:
definitions = script.get_definition()
except jedi.NotFoundError:
definitions = []
except Exception:
# print to stdout, will be in :messages
definitions = []
print("Exception, this shouldn't happen.")
print(traceback.format_exc())
if not definitions:
vim.command('return')
else:
docs = ['Docstring for %s\n%s\n%s' % (d.desc_with_module, '='*40, d.doc) if d.doc
else '|No Docstring for %s|' % d for d in definitions]
text = ('\n' + '-' * 79 + '\n').join(docs)
vim.command('let l:doc = %s' % repr(PythonToVimStr(text)))
vim.command('let l:doc_lines = %s' % len(text.split('\n')))
def clear_func_def():
cursor = vim.current.window.cursor
e = vim.eval('g:jedi#function_definition_escape')
regex = r'%sjedi=([0-9]+), ([^%s]*)%s.*%sjedi%s'.replace('%s', e)
for i, line in enumerate(vim.current.buffer):
match = re.search(r'%s' % regex, line)
if match is not None:
vim_regex = r'\v' + regex.replace('=', r'\=') + '.{%s}' % \
int(match.group(1))
vim.command(r'try | %s,%ss/%s/\2/g | catch | endtry' \
% (i + 1, i + 1, vim_regex))
vim.eval('histdel("search", -1)')
vim.command('let @/ = histget("search", -1)')
vim.current.window.cursor = cursor
def show_func_def(call_def=None, completion_lines=0):
if vim.eval("has('conceal') && g:jedi#show_function_definition") == '0':
return
try:
if call_def == None:
call_def = get_script().get_in_function_call()
clear_func_def()
if call_def is None:
return
row, column = call_def.bracket_start
if column < 2 or row == 0:
return # edge cases, just ignore
# TODO check if completion menu is above or below
row_to_replace = row - 1
line = vim.eval("getline(%s)" % row_to_replace)
insert_column = column - 2 # because it has stuff at the beginning
params = [p.get_code().replace('\n', '') for p in call_def.params]
try:
params[call_def.index] = '*%s*' % params[call_def.index]
except (IndexError, TypeError):
pass
# This stuff is reaaaaally a hack! I cannot stress enough, that this is
# a stupid solution. But there is really no other yet. There is no
# possibility in VIM to draw on the screen, but there will be one (see
# :help todo Patch to access screen under Python. (Marko Mahni, 2010
# Jul 18))
text = " (%s) " % ', '.join(params)
text = ' ' * (insert_column - len(line)) + text
end_column = insert_column + len(text) - 2 # -2 due to bold symbols
# Need to decode it with utf8, because vim returns always a python 2
# string even if it is unicode.
e = vim.eval('g:jedi#function_definition_escape').decode('UTF-8')
# replace line before with cursor
regex = "xjedi=%sx%sxjedix".replace('x', e)
prefix, replace = line[:insert_column], line[insert_column:end_column]
# Check the replace stuff for strings, to append them
# (don't want to break the syntax)
regex_quotes = r'''\\*["']+'''
# `add` are all the quotation marks.
# join them with a space to avoid producing '''
add = ' '.join(re.findall(regex_quotes, replace))
# search backwards
if add and replace[0] in ['"', "'"]:
a = re.search(regex_quotes + '$', prefix)
add = ('' if a is None else a.group(0)) + add
tup = '%s, %s' % (len(add), replace)
repl = prefix + (regex % (tup, text)) + add + line[end_column:]
vim.eval('setline(%s, %s)' % \
(row_to_replace, repr(PythonToVimStr(repl))))
except Exception:
print(traceback.format_exc())
def rename():
global temp_rename
if not int(vim.eval('a:0')):
temp_rename = goto(is_related_name=True, no_output=True)
_rename_cursor = vim.current.window.cursor
vim.command('normal A ') # otherwise startinsert doesn't work well
vim.current.window.cursor = _rename_cursor
vim.command('augroup jedi_rename')
vim.command('autocmd InsertLeave <buffer> call jedi#rename(1)')
vim.command('augroup END')
vim.command('normal! diw')
vim.command(':startinsert')
else:
cursor = vim.current.window.cursor
window_path = vim.current.buffer.name
# reset autocommand
vim.command('autocmd! jedi_rename InsertLeave')
replace = vim.eval("expand('<cword>')")
vim.command('normal! u') # undo new word
vim.command('normal! u') # 2u didn't work...
if replace is None:
echo_highlight('No rename possible, if no name is given.')
else:
# sort the whole thing reverse (positions at the end of the line
# must be first, because they move the stuff before the position).
temp_rename = sorted(temp_rename, reverse=True,
key=lambda x: (x.module_path, x.start_pos))
for r in temp_rename:
if r.in_builtin_module():
continue
if vim.current.buffer.name != r.module_path:
vim.eval("jedi#new_buffer('%s')" % r.module_path)
vim.current.window.cursor = r.start_pos
vim.command('normal! cw%s' % replace)
vim.current.window.cursor = cursor
vim.eval("jedi#new_buffer('%s')" % window_path)
echo_highlight('Jedi did %s renames!' % len(temp_rename))
# reset rename variables
temp_rename = None
def tabnew(path):
path = os.path.abspath(path)
for tab_nr in range(int(vim.eval("tabpagenr('$')"))):
for buf_nr in vim.eval("tabpagebuflist(%i + 1)" % tab_nr):
buf_nr = int(buf_nr) - 1
try:
buf_path = vim.buffers[buf_nr].name
except IndexError:
# Just do good old asking for forgiveness.
# don't know why this happens :-)
pass
else:
if buf_path == path:
# tab exists, just switch to that tab
vim.command('tabfirst | tabnext %i' % (tab_nr + 1))
break
else:
continue
break
else:
# tab doesn't exist, add a new one.
vim.command('tabnew %s' % path)
def escape_file_path(path):
return path.replace(' ', r'\ ')
def print_to_stdout(level, str_out):
print(str_out)

1
pythonx/jedi Submodule

Submodule pythonx/jedi added at 51f4a99a1e

1230
pythonx/jedi_vim.py Normal file

File diff suppressed because it is too large Load Diff

96
pythonx/jedi_vim_debug.py Normal file
View File

@@ -0,0 +1,96 @@
"""Used in jedi-vim's jedi#debug_info()"""
import sys
import vim
from jedi_vim import PythonToVimStr, jedi
def echo(msg):
vim.command('echo %r' % PythonToVimStr(msg))
def echo_error(msg):
vim.command('echohl ErrorMsg')
echo(msg)
vim.command('echohl None')
def format_exc_info(exc_info=None, tb_indent=2):
import traceback
if exc_info is None:
exc_info = sys.exc_info()
exc_msg = traceback.format_exception_only(exc_info[0], exc_info[1])
lines = ''.join(exc_msg).rstrip('\n').split('\n')
lines.append('Traceback (most recent call last):')
tb = traceback.format_tb(exc_info[2])
lines.extend(''.join(tb).rstrip('\n').split('\n'))
indent = ' ' * tb_indent
return '{0}'.format(('\n' + indent).join(lines))
def get_known_environments():
"""Get known Jedi environments."""
envs = list(jedi.find_virtualenvs())
envs.extend(jedi.find_system_environments())
return envs
def display_debug_info():
echo(' - global sys.executable: `{0}`'.format(sys.executable))
echo(' - global sys.version: `{0}`'.format(
', '.join([x.strip()
for x in sys.version.split('\n')])))
echo(' - global site module: `{0}`'.format(__import__('site').__file__))
try:
import jedi_vim
except Exception:
echo_error('ERROR: could not import jedi_vim: {0}'.format(
format_exc_info()))
return
if jedi_vim.jedi is None:
if hasattr(jedi_vim, 'jedi_import_error'):
error_msg = format_exc_info(jedi_vim.jedi_import_error)
else:
error_msg = 'unknown error'
echo_error('ERROR: could not import the "jedi" Python module: {0}'.format(
error_msg))
else:
echo('\n##### Jedi\n\n - path: `{0}`'.format(jedi_vim.jedi.__file__))
echo(' - version: {0}'.format(jedi_vim.jedi.__version__))
try:
project = jedi_vim.get_project()
environment = project.get_environment()
except AttributeError:
script_evaluator = jedi_vim.jedi.Script('')._evaluator
try:
sys_path = script_evaluator.project.sys_path
except AttributeError:
sys_path = script_evaluator.sys_path
else:
echo('\n##### Jedi environment: {0}\n\n'.format(environment))
echo(' - executable: {0}'.format(environment.executable))
try:
sys_path = environment.get_sys_path()
except Exception:
echo_error('ERROR: failed to get sys path from environment: {0}'.format(
format_exc_info()))
return
echo(' - sys_path:')
for p in sys_path:
echo(' - `{0}`'.format(p))
if environment:
echo('\n##### Known environments\n\n')
for environment in get_known_environments():
echo(' - {0} ({1})\n'.format(
environment,
environment.executable,
))

1
pythonx/parso Submodule

Submodule pythonx/parso added at ee5edaf22f

5
setup.cfg Normal file
View File

@@ -0,0 +1,5 @@
[tool:pytest]
testpaths = test
[flake8]
max-line-length = 100

11
test/_utils.vim Normal file
View File

@@ -0,0 +1,11 @@
function! CurrentBufferIsModule(module_name)
return EndsWith(bufname('%'), a:module_name.'.py')
endfunction
function EndsWith(string, end)
let l:should = len(a:string) - strlen(a:end)
return l:should == stridx(a:string, a:end, should)
endfunction
" vim: et:ts=4:sw=4

65
test/test_integration.py Normal file
View File

@@ -0,0 +1,65 @@
"""Runs tests from ./vspec in vim-vspec."""
import os
import subprocess
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
import zipfile
import pytest
vspec_version = '1.9.0'
VSPEC_URL = 'https://github.com/kana/vim-vspec/archive/%s.zip' % vspec_version
root = os.path.dirname(os.path.dirname(__file__))
CACHE_FOLDER = os.path.join(root, 'build')
VSPEC_FOLDER = os.path.join(CACHE_FOLDER, 'vim-vspec-%s' % vspec_version)
VSPEC_RUNNER = os.path.join(VSPEC_FOLDER, 'bin/vspec')
TEST_DIR = os.path.join(root, 'test', 'vspec')
@pytest.fixture(scope='session')
def install_vspec():
if not os.path.isdir(CACHE_FOLDER):
os.mkdir(CACHE_FOLDER)
if not os.path.exists(VSPEC_FOLDER):
name, hdrs = urlretrieve(VSPEC_URL)
z = zipfile.ZipFile(name)
for n in z.namelist():
dest = os.path.join(CACHE_FOLDER, n)
destdir = os.path.dirname(dest)
if not os.path.isdir(destdir):
os.makedirs(destdir)
data = z.read(n)
if not os.path.isdir(dest):
with open(dest, 'wb') as f:
f.write(data)
z.close()
os.chmod(VSPEC_RUNNER, 0o777)
def get_vspec_tests():
for f in os.listdir(TEST_DIR):
yield os.path.relpath(os.path.join(TEST_DIR, f))
@pytest.mark.parametrize('path', get_vspec_tests())
def test_integration(install_vspec, path):
output = subprocess.check_output(
[VSPEC_RUNNER, '.', VSPEC_FOLDER, os.path.relpath(path, root)],
cwd=root,
)
had_ok = False
for line in output.splitlines():
if (line.startswith(b'not ok') or
line.startswith(b'Error') or
line.startswith(b'Bail out!')):
pytest.fail(u"{0} failed:\n{1}".format(
path, output.decode('utf-8')), pytrace=False)
if not had_ok and line.startswith(b'ok'):
had_ok = True
if not had_ok:
pytest.fail(u"{0} failed: no 'ok' found:\n{1}".format(
path, output.decode('utf-8')), pytrace=False)

8
test/vimrc Normal file
View File

@@ -0,0 +1,8 @@
" Minimal vimrc to use jedi-vim.
"
" Not used anywhere yet, but allows for easy testing.
let script_dir = fnamemodify(expand('<sfile>'), ':h:h')
let &runtimepath = script_dir.','.&runtimepath.','.script_dir.'/after'
syntax on
filetype plugin indent on

View File

@@ -0,0 +1,29 @@
source plugin/jedi.vim
source test/_utils.vim
describe 'simple:'
before
new
normal! ifoo
end
after
bd!
end
it 'choose'
Expect g:jedi#environment_path == 'auto'
Expect bufname('%') == ''
JediChooseEnvironment
" A Python executable needs to be a few letters
Expect len(getline('.')) > 5
Expect bufname('%') == 'Hit Enter to Choose an Environment'
execute "normal \<CR>"
Expect g:jedi#environment_path != 'auto'
bd " TODO why is this necessary? There seems to be a random buffer.
Expect bufname('%') == ''
Expect getline('.') == 'foo'
end
end

131
test/vspec/completions.vim Normal file
View File

@@ -0,0 +1,131 @@
let g:jedi#completions_command = 'X'
source plugin/jedi.vim
describe 'completions'
before
new
set filetype=python
end
after
" default
let g:jedi#popup_select_first = 1
bd!
end
it 'longest in completeopt'
" This gets set up with Vim only on VimEnter.
if has('nvim')
Expect stridx(&completeopt, 'longest') > -1
else
Expect stridx(&completeopt, 'longest') == -1
doautocmd VimEnter
Expect stridx(&completeopt, 'longest') > -1
endif
" Do not use it for following tests.
set completeopt-=longest
end
it 'no smart import by default'
exec "normal ifrom os "
Expect getline('.') == 'from os '
end
it 'import'
" X is the completion command
normal oimporX
Expect getline('.') == 'import'
normal a subproX
Expect getline('.') == 'import subprocess'
end
it 'exception'
normal oIndentationErrX
Expect getline('.') == 'IndentationError'
" Do not remap keys (".") here, otherwise this triggers completion in
" Neovim already.
normal! a().filena
normal aX
Expect getline('.') == 'IndentationError().filename'
end
it 'multi complete'
" NOTE: nvim results in "importErr()" here with completeopt+=longest,
" but Vim is fine.
" This is due to `pumvisible()` in jedi#complete_opened being true
" with nvim still, but it is 0 with Vim, i.e. Vim appears to close
" the pum already (with the tests).
"
" This might be a misunderstanding though, since the test might not
" expect the "import" keyword to be offered for completion?!
normal oImpXErrX()
Expect getline('.') == 'ImportError()'
end
it 'cycling through entries popup_select_first=0'
set completeopt+=longest
let g:jedi#popup_select_first = 0
execute "normal oraise impX\<C-n>"
Expect getline('.') == 'raise ImportError'
set completeopt-=longest
end
it 'cycling through entries popup_select_first=1'
execute "normal oraise impX\<C-n>"
Expect getline('.') == 'raise ImportWarning'
end
it 'cycling through entries popup_select_first=1 and longest'
set completeopt+=longest
execute "normal oraise impX"
Expect getline('.') == 'raise Import'
" With Neovim pumvisible() is 1 in jedi#complete_opened, which then
" triggers the <Down>. This is not the case with Vim.
if has('nvim')
execute "normal oraise impX\<C-n>"
Expect getline('.') == 'raise ImportWarning'
execute "normal oraise impX\<C-n>\<C-n>"
Expect getline('.') == 'raise imp'
else
execute "normal oraise impX\<C-n>"
Expect getline('.') == 'raise ImportError'
execute "normal oraise impX\<C-n>\<C-n>"
Expect getline('.') == 'raise ImportWarning'
endif
set completeopt-=longest
end
end
describe 'smart completions'
before
new
let g:jedi#smart_auto_mappings = 1
set filetype=python
end
after
" default
let g:jedi#smart_auto_mappings = 0
bd!
end
it 'smart import'
exec "normal ifrom os "
Expect getline('.') == 'from os import '
end
it 'no smart import after space'
exec "normal! ifrom os "
exec "normal a "
Expect getline('.') == 'from os '
end
end
" vim: et:ts=4:sw=4

View File

@@ -0,0 +1,20 @@
let g:jedi#completions_command = 'X'
let g:jedi#completions_enabled = 0
source plugin/jedi.vim
describe 'completions_disabled'
before
set filetype=python
end
after
try | %bwipeout! | catch | endtry
end
it 'typing'
normal oraise ImportErrX
Expect getline('.') == 'raise ImportErrX'
end
end
" vim: et:ts=4:sw=4

View File

@@ -0,0 +1,34 @@
source plugin/jedi.vim
describe 'documentation docstrings'
before
set filetype=python
end
after
try | %bwipeout! | catch | endtry
end
it 'simple'
Expect maparg('K') == ':call jedi#show_documentation()<CR>'
put = 'ImportError'
normal GK
Expect bufname('%') == "__doc__"
Expect &filetype == 'rst'
let header = getline(1, 2)
Expect header[0] == "Docstring for class builtins.ImportError"
Expect header[1] == "========================================"
let content = join(getline(3, '$'), "\n")
Expect stridx(content, "Import can't find module") > 0
normal K
Expect bufname('%') == ''
end
it 'no documentation'
put = 'x = 2'
normal o<ESC>GK
Expect bufname('%') == ''
end
end
" vim: et:ts=4:sw=4

177
test/vspec/goto.vim Normal file
View File

@@ -0,0 +1,177 @@
let mapleader = '\'
source plugin/jedi.vim
source test/_utils.vim
describe 'goto simple:'
before
new
set filetype=python
put =[
\ 'def a(): pass',
\ 'b = a',
\ 'c = b',
\ ]
normal! ggdd
normal! G$
Expect line('.') == 3
end
after
bd!
end
it 'goto definitions'
normal \d
Expect line('.') == 2
Expect col('.') == 1
end
it 'goto assignments'
normal \g
Expect line('.') == 2
Expect col('.') == 1
" cursor before `=` means that it stays there.
normal \g
Expect line('.') == 2
Expect col('.') == 1
" going to the last line changes it.
normal! $
normal \g
Expect line('.') == 1
Expect col('.') == 5
end
end
describe 'goto with tabs:'
before
set filetype=python
let g:jedi#use_tabs_not_buffers = 1
end
after
try | %bwipeout! | catch | endtry
end
it 'follow import'
put = ['import subprocess', 'subprocess']
normal G\g
Expect getline('.') == 'import subprocess'
Expect line('.') == 2
Expect col('.') == 8
normal G\d
Expect CurrentBufferIsModule('subprocess') == 1
Expect line('.') == 1
Expect col('.') == 1
Expect tabpagenr('$') == 2
Expect winnr('$') == 1
bwipe
Expect tabpagenr('$') == 1
Expect bufname('%') == ''
end
end
describe 'goto with buffers'
before
set filetype=python
let g:jedi#use_tabs_not_buffers = 0
end
after
try | %bwipeout! | catch | endtry
set nohidden
end
it 'no new tabs'
put = ['import os']
normal G$
call jedi#goto_assignments()
python3 jedi_vim.goto()
Expect CurrentBufferIsModule('os') == 0
" Without hidden, it's not possible to open a new buffer, when the old
" one is not saved.
set hidden
call jedi#goto_assignments()
Expect CurrentBufferIsModule('os') == 1
Expect winnr('$') == 1
Expect tabpagenr('$') == 1
Expect line('.') == 1
Expect col('.') == 1
end
end
describe 'goto with splits'
before
enew!
set filetype=python
let g:jedi#use_splits_not_buffers = 'left'
end
after
try | %bwipeout! | catch | endtry
end
it 'follow import'
put = ['import subprocess', 'subprocess']
normal G\g
Expect getline('.') == 'import subprocess'
Expect line('.') == 2
Expect col('.') == 8
normal G\d
Expect CurrentBufferIsModule('subprocess') == 1
Expect line('.') == 1
Expect col('.') == 1
Expect winnr('$') == 2
wincmd l
Expect bufname('%') == ''
end
end
describe 'goto wildignore'
before
enew!
set filetype=python
set wildignore=*,with\ spaces,*.pyc
set hidden
let g:jedi#use_tag_stack = 1
let g:jedi#use_tabs_not_buffers = 0
" Need to use splits for code coverage in new_buffer()
let g:jedi#use_splits_not_buffers = 1
put = ['from subprocess import Popen', 'Popen']
Expect CurrentBufferIsModule('subprocess') == 0
normal G
end
after
try | %bwipeout! | catch | endtry
set wildignore&vim
end
it 'restores wildignore'
let before = &wildignore
call jedi#goto()
Expect getline('.') =~ 'Popen'
Expect &wildignore == before
end
it 'not using tagstack'
let g:jedi#use_tag_stack = 0
call jedi#goto()
Expect CurrentBufferIsModule('subprocess') == 1
Expect getline('.') =~ 'Popen'
end
end
" vim: et:ts=4:sw=4

View File

@@ -0,0 +1,13 @@
source plugin/jedi.vim
describe 'JediDebugInfo'
it 'works'
redir @a | JediDebugInfo | redir END
let output = split(@a, '\n')
Expect output[0] == 'You should run this in a buffer with filetype "python".'
Expect output[1] == '#### Jedi-vim debug information'
Expect output[-1] == '</details>'
end
end
" vim: et:ts=4:sw=4

34
test/vspec/pyimport.vim Normal file
View File

@@ -0,0 +1,34 @@
source plugin/jedi.vim
source test/_utils.vim
describe 'pyimport'
before
let g:jedi#use_tabs_not_buffers = 1
let g:jedi#project_path = 'autoload'
end
after
try | %bwipeout! | catch | endtry
unlet g:jedi#project_path
end
it 'open_tab'
Pyimport os
Expect CurrentBufferIsModule('os') == 1
Pyimport subprocess
Expect CurrentBufferIsModule('subprocess') == 1
" the empty tab is sometimes also a tab
Expect tabpagenr('$') >= 2
end
it 'completion'
" don't know how to test this directly
"execute "Pyimport subproc\<Tab>"
"Expect CurrentBufferIsModule('subprocess') == 1
Expect jedi#py_import_completions('subproc', 0, 0) == 'subprocess'
Expect jedi#py_import_completions('subprocess', 0, 0) == 'subprocess'
let g:comp = jedi#py_import_completions('sre_', 0, 0)
Expect g:comp == "sre_compile\nsre_constants\nsre_parse"
end
end

143
test/vspec/signatures.vim Normal file
View File

@@ -0,0 +1,143 @@
source plugin/jedi.vim
describe 'signatures'
before
enew
set filetype=python
end
after
try | %bwipeout! | catch | endtry
end
it 'simple'
normal odef xyz(number): return
normal o
normal oxyz()
doautocmd CursorHoldI
Expect getline(3) == '?!?jedi=0, ?!? (*_*number*_*) ?!?jedi?!?'
doautocmd InsertLeave
Expect getline(3) == ''
end
it 'multiple buffers'
set hidden
new
setfiletype python
redir => autocmds
autocmd jedi_call_signatures * <buffer>
redir END
Expect autocmds =~# 'jedi_call_signatures'
buffer #
redir => autocmds
autocmd jedi_call_signatures * <buffer>
redir END
Expect autocmds =~# 'jedi_call_signatures'
end
it 'simple after CursorHoldI with only parenthesis'
noautocmd normal o
doautocmd CursorHoldI
noautocmd normal istaticmethod()
doautocmd CursorHoldI
Expect getline(1) == '?!?jedi=0, ?!? (*_*f: Callable[..., Any]*_*) ?!?jedi?!?'
end
it 'highlights correct argument'
noautocmd normal o
doautocmd CursorHoldI
noautocmd normal iformat(42, "x")
" Move to x - highlights "x".
noautocmd normal 2h
doautocmd CursorHoldI
Expect getline(1) == '?!?jedi=0, ?!? (value: object, *_*format_spec: str=...*_*) ?!?jedi?!?'
" Move left to 42 - hightlights first argument ("value").
noautocmd normal 4h
doautocmd CursorHoldI
Expect getline(1) == '?!?jedi=0, ?!? (*_*value: object*_*, format_spec: str=...) ?!?jedi?!?'
end
it 'no signature'
exe 'normal ostr '
python3 jedi_vim.show_call_signatures()
Expect getline(1, '$') == ['', 'str ']
end
it 'signatures disabled'
let g:jedi#show_call_signatures = 0
exe 'normal ostr( '
python3 jedi_vim.show_call_signatures()
Expect getline(1, '$') == ['', 'str( ']
let g:jedi#show_call_signatures = 1
end
it 'command line simple'
let g:jedi#show_call_signatures = 2
call jedi#configure_call_signatures()
exe 'normal ostaticmethod( '
redir => msg
python3 jedi_vim.show_call_signatures()
redir END
Expect msg == "\nstaticmethod(f: Callable[..., Any])"
redir => msg
doautocmd InsertLeave
redir END
Expect msg == "\n"
normal Sdef foo(a, b): pass
exe 'normal ofoo(a, b, c, '
redir => msg
python3 jedi_vim.show_call_signatures()
redir END
Expect msg == "\nfoo(a, b)"
end
it 'command line truncation'
let g:jedi#show_call_signatures = 2
call jedi#configure_call_signatures()
function! Signature()
redir => msg
python3 jedi_vim.show_call_signatures()
redir END
return msg
endfunction
let funcname = repeat('a', &columns - (30 + (&ruler ? 18 : 0)))
put = 'def '.funcname.'(arg1, arg2, arg3, a, b, c):'
put = ' pass'
execute "normal o\<BS>".funcname."( "
Expect Signature() == "\n".funcname."(arg1, …)"
exe 'normal sarg1, '
Expect Signature() == "\n".funcname."(…, arg2, …)"
exe 'normal sarg2, arg3, '
Expect Signature() == "\n".funcname."(…, a, b, c)"
exe 'normal sa, b, '
Expect Signature() == "\n".funcname."(…, c)"
g/^/d
put = 'def '.funcname.'('.repeat('b', 20).', arg2):'
put = ' pass'
execute "normal o\<BS>".funcname."( "
Expect Signature() == "\n".funcname."(…)"
end
it 'command line no signature'
let g:jedi#show_call_signatures = 2
call jedi#configure_call_signatures()
exe 'normal ostr '
redir => msg
python3 jedi_vim.show_call_signatures()
redir END
Expect msg == "\n"
end
end