-
Notifications
You must be signed in to change notification settings - Fork 653
feat(rome_service): --apply-suggested
argument to rome check
#2952
Conversation
Deploying with
|
Latest commit: |
7706549
|
Status: | ✅ Deploy successful! |
Preview URL: | https://1a46ee69.tools-8rn.pages.dev |
Branch Preview URL: | https://fix-check-apply-command.tools-8rn.pages.dev |
46a8ae7
to
eae2c77
Compare
check --apply
--apply-suggested
argument to rome check
71da2ac
to
167156f
Compare
crates/rome_service/src/settings.rs
Outdated
pub(crate) struct SettingsHandle<'a, E> { | ||
inner: RwLockReadGuard<'a, WorkspaceSettings>, | ||
/// Additional per-request state injected by the editor | ||
#[allow(dead_code)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this field is now unused let's remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about it? It's definitely something that we will need in the future if we decided to have options in the editors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least at the moment I don't really see any use case for being able to provide configuration override into the workspace on a per-request basis
What if there's no configuration in place? Shouldn't Rome then use the editor defaults? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of changing the --apply-suggested
argument to --apply=suggested
?
From the description:
|
I think we should not use editor's configuration, because they would go in conflict with commands like I am not saying we should remove it, but the ergonomics will be harder. What do you think? |
1bfcea9
to
e78d1a7
Compare
I think that's also what Prettier is doing, when no configuration file is present it doesn't read its settings from the incoming formatting request, it just uses the default configuration of 2 spaces for indentation |
6ad137b
to
396f98c
Compare
396f98c
to
7706549
Compare
--apply-suggested
argument to rome check
--apply-suggested
argument to rome check
Summary
--apply-suggested
argumentThis PR adds a new argument
--apply-suggested
to thecheck
.As opposed to
--apply
, which only applies safe fixes, this argument tells to the workspace to apply fix actions that are marked with suggested fixes, marked withApplicability::MaybeIncorrect
and safe fixes.This argument is temporary and it will be replaced with another argument called
--review
, which will allow users to interactively choose the safe fixes.Settings passed to format requests
Until now we were passing the
IndentStyle
coming from the editor, which would then override the one coming from the configuration. The PR removes the need to sending the indentation coming from the LSP. We now have a configuration file and Rome should rely on what the user specified there.Messaging of the
rome check --apply
commandWhen using
--apply
, the workspace now tracks the fixes marked as suggested, and at the end it will present a message with the amount of suggested fixes that were not applied, and it will suggest the new argument added in this PRTest Plan
I added new tests