Comments (11)
@blueyed How does _vim_path_
work? I looked at the python client's source but it doesn't appear to do anything and I don't see anything in sys.path
that relates to it.
In any case, I think the symlinking trick might be too obscure and not very portable.
from deoplete-jedi.
Thanks!
from deoplete-jedi.
/cc @tweekmonster
from deoplete-jedi.
What if there's a boolean option called deoplete#sources#jedi#vim_plugin_dev
? Then $RUNTIMEPATH/rplugin
can be added to sys.path
.
from deoplete-jedi.
FWIW: I've found that symlinking modules into ~/.vim/pythonx/
makes them available in Neovim/Vim, because of the special '_vim_path_'
entry at the end of sys.path
.
But this does not get picked up / used by the server probably?!
from deoplete-jedi.
Actually, instead of a variable maybe it would be better if rplugin/python{x,2,3}
exists (cwd), just add the directories in &runtimepath
to sys.path
from deoplete-jedi.
@lambdalisue Could you try the vim-dev
branch? The paths should be added automatically if your cwd
has a rplugin/python*
directory.
from deoplete-jedi.
@tweekmonster
It is handled through an import hook: https://github.com/neovim/python-client/blob/4dbfbd11a28b765a54928ebe6c6173c336ed841e/neovim/plugin/script_host.py#L228-L232 / https://github.com/neovim/python-client/blob/4dbfbd11a28b765a54928ebe6c6173c336ed841e/neovim/plugin/script_host.py#L237-L251.
But that is not used by the deoplete-jedi server.
But jedi-vim uses it, i.e. <Ctrl-x><Ctrl-o>
(with omnifunc=jedi#completions
) will use it for completions, but deoplete-jedi won't.
So, instead of manually adding rplugin
, the same mechanism could/should be used in the server probably, which would make it behave like other clients/plugins?!
from deoplete-jedi.
WTF. When I was searching the code for VIM_SPECIAL_PATH
it only jumped between the setup()
and teardown()
function! Maybe the code didn't load completely in my browser?
It looks like that script is only for the :python*
commands, though. It could probably be used on the client side, but wouldn't work for the server since it would need to import from the neovim
package. The venv users won't have that, and injecting the client's sys.path
into the server wouldn't work for Python 2.
The code in the vim-dev
branch essentially does the same thing anyways, albeit less elegantly.
from deoplete-jedi.
Let's create a PR to discuss it?
https://github.com/zchee/deoplete-jedi/compare/vim-dev?expand=1
from deoplete-jedi.
I thought I created a PR 😱 I guess I commented instead.
from deoplete-jedi.
Related Issues (20)
- Python completion sometimes produce noise HOT 2
- deoplete-jedi fails to load on vim + pynvim 0.4.0 HOT 6
- Deoplete-jedi causes vim to crash when editing a specific file HOT 4
- Option to disable/remove advanced/private members like __init__() HOT 1
- Add call signatures HOT 1
- broken with pandas completion HOT 10
- long stacktraces when completing docstring HOT 16
- no module named 'deoplete.base' HOT 3
- Deoplete throws error between two strings HOT 6
- Should `which pyenv` return a shell function in Fish? HOT 3
- Latest version of jedi crash on Windows HOT 8
- Changing the kind/type of completion-matches HOT 8
- Dont add parameter-information to functions HOT 6
- PosixPath object has not attribute 'endswidth' HOT 1
- Error from jedi: __init__() got an unexpected keyword argument 'code' HOT 4
- How I can turn off preview windows HOT 1
- deoplete-jedi crashes when trying to complete pandas DataFrame attributes HOT 3
- How to set autocomplete key to TAB? HOT 5
- Preview window doesn't show method signature HOT 5
- python versions for virtualenv HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deoplete-jedi.