Handle graphql in prettier function
This commit is contained in:
parent
410841f531
commit
ab6c877aa6
@ -1527,8 +1527,11 @@ A command to format JS via prettier:
|
||||
(defun prettier ()
|
||||
(interactive)
|
||||
(let ((start (if (use-region-p) (region-beginning) (point-min)))
|
||||
(end (if (use-region-p) (region-end) (point-max))))
|
||||
(shell-command-on-region start end "prettier --parser babel" nil t)))
|
||||
(end (if (use-region-p) (region-end) (point-max)))
|
||||
(parser (cond
|
||||
((eq major-mode 'graphql-mode) "graphql")
|
||||
(t "babel"))))
|
||||
(shell-command-on-region start end (concat "prettier --parser " parser) nil t)))
|
||||
#+END_SRC
|
||||
|
||||
* LSP Mode
|
||||
|
Loading…
Reference in New Issue
Block a user