Giter VIP home page Giter VIP logo

Comments (11)

tweekmonster avatar tweekmonster commented on June 2, 2024 1

@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.

lambdalisue avatar lambdalisue commented on June 2, 2024 1

Thanks!

from deoplete-jedi.

zchee avatar zchee commented on June 2, 2024

/cc @tweekmonster

from deoplete-jedi.

tweekmonster avatar tweekmonster commented on June 2, 2024

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.

blueyed avatar blueyed commented on June 2, 2024

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.

tweekmonster avatar tweekmonster commented on June 2, 2024

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.

tweekmonster avatar tweekmonster commented on June 2, 2024

@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.

blueyed avatar blueyed commented on June 2, 2024

@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.

tweekmonster avatar tweekmonster commented on June 2, 2024

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.

blueyed avatar blueyed commented on June 2, 2024

Let's create a PR to discuss it?
https://github.com/zchee/deoplete-jedi/compare/vim-dev?expand=1

from deoplete-jedi.

tweekmonster avatar tweekmonster commented on June 2, 2024

I thought I created a PR 😱 I guess I commented instead.

from deoplete-jedi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.