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

Only enable indenter on free format #74

Merged
merged 4 commits into from
Oct 27, 2023

Conversation

bclement-ocp
Copy link
Contributor

The indenter also now uses inferred formats properly.

Fixes #52

Note: Currently includes #73; do not merge before #73.

@bclement-ocp bclement-ocp added the ok to review As its name says label Oct 26, 2023
@bclement-ocp bclement-ocp requested a review from nberth October 26, 2023 11:37
Copy link
Collaborator

@nberth nberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure you meant "Only enable indenter on free format".

src/lsp/cobol_indent/indenter.ml Outdated Show resolved Hide resolved
src/lsp/cobol_indent/indenter.ml Show resolved Hide resolved
@nberth
Copy link
Collaborator

nberth commented Oct 26, 2023

You probably want to pass a ~toml:"source-format = \"fixed\"\n" (the newline char may be mandatory) to calls to make_lsp_project in test/lsp/lsp_formatting.ml.

@bclement-ocp
Copy link
Contributor Author

You probably want to pass a ~toml:"source-format = \"fixed\"\n" (the newline char may be mandatory) to calls to make_lsp_project in test/lsp/lsp_formatting.ml.

I'm sure you meant ~toml:"source-format = \"free\"\n" ;) Done.

@bclement-ocp bclement-ocp changed the title Only enable indenter on fixed format Only enable indenter on free format Oct 27, 2023
@nberth nberth self-requested a review October 27, 2023 09:45
Copy link
Collaborator

@nberth nberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can address my comment if you wish, and then merge ;-)

@@ -23,7 +23,9 @@ let doc = {cobol|
|cobol};;

let%expect_test "simple-formatting-request" =
let { projdir; end_with_postproc }, server = make_lsp_project () in
let { projdir; end_with_postproc }, server =
make_lsp_project ~toml:"source-format = \"free\"\n" ()
Copy link
Collaborator

@nberth nberth Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could have deserved a little make_free_format_lsp_project shortcut to avoid duplication.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could, but I believe test code deserves to be as plain as possible, hence I did not do that -- in fact there is much code duplication between the test cases already.

@bclement-ocp bclement-ocp merged commit 06efdf2 into OCamlPro:master Oct 27, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok to review As its name says
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable auto-indent in fixed format
2 participants