GithubHelp home page GithubHelp logo

emacs-jedi's Introduction

Jedi.el - Python auto-completion for Emacs

What is it?

Jedi.el is a Python auto-completion package for Emacs. It aims at helping your Python coding in a non-destructive way. It also helps you to find information about Python objects, such as docstring, function arguments and code location.

For more info, read documentation. If you are using developmental version installed via el-get or MELPA, read the developmental version. If you are using released version installed via Marmalade, read the released version.

Auto-completion using Jedi.el. See more screenshots here.

Auto-completion using Jedi.el. See more screenshots here.

Company Users

NOTE: Please do not install 'jedi' package for company users. You should install only company-jedi.

If you use company, please see company-jedi.

emacs-jedi's People

Contributors

aethanyc avatar asmeurer avatar cfroehli avatar dandavison avatar dbrgn avatar fgallina avatar glyph avatar goro1080 avatar holocronweaver avatar hrnciar avatar immerrr avatar iqbalansari avatar jkpl avatar kracekumar avatar l42y avatar liyuan462 avatar markhepburn avatar ramnes avatar rswgnu avatar ryanolf avatar sdague avatar spookylukey avatar stakemori avatar syohex avatar tcw165 avatar thomasf avatar tkf avatar uchida avatar vlevit avatar xbe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emacs-jedi's Issues

Display the "Statement" metadata in a different color

If the statement that defines a variable is long, there is a very small gap between it and the variable name, making it hard to find the completion that you want. It would help if it were displayed in a different color, or at least the word "Statement", so it could be set apart.

Split jedi:goto-definition in two commands

Current UI is not good. Let's define new two commands jedi:goto-definition (deftype=definition) and jedi:goto-assignment (deftype=assignment)


old title: Mention C-u C-u C-. in jedi:goto-definition document

jedi:goto-definition-config is hard to understand if you don't write lisp

See also #56

Default description is too long

jediの問題かもしれませんが、description(popup-make-itemの summaryパラメータ)が
以下のようにとても長くなってしまい、見づらく感じます。

emacs

以下のVim版のスクリーンショットのような感じになればよいと
考えています。(ただコードを見る限り、Emacs版と同じようなことをやって
いるようにしか見えないので、jediの APIが今のような descriptionを
返す前に撮影されたものかもしれません)
vim

必要な情報だけ欲しいのですが、すべて有用な情報であるかもしれないので

  • そのまま表示
  • 最内の情報だけ表示(一番重要に思える)
  • 表示しない、
    から選択できるような形にするのが良いと思います。

以下は試作したパッチです。

