Skip to content

Commit

Permalink
check 'type' key from phpactor before starting auto-import
Browse files Browse the repository at this point in the history
  • Loading branch information
kermorgant committed Jul 23, 2018
1 parent fb92991 commit cc5b321
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions company-phpactor.el
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ Here we create a temporary syntax table in order to add $ to symbols."
(lambda (suggestion)
(setq candidate (plist-get suggestion :name))
(put-text-property 0 1 'annotation (plist-get suggestion :info) candidate)
(put-text-property 0 1 'type (plist-get suggestion :type) candidate)
candidate)
suggestions)))

(defun company-phpactor--post-completion (arg)
"test post completion."
(phpactor-import-class (get-text-property 0 'annotation arg))
(message arg))
(if (string= (get-text-property 0 'type arg) "t")
(phpactor-import-class (get-text-property 0 'annotation arg))
))

(defun company-phpactor--annotation (arg)
"test annotation."
Expand Down

0 comments on commit cc5b321

Please sign in to comment.