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

Comments immediately before end of file don't format well #89

Open
qcfu-bu opened this issue Jun 5, 2023 · 3 comments
Open

Comments immediately before end of file don't format well #89

qcfu-bu opened this issue Jun 5, 2023 · 3 comments

Comments

@qcfu-bu
Copy link

qcfu-bu commented Jun 5, 2023

Is there any way to stop smlfmt from formatting comments? In particular, if I write a comment at the end of a file, it always gets formatted to occupy a single line. I want to disable this behavior.

@p-ouellette
Copy link
Contributor

I've run into issues with comments at the end of a file as well. Example:

val _ = print "hello world\n"
(*
val _ = print "this line is commented out\n"
*)

formats as

val _ =
  print
    "hello world\n" (*
                    val _ = print "this line is commented out\n"
                    *)

@shwestrick
Copy link
Owner

Thanks, yeah, this is an issue we should fix.

@qcfu-bu is it just the last comment in the file that is the problem? How is the formatting for comments otherwise?

@qcfu-bu
Copy link
Author

qcfu-bu commented Jun 11, 2023

Yes, it is mainly the last comment in the file that is bothering me. The formatting for the other comments are acceptable.

@shwestrick shwestrick changed the title Stop comment formatting? Comments immediately before end of file don't format well Jun 12, 2023
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

3 participants