Skip to content

Commit d20ae65

Browse files
authored
Merge pull request #43 from kermorgant/phpactor_0.9-compatibility
Phpactor 0.9 compatibility
2 parents 9bcd62e + 4a5fc2c commit d20ae65

File tree

4 files changed

+126
-109
lines changed

4 files changed

+126
-109
lines changed

company-phpactor.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
;; Copyright (C) 2018 Friends of Emacs-PHP development
44

55
;; Author: Martin Tang <martin.tang365@gmail.com>
6+
;; Mikael Kermorgant <mikael@kgtech.fi>
67
;; Created: 18 Apr 2018
78
;; Version: 0.1.0
89
;; Keywords: tools, php
@@ -56,15 +57,17 @@ Here we create a temporary syntax table in order to add $ to symbols."
5657
(mapcar
5758
(lambda (suggestion)
5859
(setq candidate (plist-get suggestion :name))
59-
(put-text-property 0 1 'annotation (plist-get suggestion :info) candidate)
60+
(put-text-property 0 1 'annotation (plist-get suggestion :short_description) candidate)
6061
(put-text-property 0 1 'type (plist-get suggestion :type) candidate)
62+
(if (string= (plist-get suggestion :type) "class")
63+
(put-text-property 0 1 'class_import (plist-get suggestion :class_import) candidate))
6164
candidate)
6265
suggestions)))
6366

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

6972
(defun company-phpactor--annotation (arg)
7073
"Show additional info (ARG) from phpactor as lateral annotation."

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"phpactor/completion": "dev-master",
2727
"phpactor/docblock": "@dev",
2828
"phpactor/path-finder": "@dev",
29-
"phpactor/phpactor": "^0.7.0",
29+
"phpactor/phpactor": "^0.9.0",
3030
"phpactor/source-code-filesystem": "@dev",
3131
"phpactor/worse-reflection": "@dev",
3232
"phpbench/phpbench": "@dev",

0 commit comments

Comments
 (0)