From b1a49720c8e101beedabf2967de7f579074d486c Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Fri, 1 Jul 2022 11:25:49 +0300 Subject: [PATCH] Let Prettier infer the parser when it can Alternative impelementation of PR #195 See also: - Issue #175 - PR #190, #182 --- format-all.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/format-all.el b/format-all.el index b071b83c..8b94dcaa 100644 --- a/format-all.el +++ b/format-all.el @@ -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")