Skip to content

Commit f25fe20

Browse files
authored
Merge pull request #18 from MarTango/improvement/use-phpactor--command-argments-for-completion
Use phpactor--command-argments in company-phpactor--get-suggestions
2 parents 408eba7 + 7c01d3c commit f25fe20

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

company-phpactor.el

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
(require 'company)
3232
(require 'phpactor)
3333

34-
(defun company-phpactor--get-suggestions (source offset)
34+
(defun company-phpactor--get-suggestions ()
3535
"Get completions for current cursor."
36-
(let ((response (phpactor--rpc "complete" (list :source (buffer-substring-no-properties (point-min) (point-max)) :offset (point)))))
36+
(let ((response (phpactor--rpc "complete" (phpactor--command-argments :source :offset))))
3737
(plist-get (plist-get (plist-get response :parameters) :value) :suggestions)))
3838

3939
;;;###autoload
@@ -43,9 +43,7 @@
4343
(cl-case command
4444
(interactive (company-begin-backend 'company-phpactor))
4545
(prefix (company-grab-symbol))
46-
(candidates (let ((offset (point))
47-
(source (buffer-substring-no-properties (point-min) (point-max))))
48-
(all-completions arg (mapcar #'(lambda (suggestion) (plist-get suggestion :name)) (company-phpactor--get-suggestions source offset)))))))
46+
(candidates (all-completions arg (mapcar #'(lambda (suggestion) (plist-get suggestion :name)) (company-phpactor--get-suggestions))))))
4947

5048
(provide 'company-phpactor)
5149
;;; company-phpactor.el ends here

0 commit comments

Comments
 (0)