diff --git a/jedi.el b/jedi.el
index 0e66af4..8fe65e0 100644
--- a/jedi.el
+++ b/jedi.el
@@ -182,6 +182,21 @@ To make this option work, you need to use `jedi:setup' instead of
 
 ;;; AC source

+(defcustom jedi:ac-description-style 'long
+  "How to display description"
+  :type '(choice (const :tag "Long description" 'long)
+                 (const :tag "Short Desctiption" 'short)
+                 (const :tag "No description" nil))
+  :group 'jedi)
+
+(defun jedi:ac-format-description (desc)
+  (case jedi:ac-description-style
+    (long desc)
+    (short (if (string-match "\\(<[^<:]+:[^>]+>\\)" desc)
+               (match-string 1 desc)
+             desc))
+    (otherwise nil)))
+
 (defun jedi:ac-direct-matches ()
   (mapcar
    (lambda (x)
@@ -190,7 +205,7 @@ To make this option work, you need to use `jedi:setup' instead of
        (popup-make-item word
                         :symbol symbol
                         :document (unless (equal doc "") doc)
-                        :summary description)))
+                        :summary (jedi:ac-format-description description))))
    jedi:complete-reply))

 (defun jedi:ac-direct-prefix ()

現状の jediは jedi側で文字列化してしまい、エディタプラグイン側で
得られた情報を加工しづらいように思えるので、理想的には jedi側を修正し、
それを使う側で加工しやすい情報を得られるようにできればよいと思います。
(特に括弧の入れ子構造は正規表現で解析するのが困難なので)

私の環境設定(本来は Vimのスクリーンショットのようになる ??)に問題があるかも
しれませんので、ご意見をいただけたらと思います。

よろしくお願いします。

jedi:goto-definition should push current point onto mark ring for easy return

I'm loving emacs-jedi, and find myself using jedi:goto-definition (C-.) a lot. However, this function would be even more convenient if it allowed me to return easily to the place where I called it in the first place (via C-u C-SPC). This can be accomplished by setting the mark before jumping to the definition.

auto complete from *Python* buffer?

Just trying out emacs-jedi using python-mode. Seems to work in buffer containing .py file. Any way to get auto-completion in the Python buffer as well?

Error (maybe due to Python 3.3)

Hello,

Jedi currently doesn't work with Python 3.3.

Here is my jedi configuration:

(autoload 'jedi:setup "jedi" nil t)
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
(setq auto-mode-alist (append '(("/*.\.py$" . python-mode)) auto-mode-alist))
(setq python-python-command "/usr/bin/python")
(setq-default py-indent-offset 2)
(add-hook 'python-mode-hook 'long-line-hook)
(add-hook 'python-mode-hook 'jedi:setup)
(require 'python)

If I open a python file, here is the error I get:

deferred error : (error Server may raise an error : Traceback (most recent call last):
  File "/home/<user>/.emacs.d/elpa/jedi-20130112.1346/jediepcserver.py", line 261, in <module>
)

Here is my environnement:
Archlinux x86_64
Emacs 24.2.1
Python 3.3.0
Jedi from elpa (version of the 12 January 2013)

mis alignment of the popup window

I installed jedi for emacs 24.3, under windows,
everything seems to be fine
but the popup window is so ugly that is not well aligned
could not figure out the reason by myself. i attached the screen shot here FYI

thanks alot!
noname

Installing with M-x package install

In the installation notes, the documentation of emacs-jedi says that the recommended way to install emacs-jedi is through get-el.

What about M-x package install? Is this a viable choice?

Also, are new versions regularly pushed to the ELPA package repositories?

Thanks,

Fix keybinds and how it is configured

I agree that the current approach won't scale well. I think we should provide (1) conventional keybinds that are allowed for minor mode by default and (2) a variable to on/off non-conventional shortcut that may override global binding (like M-., M-*). But nothing in between (i.e., one variable per keybind). So, Emacs beginners can turn it on easily enough, but no complication for normal Emacs users.
-- #42 (comment)

See discussions in #42 and #44.

Dynamic args to jedi:server-command?

I would like to be able to pass a callable as part of jedi:server-command. In my case, some of my projects use buildout rather than virtualenv, which changes the way I determine my Python executable. It would be great to be able to say:

(setq jedi:server-command
  (list '(buildout-find-bin "python") jedi:server-script))

(which returns an absolute path or the basic "python"). Is there some way to do this that I am missing? Maybe I should use a hook instead that will see if the current file's python would differ and call stop-server as well?

Add separate mark-ring

Hi there

I've recently tried out emacs-jedi and it turned out an awesome piece of work, thank you.

One thing I do miss though compared to etags-related browsing in C-ish modes is the M-* binding, pop-tag-mark, which moves point to the buffer/location where C-. was last used. I've skimmed through emacs-jedi sources and it appears that there is in fact a call of push-mark performed for each goto-definition.

The problem is that you'd want a global mark so as to be able to jump back across buffers, but push-mark alters global-mark-ring only if the previous push-mark was from a different buffer. Basically, you need to mentally track where did you start your lookup: if goto-definition resulted in a location in different buffer, you need to do global-pop-mark to go back, if not, you need to use buffer-local mark-ring with pop-to-mark-command. This is quite inconvenient.

The obvious solution is to have a separate mark-ring for jedi and it should not be too hard to implement given all the ring manipulation functions are already there (see ring-*).

Cheers,
immerrr

Process epc con 3 not running ??

I get this when I call jedi:complete manually. I am not sure how the process got killed.

  • Why or when the process gets killed/deosn't start.?
  • how can I restart.?

jedi:setup-keys docstring and setup in config file

I just installed emacs-jedi through M-x package install. The documentation says:

To setup recommended keybinds for Jedi.el, add this to your Emacs configuration. Note that you must set jedi:setup-keys before loading jedi.el. See its docstring (<f1> v jedi:setup-keys) for more information.:

However, when I type M-x describe-variable RET jedi:setup-keys I get:

jedi:setup-keys's value is t
Documentation:
Not documented as a variable.

The reason why I am asking is because I am a bit confused about what exactly I am supposed to put in my .emacs file:

; ****************************************************************
; Emacs-jedi
; ****************************************************************
(setq jedi:setup-keys t)
(autoload 'jedi:setup "jedi" nil t)
(add-hook 'python-mode-hook 'jedi:setup)
(add-hook 'python-mode-hook 'jedi:ac-setup)

Is the ordering of my commands correct? (i.e. calling setup-keys before the autoload command).

Thanks

super(). completes immediately

If I type super()., it immediately completes to super().mro. Assumedly this is the only completion, but obviously this is never the attribute of super() that I really wanted to call.

I would like to help with documentation

Hi,

I like what you are doing here! It has proved to be very useful and well done. I would like to clear some stuff up in the documentation for users that may be new to emacs and/or python. How can I help?

Is there a mail list?

Sorry for posting as an issue - I don't see a mail list.

What python-xxx.el are people using with emacs-jedi? So far I'm using
(require 'ipython)

which loads python-mode, currently version 5.2.0. It's rather old.

I've tried some new python-mode (6.1.1), but it didn't work the way I expected, so
went back.

What are others using?

Please test if current Jedi dev branch is working

I did some serious changes to the dev branch. The parser is working really different. And most of it all: Much faster! You can use a big file (> 1k) to test it. The second completion will be really really fast.

I now just need some people to test it. There may be some bugs. You can close this if you want.

Minor bug related to buffer-file-name in jedi:call-deferred

jedi:call-deferred can fail when the string bound to buffer-file-name contains text properties. I would assume that this is because the lisp representation of the string becomes much more complicated and brakes the RPC mechanism. Now buffer-file-name probably should not contain text properties in the first place, but I had a custom piece of code that did this accidentally and this broke jedi-emacs. I would assume that the solution is as simple as replacing buffer-file-name with (substring-no-properties buffer-file-name) which is a small price to pay for a little more robustness.

This is a great piece of code. Thanks.

Autocomplete gives deferred error for some modules

Hi,
I am not getting autocomplete with certain modules. Instead I get a deferred error in the messages buffer. While I get completion for random module, I am not getting it for os and sys. Typing os.listdir shows nothing and results in the error message in the buffer.

I am using python3.3 and emacs 24.3 on Archlinux
This is the error message I get
deferred error : (error "MultiLevelAttributeError((<class 'AttributeError'>, AttributeError(\"'NoneType' object has no attribute 'rfind'\",), <traceback object at 0x7f2a3bb89320>),)") deferred error : (error "MultiLevelAttributeError((<class 'AttributeError'>, AttributeError(\"'NoneType' object has no attribute 'rfind'\",), <traceback object at 0x7f2a3bb89ea8>),)") deferred error : (error "MultiLevelAttributeError((<class 'AttributeError'>, AttributeError(\"'NoneType' object has no attribute 'rfind'\",), <traceback object at 0x7f2a3bb8f680>),)")

Installed packages:

[siddharth@lucy ~]$ pip list
distribute (0.6.34)
epc (0.0.3)
jedi (0.5b5)
pep8 (1.4.5)
pyflakes (0.6.1)
pygame (1.9.2pre)
sexpdata (0.0.2)

My init.el

(require 'package)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)

(when (not package-archive-contents)
  (package-refresh-contents))

;; autopair and yas in all modes
(autopair-global-mode)
(yas-global-mode 1)

;; autocomplete
(require 'auto-complete-config)
(ac-config-default)
(global-auto-complete-mode t) 


;;Jedi
(setq jedi:setup-keys t)
(setq jedi:tooltip-method '(popup))
(add-hook 'python-mode-hook 'jedi:setup)

;; Set up python-mode
(setq py-install-directory (concat esk-user-dir "/python-mode.el-6.1.1/"))
(add-to-list 'load-path py-install-directory)
(require 'python-mode)

;; menu bar is useful when getting started
(menu-bar-mode)

;; show line numbers
(global-linum-mode t)

(setq-default default-tab-width 4)

;; pretty theme
(load-theme 'zenburn t)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(py-shell-name "/usr/bin/python3.3"))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

If environment variable VIRTUAL_ENV is not set

日本語で恐縮ですが、環境変数 VIRTUAL_ENVが定義されていない場合、
サーバプログラムが Emacsから起動されるときエラーが生じてしまいます。
VIRTUAL_ENV環境変数が未定義の場合, 下記の add_virtualenv_path中の
os.path.abspathに Noneが渡されることが問題になっているものと思います。

def add_virtualenv_path():
    """Add virtualenv's site-packages to `sys.path`."""
    venv = os.path.abspath(os.getenv('VIRTUAL_ENV'))

emacs-jediの利用方法としては virtual_envを使わない方法も想定されて
いるようなので、この部分は未定義かどうかを確認すべきではない
でしょうか(もしくは適切なエラーメッセージを出力) ?現状では Noneが
引数として渡った場合 backtraceが表示されるだけなので利用者側
としては困惑する恐れがあります。

環境変数の設定については、普段端末から Emacsを起動する場合は
環境変数が引き継がれるので、日常的にvirtual_envを使っている人で
あれば問題ないかと思いますが、virtual_envを使っていても GUI
ランチャから Emacsを起動する場合、Emacsでは環境変数が
設定されるわけでもないので、環境変数 VIRTUAL_ENVの設定に
ついてはドキュメントに記載しておいた方が良いのではないかと
思います。

Pythonのことを全然わかっていないので、ずれているところも
あるかもしれませんが、よろしくお願いします。

ropemacs and emacs-jedi: Overlap and differences

Which of the following features that ropemacs provides does emacs-jedi also include?

Features bundled with ropemacs (and the default keyboard bindings):

  • Documentation: Put the cursor over a symbol (function name, class name, etc), and do: C-c d. It will show you the docstring for the symbol in question.
  • Jumping to definition: Put the cursor over a symbol (function name, class name, etc), and do: C-c g. This will immediately open the file where the symbol resides and jump to the beginning of the definition. This is great for times when the documentation is sparse and you want to see the actual code. Also, it's really nice for navigating around inside your own code.
  • Find occurrences: C-c f. Smart search in your entire project for the symbol at the cursor.
  • Code assist: M-/. Type the first characters of a function, class, etc, and this will show a list of possible completions. Note that due to python's nature, it will not always be a complete list.
  • Refactorings: There are quite a few options under Rope->Refactor. These are to organize your code better. How to use them should be mostly self-explanatory; in general, select the region of code you want to refactor, then choose the command.

Crash on unicode scripts

Given the following Python script:

# coding=utf-8

def function():
    """€

    """
    pass

Putting point on function and editing it gives me:

deferred error : (error "UnicodeDecodeError('ascii', 'function()\\\\n\\\\n\\xe2\\x82\\xac\\\\n\\\\n    ', 14, 15, 'ordinal not in range(128)')")

I believe my emacs-jedi setup is correct, it generally works well. This bug is just a slight annoynce when I'm editing this file, since my minibuffer keeps flashing up.

Request: goto-definition asking symbol name (was: Jump to functionality)

I would like sometimes to jump to definition of things that are not the symbol that I'm currently on with the cursor.

I tried to look where the definition to jump to is taken from but I can't pass it in in any way apparently.
Maybe another argument to jedi:goto-definition that allows to pass arbitrary strings could be added?
Thanks

Kernel Panic in Mac OS X

Today, I just installed emacs-jedi, as well as all of its dependencies (except for auto-complete, which I already had installed). I installed everything from git. I then enabled everything using https://github.com/asmeurer/dotfiles/blob/master/.emacs#L759-785 (except with the last part uncommented.

I then tried editing some Python. It worked for a little bit, but then my system kernel panicked! Here is the log

Interval Since Last Panic Report:  191924 sec
Panics Since Last Report:          2
Anonymous UUID:                    563FC21E-12C7-8C2A-E396-225C427EB6F4

Tue Mar 19 17:25:59 2013
panic(cpu 6 caller 0xffffff800191edba): "negative open count (c, 16, 6)"@/SourceCache/xnu/xnu-2050.22.13/bsd/miscfs/specfs/spec_vnops.c:1813
Backtrace (CPU 6), Frame : Return Address
0xffffff8142cabbe0 : 0xffffff800181d626 
0xffffff8142cabc50 : 0xffffff800191edba 
0xffffff8142cabc90 : 0xffffff8001923c46 
0xffffff8142cabce0 : 0xffffff8001910cb6 
0xffffff8142cabd20 : 0xffffff80019084cf 
0xffffff8142cabd50 : 0xffffff8001907665 
0xffffff8142cabda0 : 0xffffff8001b4b60c 
0xffffff8142cabe10 : 0xffffff8001b4bb86 
0xffffff8142cabe50 : 0xffffff8001b55a1b 
0xffffff8142cabec0 : 0xffffff8001839ce9 
0xffffff8142cabef0 : 0xffffff800183c7e8 
0xffffff8142cabf20 : 0xffffff800183c65e 
0xffffff8142cabf50 : 0xffffff800181b70d 
0xffffff8142cabf90 : 0xffffff80018b84a3 
0xffffff8142cabfb0 : 0xffffff80018cd4ac 

BSD process name corresponding to current thread: python

Mac OS version:
12D78

Kernel version:
Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64
Kernel UUID: 3EB7D8A7-C2D3-32EC-80F4-AB37D61492C6
Kernel slide:     0x0000000001600000
Kernel text base: 0xffffff8001800000
System model name: MacBookPro10,1 (Mac-C3EC7CD22292981F)

System uptime in nanoseconds: 550977231116
last loaded kext at 244798419625: com.apple.filesystems.msdosfs 1.8 (addr 0xffffff7f82508000, size 65536)
last unloaded kext at 447749174583: com.apple.iokit.IOEthernetAVBController 1.0.2b1 (addr 0xffffff7f829df000, size 28672)
loaded kexts:
org.pqrs.driver.KeyRemap4MacBook    8.0.38
org.virtualbox.kext.VBoxNetAdp  4.2.1
org.virtualbox.kext.VBoxNetFlt  4.2.1
org.virtualbox.kext.VBoxUSB 4.2.1
org.virtualbox.kext.VBoxDrv 4.2.1
com.apple.driver.AppleHWSensor  1.9.5d0
com.apple.driver.AudioAUUC  1.60
com.apple.filesystems.autofs    3.0
com.apple.iokit.IOBluetoothSerialManager    4.1.3f3
com.apple.driver.AGPM   100.12.87
com.apple.driver.ApplePlatformEnabler   2.0.6d1
com.apple.driver.X86PlatformShim    1.0.0
com.apple.driver.AppleMikeyHIDDriver    122
com.apple.driver.AppleHDA   2.3.7fc4
com.apple.driver.AppleUpstreamUserClient    3.5.10
com.apple.driver.AppleIntelHD4000Graphics   8.1.0
com.apple.GeForce   8.1.0
com.apple.iokit.BroadcomBluetoothHCIControllerUSBTransport  4.1.3f3
com.apple.driver.AppleMikeyDriver   2.3.7fc4
com.apple.iokit.IOUserEthernet  1.0.0d1
com.apple.Dont_Steal_Mac_OS_X   7.0.0
com.apple.driver.AppleMuxControl    3.3.0
com.apple.driver.AppleSMCPDRC   1.0.0
com.apple.driver.AppleSMCLMU    2.0.3d0
com.apple.driver.AppleLPC   1.6.0
com.apple.driver.ApplePolicyControl 3.3.0
com.apple.driver.AppleMCCSControl   1.1.11
com.apple.driver.AppleIntelFramebufferCapri 8.1.0
com.apple.driver.AppleUSBTCButtons  237.1
com.apple.driver.AppleUSBTCKeyboard 237.1
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0d1
com.apple.BootCache 34
com.apple.driver.XsanFilter 404
com.apple.iokit.IOAHCIBlockStorage  2.3.1
com.apple.driver.AppleUSBHub    5.5.5
com.apple.driver.AppleSDXC  1.4.0
com.apple.driver.AirPort.Brcm4331   614.20.16
com.apple.driver.AppleAHCIPort  2.5.1
com.apple.driver.AppleUSBEHCI   5.5.0
com.apple.driver.AppleUSBXHCI   5.5.5
com.apple.driver.AppleEFINVRAM  1.7
com.apple.driver.AppleSmartBatteryManager   161.0.0
com.apple.driver.AppleACPIButtons   1.7
com.apple.driver.AppleRTC   1.5
com.apple.driver.AppleHPET  1.8
com.apple.driver.AppleSMBIOS    1.9
com.apple.driver.AppleACPIEC    1.7
com.apple.driver.AppleAPIC  1.6
com.apple.driver.AppleIntelCPUPowerManagementClient 196.0.0
com.apple.nke.applicationfirewall   4.0.39
com.apple.security.quarantine   2
com.apple.driver.AppleIntelCPUPowerManagement   196.0.0
com.apple.kext.triggers 1.0
com.apple.iokit.IOSCSIArchitectureModelFamily   3.5.5
com.apple.iokit.IOSerialFamily  10.0.6
com.apple.driver.DspFuncLib 2.3.7fc4
com.apple.iokit.IOAudioFamily   1.8.9fc11
com.apple.kext.OSvKernDSPLib    1.6
com.apple.iokit.IOAcceleratorFamily 30.14
com.apple.nvidia.gk100hal   8.1.0
com.apple.NVDAResman    8.1.0
com.apple.iokit.AppleBluetoothHCIControllerUSBTransport 4.1.3f3
com.apple.iokit.IOSurface   86.0.4
com.apple.iokit.IOBluetoothFamily   4.1.3f3
com.apple.driver.AppleBacklightExpert   1.0.4
com.apple.driver.AppleHDAController 2.3.7fc4
com.apple.iokit.IOHDAFamily 2.3.7fc4
com.apple.driver.AppleSMBusPCI  1.0.11d0
com.apple.driver.AppleGraphicsControl   3.3.0
com.apple.iokit.IONDRVSupport   2.3.7
com.apple.driver.X86PlatformPlugin  1.0.0
com.apple.driver.AppleSMC   3.1.4d2
com.apple.driver.IOPlatformPluginFamily 5.3.0d51
com.apple.driver.AppleSMBusController   1.0.11d0
com.apple.iokit.IOGraphicsFamily    2.3.7
com.apple.driver.AppleUSBMultitouch 237.3
com.apple.iokit.IOUSBHIDDriver  5.2.5
com.apple.driver.AppleThunderboltDPInAdapter    1.8.9
com.apple.driver.AppleThunderboltDPAdapterFamily    1.8.9
com.apple.driver.AppleThunderboltPCIDownAdapter 1.2.6
com.apple.driver.AppleUSBMergeNub   5.5.5
com.apple.driver.AppleUSBComposite  5.2.5
com.apple.driver.AppleThunderboltNHI    1.6.3
com.apple.iokit.IOThunderboltFamily 2.2.6
com.apple.iokit.IOUSBUserClient 5.5.5
com.apple.iokit.IO80211Family   522.4
com.apple.iokit.IONetworkingFamily  3.0
com.apple.iokit.IOAHCIFamily    2.3.1
com.apple.iokit.IOUSBFamily 5.5.5
com.apple.iokit.IOHIDFamily 1.8.1
com.apple.driver.AppleEFIRuntime    1.7
com.apple.iokit.IOSMBusFamily   1.1
com.apple.security.sandbox  220.2
com.apple.kext.AppleMatch   1.0.0d1
com.apple.security.TMSafetyNet  7
com.apple.driver.DiskImages 345
com.apple.iokit.IOStorageFamily 1.8
com.apple.driver.AppleKeyStore  28.21
com.apple.driver.AppleACPIPlatform  1.7
com.apple.iokit.IOPCIFamily 2.7.3
com.apple.iokit.IOACPIFamily    1.4
com.apple.kec.corecrypto    1.0
Model: MacBookPro10,1, BootROM MBP101.00EE.B02, 4 processors, Intel Core i7, 2.3 GHz, 8 GB, SMC 2.3f35
Graphics: Intel HD Graphics 4000, Intel HD Graphics 4000, Built-In, 512 MB
Graphics: NVIDIA GeForce GT 650M, NVIDIA GeForce GT 650M, PCIe, 1024 MB
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54333531533642465238432D50422020
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54333531533642465238432D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xEF), Broadcom BCM43xx 1.0 (5.106.98.100.16)
Bluetooth: Version 4.1.3f3 11349, 2 service, 11 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM256E, 251 GB
USB Device: hub_device, 0x8087  (Intel Corporation), 0x0024, 0x1a100000 / 2
USB Device: FaceTime HD Camera (Built-in), apple_vendor_id, 0x8510, 0x1a110000 / 3
USB Device: hub_device, 0x8087  (Intel Corporation), 0x0024, 0x1d100000 / 2
USB Device: hub_device, 0x0424  (SMSC), 0x2512, 0x1d180000 / 3
USB Device: BRCM20702 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0x1d181000 / 5
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8286, 0x1d181300 / 8
USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0262, 0x1d182000 / 4

This is in Mac OS X 10.8.3. I'm using a git version of emacs compiled in January, and iTerm2. I tried it a second time, and it panicked again (same log; I can paste them both if you want).

I kind of doubt this is the fault of emacs-jedi, but I was wondering if you could help point me in the right direction of who to report this to get it fixed (or at least worked around)?

--virtual-env argument does not help in resolving packages installed in a virtualenv

I believe the add_virtual_path fn in jediepcserver.py should use the site.addsitedir call to set the correct sys.path.

I only work with virtualenvs and the current behaviour of manually adding the site-packages to sys.path results in complete inability to resolve any packages that exist in my virtualenv.

I can produce a pull request if you believe this is the correct course of action.

Feature: autodetect --virtual-env and --sys-path from python.el settings.

I just got myself into trying jedi.el and I must say I'm kindly surprised about how good it works!

Now, since python.el uses python-shell-extra-pythonpaths, and python-shell-virtualenv-path to set extra sys paths and the virtualenv, I figured it might be a good thing if jedi.el detected those settings directly from my dir-locals and used it right away. For that I just created the following hook:

(defun python-setup ()
  ;; Hack to access buffer local vars: http://bit.ly/Y5IfMV
  (add-hook
   'hack-local-variables-hook
   (lambda ()
     (let ((args))
       ;; Make jedi aware of python.el virtualenv and path settings.
       (and (boundp python-shell-extra-pythonpaths)
            python-shell-extra-pythonpaths
            (mapc
             (lambda (path)
               (setq args (append (list "--sys-path" path) args)))
             python-shell-extra-pythonpaths))
       (and (boundp python-shell-virtualenv-path)
            python-shell-virtualenv-path
            (setq args
                  (append
                   (list "--virtual-env" python-shell-virtualenv-path)
                   args)))
       (and args (set (make-local-variable 'jedi:server-args) args))
       (jedi:setup))) nil t))

(add-hook 'python-mode-hook 'python-setup)

Don't you think it might be a good idea if jedi.el provides something like this by default? Of course there could be a switch to disable such behavior, but I don't feel many people would use it, as the boundp checks are enough for those who are not using the newer python.el.

WDYT?

added something to make it work

Hi

After installing the package (using el-get), I get 'auto-complete-mode not enabled' when trying to auto-complete. I searched for a solution and found out that I needed this in the config file:

(add-hook 'python-mode-hook
(lambda ()
(auto-complete-mode 1)))

It then worked perfectly, maybe I missed something in the installation or the instructions are missing something.

Thanks for the package.

Issues byte compiling

I am trying to byte compile the jedi.el, so that it can load faster. I did put carton in my path, but make gives me

env/bin/pip install --requirement requirements.txt
Requirement already satisfied (use --upgrade to upgrade): jedi>=0.5b4 in /Users/aaronmeurer/Documents/jedi (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): epc in /sw/lib/python2.7/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): argparse in /sw/lib/python2.7/site-packages (from -r requirements.txt (line 3))
Cleaning up...
make test-1
rm -f elpa/mocker-*/*elc  # workaround a bug in mocker.el
EL4T_EMACS=emacs EMACS=tools/el4t/emacs.sh carton exec tools/el4t/emacs.sh -Q -batch \
        -L . -l test-jedi.el -f ert-run-tests-batch-and-exit
Cannot open load file: mocker
make[1]: *** [test-1] Error 255
make: *** [test] Error 2

make compile gives me

rm -rf *.elc
EL4T_EMACS=emacs EMACS=tools/el4t/emacs.sh carton exec tools/el4t/emacs.sh -Q -batch \
        -L . -f batch-byte-compile *.el

In toplevel form:
jedi.el:31:1:Error: Cannot open load file: epc

In toplevel form:
test-jedi.el:32:1:Error: Cannot open load file: mocker

In toplevel form:
tryout-jedi.el:2:1:Error: Cannot open load file: auto-complete
make: *** [compile] Error 1

I also just did a byte-compile-file within emacs, but it's a little annoying, because every time I run make, it deletes the elc file.

Any recommendations?

something like visual-line-mode for popups

Hi,
first of all thanks a lot for the package!!!
The problem I noticed is that when using an emacs buffer with little width it is common that popup text can not be seen (here with/without visual-line-mode activated):
vlm

a solution dirty quick solution I am using is to add a condition when popup-create to turn on visual line mode. Something like this:

(defadvice popup-create ()
(when (not visual-line-mode)
(visual-line-mode)))

jedi:show-doc from within function parenthesis causes error (and doesn't show doc)

Calling jedi:show-doc when the point is in the parenthesis of a function call causes an error:

deferred error : (error "IndexError('list index out of range',)")

jedi:show-doc has no problem with this function when the point is on the function name itself or just after (but not within the parenthesis). For example, hitting C-c d with dict[] with [] the mark works fine, but the same with dict([]) gives the error.

It would be nice if show-doc worked in the parenthesis, though obviously moving the point over is not a big deal. Thanks @tkf for all your work!

virtualenv fails on Windows

Tried to el-get-install jedi on Emacs 24.3, Windows 7. Building failed as virtualenv cannot find python executable, but python.exe is in PATH.

Error message:

virtualenv --python=python env
The executable python (from --python=python) does not exist
make.exe: *** [env/bin/activate] Error 3

python3 import problem

Jedi does not work properly in Python 3.1.3, because local package
imports like

import parsing

don't work anymore. Changing these lines to

from . import parsing

, as 2to3 suggests, gets us in trouble with circular dependencies
between various modules.

As a workaround it's possible to add the jedi installation path to
sys.path at runtime.

-ap

edit: Sorry, wrong repository.

jedi:complete-on-dot may insert extraneous text

I run into it when I don't need the completion and I simply type in the code fast enough. Here's what I think happens. Suppose I have an object foo that has a sole member barbaz and I want to type in foo.barbaz:

  1. I'm typing it in and in the middle of it, e.g. at foo.bar| (| represents point) auto-complete kicks and queries jedi for completion asynchronously
  2. I type in what I want, and now it's foo.barbaz|
  3. jedi returns the list of candidates, which contains only of barbaz and auto-complete knows that completion was initiated when bar was already there
  4. auto-complete goes on and inserts the rest of the completion candidate leaving me with foo.barbazbaz|

It doesn't happen too often, because I need to type in things really fast, but it's annoying as hell. Maybe it can be made easier to reproduce if you insert delay either in a deferred invocation or into the remote procedure itself.

deferred errors from jediepcserver

I have installed jedi-emacs using M-x package install

and the following Python packages:

  • Jedi
  • EPC
  • argparse

using:
pip install --install-option="--prefix=/home/XXX/.my_python_packages" jedi
pip install --install-option="--prefix=/home/XXX/.my_python_packages" epc
pip install --install-option="--prefix=/home/XXX/.my_python_packages" argparse

(because I do not have root privileges).

When I open a Python file, I get the following error in the minibuffer, no matter where I place the cursor:

deferred error : (error Server may raise an error : Traceback (most recent call last):
  File "/home/josh/.emacs.d/elpa/jedi-20130119.830/jediepcserver.py", line 261, in <module>
)

Any thoughts?

Completion doesn't work

I'm pretty sure that jedi is not working. I get completions for things, but I'm pretty sure that they are just coming from auto-complete. Is there a simple test script that I can use to test if jedi is completing?

jedi:dot-complete not work with some modules

dot-complete function refused to work while using some modules.

I was building some python opengl application and was working with opengl, and this problem occured while I type:

import OpenGL.GLUT as g
g.

Completion list does not appear even with jedi:complete-on-dot set to t, and a short message was displayed in mini buffer and in message buffer saying
"deferred error : (error "AttributeError("'NoneType' object has no attribute 'get_parent_until'",)")"

This error also appeared while I was at "g." and was trying to call jedi:complete to show the completion list.

But the completion list does appear when I type first characters of the functions I wish to call, for example, while typing something like "g.glut", the completion list does appear with a list of the correct functions.

My auto-complete, epc, ctable, deferred were installed from the latest git sources.
python2-ecb version: 0.0.3
python2-jedi version: 0.6.0
Emacs version: 24.3
Python version: 2.7.5

Objects not callable error

I'm not really sure why but I keep getting errors like:

TypeError: 'Import' object is not callable

Replacing line:

 return comp.name.parent().isinstance(what)

with:

 return comp.name.parent.isinstance(what)

seems to fix the problem for me.

tooltip is being overlaid on completions.

First of thank you very much for this.

I see we get tooltip for arguments, which is very nice,

but sometimes it is covering auto-completions gets ugly.

screenshot

could it be possible a way to showtooltip be above the line of editing and completions are below the line.?

They may be better solution.,

ありがとう。

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.