-
Notifications
You must be signed in to change notification settings - Fork 459
[RPC] Allow formatting while watch server is running #12064
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
fe0e1a2
WIP: added test to showcase fmt rpc promotion
ElectreAAS 6db07f7
WIP: dune fmt with watch server
ElectreAAS 5cfcb78
WIP: dune fmt with watch server, but less sketchy
ElectreAAS 063dbcc
Rename module Promote to Promote_flag to avoid circular dependency error
ElectreAAS 3d810a9
Remove test print, update test
ElectreAAS 72b99ca
Put the behaviour in the server, get random crashes in the test
ElectreAAS 4935ed6
Double up the RPC requests, it works!
ElectreAAS d330f27
Make the server do the promotion, and not the build implem
ElectreAAS d36fc80
Cleanup
ElectreAAS e19c2c0
Don't try to promote when formatting doesn't do anything
ElectreAAS 942763b
Restore printing, changes will be in a separate PR
ElectreAAS dfd79e6
Use fake ocamlformat in tests
ElectreAAS 7c288de
Instead of parsing a string, provide the actual Dep_conf.t as target
ElectreAAS b9cc4d7
Properly ignore --preview flag in RPC situation
ElectreAAS 583a3b0
Un-move clflags.promote as I'm no longer using it
ElectreAAS caad4aa
Move common & config around to undo changes
ElectreAAS 24345da
Added comment for warn_ignore_arguments
ElectreAAS d1f6af9
Added changelog entry
ElectreAAS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ## Added | ||
|
|
||
| - Allow `dune fmt` to properly run while a watch mode server is running. | ||
| Note that the `--preview` flag is not supported in this mode. | ||
| (#12064, @ElectreAAS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,17 @@ | ||
| (library | ||
| (name dune_rpc_impl) | ||
| (libraries | ||
| stdune | ||
| promote | ||
| unix | ||
| fiber | ||
| csexp_rpc | ||
| dune_stats | ||
| dune_rpc_client | ||
| dune_console | ||
| dune_util | ||
| dune_engine | ||
| dune_lang | ||
| dune_rpc_client | ||
| dune_rpc_private | ||
| dune_rpc_server | ||
| dune_engine) | ||
| dune_stats | ||
| dune_util | ||
| fiber | ||
| promote | ||
| stdune | ||
| unix) | ||
| (synopsis "Dune's rpc server + a usable client")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| $ . ./helpers.sh | ||
|
|
||
| $ echo '(lang dune 3.20)' > dune-project | ||
| $ cat > dune << EOF | ||
| > (executable | ||
| > (name foo)) | ||
| > EOF | ||
|
|
||
| $ touch .ocamlformat | ||
|
|
||
| $ echo "let ()=print_int (5+4)" > foo.ml | ||
|
|
||
| $ start_dune | ||
ElectreAAS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| $ dune rpc ping --wait | ||
| Server appears to be responding normally | ||
|
|
||
| $ dune fmt | ||
|
|
||
| Remove the fake ocamlformat from the dune file to see the real output | ||
| $ cat foo.ml | ||
| (* fake ocamlformat output *) | ||
|
|
||
| $ stop_dune | ||
| fake ocamlformat is running: "--impl" "foo.ml" | ||
| File "foo.ml", line 1, characters 0-0: | ||
| Error: Files _build/default/foo.ml and _build/default/.formatted/foo.ml | ||
| differ. | ||
| Had 1 error, waiting for filesystem changes... | ||
| Promoting _build/default/.formatted/foo.ml to foo.ml. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.