简体   繁体   English

jediepcserver.py的倍数virtualenvs的倍数

[英]multiples jediepcserver.py for multiples virtualenvs

I'm trying to run multiples jediepcserver.py for multiples virtualenvs for different projects. 我正在尝试为不同项目的多个virtualenvs运行多个jediepcserver.py。 My idea is to have the proper autocompletion in each of the projects that I'm working on Emacs. 我的想法是在Emacs上的每个项目中都具有正确的自动补全功能。

For example, I'm working on two projects at the moment, one using Django 1.5 and another one using Django 1.7, so autocompletion should be different for each of the projects. 例如,我目前正在处理两个项目,一个使用Django 1.5,另一个使用Django 1.7,因此每个项目的自动完成功能都应有所不同。

This is my configuration file: 这是我的配置文件:

(setq python-environment-directory "~/.virtualenvs")


(autoload 'jedi:setup "jedi" nil t)
(add-hook 'python-mode-hook 'jedi:setup)

(setq jedi:environment-root "jedi")  ; name of the virtualenv
(setq jedi:server-command '("/home/humitos/.emacs.d/vendor/emacs-jedi/jediepcserver.py"))
(setq jedi:server-args 
      '("--virtual-env" "~/.virtualenvs/jedi"
    "--log" "/tmp/jediepcserver.log"
    "--log-level" "DEBUG"))

(setq jedi:complete-on-dot t)

(setq jedi:get-in-function-call-delay 500)

I tried to use .dir-locals.el inside the projects but I couldn't make it work. 我尝试在项目中使用.dir-locals.el ,但无法使其正常工作。

(setq jedi:server-args 
      '("--virtual-env" "~/.virtualenvs/my-venv-project"
    "--log" "/tmp/jediepcserver.log"
        "--log-level" "DEBUG"))

I think this should be possible but I'm sure that I'm missing something in the configuration. 我认为这应该可行,但是我确定配置中缺少某些内容。 What is that? 那是什么?

Thanks in advance. 提前致谢。

From the documentation : 文档中

If you want to use a specific version of Python, setup jedi:environment-virtualenv variable appropriately and reinstall jediepcserver.py. 如果要使用特定版本的Python,请适当设置jedi:environment-virtualenv变量,然后重新安装jediepcserver.py。

It also says you must configure jedi:environment-root if you set jedi:environment-virtualenv so... 它还说,如果您将jedi:environment-virtualenv设置jedi:environment-virtualenv如此,则必须配置jedi:environment-root ...

my .dir-locals.el looks like this 我的.dir-locals.el看起来像这样

((python-mode . ((python-shell-virtualenv-root . "/home/ale/.virtualenvs/env/")
      (jedi:environment-root . "/home/ale/.virtualenvs/env/")
      (jedi:environment-virtualenv . ("virtualenv" "--python" "/usr/bin/python3.4")) 
      )))

And the I reinstall the jediserver, it seems to work! 而且我重新安装了jediserver,看来可以正常工作!

Forgive me for the missing ())())()()((( 原谅我丢失的())())()()(((

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM