Skip to content

Commit

Permalink
Add escape hatch for argument help retrieval
Browse files Browse the repository at this point in the history
Causes freezes with generics that have lots of methods
  • Loading branch information
lionel- committed Nov 15, 2020
1 parent 3b38b78 commit 44c0ddb
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lisp/ess-r-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,15 @@ To be used instead of ESS' completion engine for R versions >= 2.7.0."
(args (mapcar (lambda (a) (concat a ess-R-argument-suffix))
args)))
(all-completions arg args)))
(meta (let ((proc (ess-get-next-available-process)))
(when (and proc
(with-current-buffer (process-buffer proc)
(not (file-remote-p default-directory))))
;; fixme: ideally meta should be fetched with args
(let ((doc (ess-r-get-arg-help-string arg proc)))
(replace-regexp-in-string "^ +\\| +$" ""
(replace-regexp-in-string "[ \t\n]+" " " doc))))))
(meta (unless (bound-and-true-p ess-r--no-company-meta)
(let ((proc (ess-get-next-available-process)))
(when (and proc
(with-current-buffer (process-buffer proc)
(not (file-remote-p default-directory))))
;; fixme: ideally meta should be fetched with args
(let ((doc (ess-r-get-arg-help-string arg proc)))
(replace-regexp-in-string "^ +\\| +$" ""
(replace-regexp-in-string "[ \t\n]+" " " doc)))))))
(sorted t)
(require-match 'never)
(doc-buffer (company-doc-buffer (ess-r-get-arg-help-string arg)))))
Expand Down

0 comments on commit 44c0ddb

Please sign in to comment.