Skip to content

Commit

Permalink
Let Prettier infer the parser when it can
Browse files Browse the repository at this point in the history
Alternative impelementation of PR #195

See also:

- Issue #175
- PR #190, #182
  • Loading branch information
lassik committed Jul 1, 2022
1 parent aa22b06 commit b1a4972
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion format-all.el
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,14 @@ Consult the existing formatters for examples of BODY."
(:format
(format-all--buffer-easy
executable
(unless (buffer-file-name)
(unless (and (buffer-file-name)
(save-match-data
(string-match
(regexp-quote "\"inferredParser\": null")
(with-temp-buffer
(call-process executable nil t nil
"--file-info" (buffer-file-name))
(buffer-string)))))
(list "--parser"
(let ((pair (assoc language
'(("_Angular" . "angular")
Expand Down

0 comments on commit b1a4972

Please sign in to comment.