Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions company-phpactor.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
;; Copyright (C) 2018 Friends of Emacs-PHP development

;; Author: Martin Tang <martin.tang365@gmail.com>
;; Mikael Kermorgant <mikael@kgtech.fi>
;; Created: 18 Apr 2018
;; Version: 0.1.0
;; Keywords: tools, php
Expand Down Expand Up @@ -56,15 +57,17 @@ Here we create a temporary syntax table in order to add $ to symbols."
(mapcar
(lambda (suggestion)
(setq candidate (plist-get suggestion :name))
(put-text-property 0 1 'annotation (plist-get suggestion :info) candidate)
(put-text-property 0 1 'annotation (plist-get suggestion :short_description) candidate)
(put-text-property 0 1 'type (plist-get suggestion :type) candidate)
(if (string= (plist-get suggestion :type) "class")
(put-text-property 0 1 'class_import (plist-get suggestion :class_import) candidate))
candidate)
suggestions)))

(defun company-phpactor--post-completion (arg)
"Trigger auto-import of completed item ARG when relevant."
(if (string= (get-text-property 0 'type arg) "t")
(phpactor-import-class (get-text-property 0 'annotation arg))))
(if (get-text-property 0 'class_import arg)
(phpactor-import-class (get-text-property 0 'class_import arg))))

(defun company-phpactor--annotation (arg)
"Show additional info (ARG) from phpactor as lateral annotation."
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"phpactor/completion": "dev-master",
"phpactor/docblock": "@dev",
"phpactor/path-finder": "@dev",
"phpactor/phpactor": "^0.7.0",
"phpactor/phpactor": "^0.9.0",
"phpactor/source-code-filesystem": "@dev",
"phpactor/worse-reflection": "@dev",
"phpbench/phpbench": "@dev",
Expand Down
Loading