https://github.com/aki2o/emacs-plsense.git
git clone 'git://github.com/aki2o/emacs-plsense.git'
This is a extension of Emacs that provide interface for PlSense.
PlSense is a development tool for Perl.
PlSense provides completion/help optimized for context by the type inference.
For detail, see https://github.com/aki2o/plsense/blob/master/README.md
Using this extension, you can do coding Perl on Emacs like the following.
When you are on Perl buffer, provide completion optimized for context using auto-complete.el.
The candidates are optimized by the type inference.
Provide a optimized completion on the following position of the buffer.
use perl-completion.el for compeltion if fail the type inference.
http://www.youtube.com/watch?v=Q8XDhxqmaXs
2013/09/10 It's available by using melpa.
2013/07/26 Not yet available.
2013/09/08 It's available. But, master branch only.
(auto-install-from-url "https://raw.github.com/aki2o/emacs-plsense/master/plsense.el")
* Installing each the following dependency is required in this case.
Download plsense.el and put on your load-path.
* Installing each the following dependency is required in this case.
(require 'plsense)
;; Key binding
(setq plsense-popup-help-key "C-:")
(setq plsense-display-help-buffer-key "M-:")
(setq plsense-jump-to-definition-key "C->")
;; Make config suit for you. About the config item, eval the following sexp.
;; (customize-group "plsense")
;; Do setting recommemded configuration
(plsense-config-default)
plsense-version
… show version of PlSense.* Double as a verification of install.
plsense-server-start
… start process of PlSense server.plsense-server-stop
… stop process of PlSense server.* You must finish configuration of PlSense on ahead.
* You must do plsense-server-start
on Emacs regardless of whether PlSense server process exist.
* Executing the above command redundantly is OK.
* Maybe show ... is failed
despite the success of the above command along of timeout.
* In the case, verify status of PlSense server by seeing ‘Information of server’ section below.
* You can do plsense-server-start
automatically by configuration.
plsense-server-status
… show status of PlSense server.plsense-server-task
… show the running tasks on PlSense server.The above command in ‘Start/Stop of server’ section, double as a switching active/inactive.
If you have executed plsense-server-start
, provision of completion/help is active when open buffer.
But, not start provision of completion/help until finish analyzing the buffer.
When start provision of completion/help, show ... is ready.
.
plsense-buffer-is-ready
… show status about analyzing current buffer.plsense-reopen-current-buffer
… restart analyzing current buffer.* Not activate automatically on the buffer that opened before executing plsense-server-start
.
* In the case, execute plsense-reopen-current-buffer
for activate.
* Not activate automatically if the buffer file is not exists.
* When execute find-file
, save the buffer.
* Not activate on the buffer of the mode not included in plsense-enable-modes
.
* If status is ‘No’, the buffer maybe not activate. execute plsense-reopen-current-buffer
.
* If status is ‘Not Found’, check syntax error. PlSense can not analyze when syntax error.
* If status is ‘Not Found’ other than above case, see ‘Sync server’ section below.
* Otherwise, status maybe ‘No’ or ‘Not Found’ despite the finish of analyzing.
For a optimized completion/help, it's required that synchronization of context between Emacs and PlSense server.
Normally, it's finished by this extension automatically.
But, it maybe happen that synchronization is failed by some reason and it isn't recovered automatically.
If not show completion/help and show error message continuously, execute the following command.
plsense-update-location
… inform Plsense server of current context forcibly.* If not recovered by the above command, restart PlSense server.
The result of analyzing is gathered on PlSense server with edit buffer on Emacs.
Then, the following maybe happen by running PlSense server over a long time.
In the case, execute the following command.
plsense-server-refresh
… initialize PlSense server and start analyzing the newest source code.* Restart PlSense server is also OK. But if running task exists, the result is lost.
PlSense can not analyze the file that has syntax error.
It means the following.
* For checking syntax error, execute perl -c /path/to/file
on shell.
If you develop in project tree which has particular library for the project, need to make ProjectInfoFile.
PlSense do the type inference by analyzing a source code of Perl.
But, it maybe happen the type inference is failed because Perl has a lot of grammar.
In the above case, a optimized completion/help is not provided.
For detail, see https://github.com/aki2o/plsense/wiki/TypeInference.
* If perl-completion.el is available, Instead provides a completion using perl-completion.el.
Analyzing is started from current buffer recursively in sequence.
It like the following.
CurrentBuffer A ⇒ A's UseModule B ⇒ B's UseModule C …
Provision of completion/help is started when finished analyze current buffer.
But, analyzing continue in the background like the above.
It means that a few minutes is required for the result of completion/help is optimized.
It apply when you open/edit/save buffer.
The result of analyzing is saved and used until the file is changed.
So, If finish the all analyzing, provision of a optimized completion/help is started soon.
About the time required for the all analyzing is finished, see https://github.com/aki2o/plsense/wiki/Resource.
I guess that the Emacs action become sluggish while a many tasks is running.
If you notice it, you can show the task by plsense-server-task
.
I think the best way is that analyzing is done for latest content of buffer when user require completion/help.
But, the way is high cost.
So, do analyzing at the other timing for high-performance.
If you use plsense-config-default
, the timing is when the following command is executed.
* There are two type of Analyzing, simplified/complete.
* In the above case, Analyzing is simplified at the timing other than save-buffer.
plsense-update-current-buffer
.plsense--add-pointed-source
.plsense-server-sync-trigger-ize
.plsense-config-default
.Picking up the Variable/Method help from PerlDoc maybe failed.
In the case, show the help of module that the Variable/Method belong to.
Enjoy!!!