Skip to content

Commit

Permalink
Add an option for inserting argument placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
Pengji Zhang committed Dec 4, 2018
1 parent a6c1d8c commit e4042c2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion racer.el
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,13 @@ Commands:
:type 'boolean
:group 'racer)

(defcustom racer-complete-insert-argument-placeholders
t
"If non-nil, insert argument placeholders after completion.
Note that this feature is only available when `company-mode' is installed."
:type 'boolean
:group 'racer)

(defun racer-complete-at-point ()
"Complete the symbol at point."
(let* ((ppss (syntax-ppss))
Expand All @@ -635,7 +642,8 @@ Commands:

(defun racer-complete--insert-args (arg &optional _finished)
"If a ARG is the name of a completed function, try to find and insert its arguments."
(when (and (require 'company-template nil t)
(when (and racer-complete-insert-argument-placeholders
(require 'company-template nil t)
(equal "Function"
(get-text-property 0 'matchtype arg)))
(let* ((ctx (get-text-property 0 'ctx arg))
Expand Down

0 comments on commit e4042c2

Please sign in to comment.