Skip to content

Commit

Permalink
Make lsp-ansible work on yaml-ts-mode buffers (#4052)
Browse files Browse the repository at this point in the history
yaml-ts-mode derives from text-mode, so `(derived-mode-p 'yaml-mode)` returns
`nil`.

```emacs-lisp
(define-derived-mode yaml-ts-mode text-mode "YAML"
  "Major mode for editing YAML, powered by tree-sitter."
  :group 'yaml
  :syntax-table yaml-ts-mode--syntax-table
  [...])
```
  • Loading branch information
mpereira authored Jul 18, 2023
1 parent d3a63b0 commit 0858544
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clients/lsp-ansible.el
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ Python virtual environment."
(defun lsp-ansible-check-ansible-minor-mode (&rest _)
"Check whether ansible minor mode is active.
This prevents the Ansible server from being turned on in all yaml files."
(and (derived-mode-p 'yaml-mode)
(and (or (derived-mode-p 'yaml-mode)
(derived-mode-p 'yaml-ts-mode))
;; emacs-ansible provides ansible, not ansible-mode
(with-no-warnings (bound-and-true-p ansible))))

Expand Down

0 comments on commit 0858544

Please sign in to comment.