Commit Graph

75 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Seung-Chan Ahn
ff9a0afbda Support adding extra sys_path 2021-03-15 14:36:20 +09: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
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
3a1c900a26 Remove Python 2 stuff 2020-12-27 00:44:17 +01:00
Dave Halter
04ba9a2430 A small fix 2020-12-25 17:44:22 +01:00
Dave Halter
a76965238a Fix the project choice 2020-10-23 17:45:40 +02:00
Dave Halter
74fd73d017 Added an undocumented JediLoadProject for now 2020-08-01 13:32:48 +02:00
Dave Halter
87abaf0781 Fix goto issues 2020-08-01 00:30:54 +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
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
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
1f7bc2a0fb Fix "goto" with multiple results
E.g. with `os.path`.
2020-01-29 19:20:12 +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
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
Dave Halter
73289427ba Modules should be accessible if column is not None 2019-06-20 23:46:34 +02:00
Dave Halter
9c9a513aaf Add a goto_stubs command 2019-06-16 09:39:50 +02: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
ea5e87a703 Remove jedi.NotFoundError, because that was removed quite a while ago, see #899 2019-02-17 18:04:15 +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
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
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
5123dbbbc7 Fix flake8 issue 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
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