Skip to content
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

Format doesn't work #5

Closed
Cons-Cat opened this issue Nov 16, 2021 · 7 comments
Closed

Format doesn't work #5

Cons-Cat opened this issue Nov 16, 2021 · 7 comments

Comments

@Cons-Cat
Copy link

When I save a file, I get this error:

Mint - Formatting files
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
I was looking for a pattern that contains ".mint" files,
such as "source/**/*.mint". Got "/home/conscat/documents/projects/test_project/source/Main.mint" instead.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
All done in 3.277ms!

Running mint format on my command line works correctly.

@zw963
Copy link
Contributor

zw963 commented Jun 29, 2022

This have another side effect.

When i want to close emacs window, get following error message:

Save file /tmp/mint-format-errors-fileJRkt7U (buffer *prettier errors*)? (y, n, !, ., q, C-r, C-f, d or C-h) 

it should be a mode manage buffer, should not mention user to save it.

@zw963
Copy link
Contributor

zw963 commented Jun 29, 2022

You can comment this line, to close auto format,
and wait this issue get fix.

and, you can leave the emacs builtin format feature, you need set indentation to 2

(add-hook 'mint-mode-hook (lambda ()
                            (setq-local js-indent-level 2)
                            ))

@zw963
Copy link
Contributor

zw963 commented Jul 1, 2022

BTW: i consider this issue caused by mint format will return code 1 if current file formatted by command instead.

i consider this probably a design error, mint format --check exactly do this things, instead, if mint format run
sucessful, whatever formatted file no not, it should return code 0 always.

@zw963
Copy link
Contributor

zw963 commented Jul 3, 2022

I fix this in #6 , though, because the issue from upstream mint-lang, i have to workaround the return code 1 as successful becuuse this issue

@lassik
Copy link
Contributor

lassik commented Jul 4, 2022

You should probably depend on reformatter.el to call the code formatter.

Or just rely on format-all.el and apheleia.el to cover it.

@zw963
Copy link
Contributor

zw963 commented Jul 5, 2022

You should probably depend on reformatter.el to call the code formatter.

Or just rely on format-all.el and apheleia.el to cover it.

Yes, i stolen the code from the format-all.el, use it to locate the project root.
but, it seem like use it directly not work, i don't know how to change default directory for those packages.

@jgarte
Copy link
Collaborator

jgarte commented Sep 11, 2022

Hi all, I'm closing this issue since it was fixed in #6

Feel free to reopen if you need to discuss formatting further.

@jgarte jgarte closed this as completed Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants