Skip to content

Don't run lsp--update-on-type-formatting-hook if lsp--on-type-formatting-handler-create is nil #4815

@eval-exec

Description

@eval-exec

(lsp--update-on-type-formatting-hook)

lsp-mode/lsp-mode.el

Lines 4175 to 4182 in 3a96df0

(defun lsp--update-on-type-formatting-hook (&optional cleanup?)
(let ((on-type-formatting-handler (lsp--on-type-formatting-handler-create)))
(cond
((and lsp-enable-on-type-formatting on-type-formatting-handler (not cleanup?))
(add-hook 'post-self-insert-hook on-type-formatting-handler nil t))
((or cleanup?
(not lsp-enable-on-type-formatting))
(remove-hook 'post-self-insert-hook on-type-formatting-handler t)))))

When lsp-enable-on-type-formatting is nil at startup, (lsp--on-type-formatting-handler-create) should not be executed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions