File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -850,9 +850,19 @@ The return is nil or in range of (0, inf)."
850850 " Disable LSP completion support."
851851 (lsp-completion-mode -1 ))
852852
853- (defun lsp-completion-passthrough-try-completion (string table _pred point )
854- " Passthrough try function, always return the passed STRING and POINT."
855- (when table
853+ (defun lsp-completion-passthrough-try-completion (string table pred point )
854+ " Passthrough try function.
855+
856+ If TABLE is a function, it is called with STRING, PRED and nil to get
857+ the candidates, otherwise it is treated as the candidates.
858+
859+ If the candidates is non-empty, return the passed STRING and POINT."
860+ (when (pcase table
861+ ((pred functionp)
862+ (funcall table string pred nil ))
863+ ((pred hash-table-p)
864+ (not (hash-table-empty-p table)))
865+ (_ table))
856866 (cons string point)))
857867
858868(defun lsp-completion-passthrough-all-completions (_string table pred _point )
You can’t perform that action at this time.
0 commit comments