tools icon indicating copy to clipboard operation
tools copied to clipboard

📎 New option to silent unhandled files

Open ematipico opened this issue 1 year ago • 2 comments

Description

From https://github.com/rome/tools/discussions/4267

At the moment, when Rome encounters a file that can't handle, a diagnostic is emitted.

We want to create a new option inside the configuration option and a new CLI argument.

Configuration

{
	"files": {
		"ignoreUnknown": true
	}
}

CLI

rome ci ./src --files-ignore-unknown

ematipico avatar May 19 '23 13:05 ematipico

Any additional help on this?

gautamprikshit1 avatar May 20 '23 05:05 gautamprikshit1

Implementing this feature require a bit of work, so don't worry if you feel discouraged.

Here's where I think we should implement the feature.

  1. This is where we throw a diagnostics in the CLI

https://github.com/rome/tools/blob/ab3524889a0dd82d640797cbd2c5b2fadf246d70/crates/rome_cli/src/execute/process_file.rs#L153-L157

  1. This means that when we request the FileFeatures for a file from the workspace, we need to handle that by checking the capabilities and the settings:

https://github.com/rome/tools/blob/ab3524889a0dd82d640797cbd2c5b2fadf246d70/crates/rome_service/src/workspace/server.rs#L199-L201

So, we need the following:

  1. Add the new option in here
  2. Deserialize it here
  3. Add a new option here
  4. Map it here
  5. Then we need to create a new method here that accepts Capabilities and Settings and changes the unsupported reason

ematipico avatar May 21 '23 11:05 ematipico

This option was implemented by #4547

nissy-dev avatar Jun 21 '23 14:06 nissy-dev