-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eglot sees the whole outer buffer content #331
Comments
Same problem with |
As a workaround, I have to edit innermode content in another buffer by edit-indirect, here's my config: (define-innermode poly-bash-innermode
:mode 'bash-ts-mode
:head-matcher "^ *#!/usr/bin/env \\(sh\\|bash\\)\n"
:tail-matcher "^ *# </bash>$"
:head-mode 'body
:tail-mode 'body)
(define-hostmode poly-yaml-ts-hostmode
:mode 'yaml-ts-mode)
(define-polymode poly-yaml-ts-mode
:hostmode 'poly-yaml-ts-hostmode
:innermodes '(poly-bash-innermode))
(add-hook 'yaml-ts-mode-hook 'poly-yaml-ts-mode)
(setq polymode-prefix-key (kbd "s-,"))
(defun my/polymode/edit-chunk ()
(interactive)
(call-interactively 'polymode-mark-or-extend-chunk)
(call-interactively 'edit-indirect-region))
(define-key polymode-mode-map (kbd "s-, e") 'my/polymode/edit-chunk) ; [e]dit by edit-indirect
;; eglot/lsp needs "workspace/file" view, so we set buffer-file-name to a fake path in the same dir as the visiting file
(defun edit-indirect-guess-mode (_parent-buffer _beg _end)
(setq-local buffer-file-name (format "%s.-ei-" (buffer-file-name _parent-buffer)))
(funcall (buffer-local-value 'major-mode _parent-buffer)))
(setq edit-indirect-guess-mode-function #'edit-indirect-guess-mode) |
I see people are using polymode with lsp-mode in #305 – is this an issue with polymode or with eglot? |
I seem to have the same issue with lsp-mode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As shown in the screenshot, ShellCheck/flymake gives warnings for yaml content as well.
The text was updated successfully, but these errors were encountered: