Skip to content

Commit

Permalink
apply feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Mar 21, 2024
1 parent 491c920 commit bb1ca3b
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion crates/biome_cli/src/execute/process_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub(crate) fn process_file(ctx: &TraversalOptions, path: &Path) -> FileResult {
.workspace
.file_features(SupportsFeatureParams {
path: biome_path,
feature: ctx.execution.to_features(),
features: ctx.execution.to_features(),
})
.with_file_path_and_code_and_tags(
path.display().to_string(),
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_cli/src/execute/std_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub(crate) fn run<'a>(
if mode.is_format() {
let file_features = workspace.file_features(SupportsFeatureParams {
path: biome_path.clone(),
feature: FeaturesBuilder::new().with_formatter().build(),
features: FeaturesBuilder::new().with_formatter().build(),
})?;
if file_features.is_protected() {
let protected_diagnostic =
Expand Down Expand Up @@ -76,7 +76,7 @@ pub(crate) fn run<'a>(
// apply fix file of the linter
let file_features = workspace.file_features(SupportsFeatureParams {
path: biome_path.clone(),
feature: FeaturesBuilder::new()
features: FeaturesBuilder::new()
.with_linter()
.with_organize_imports()
.with_formatter()
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_cli/src/execute/traverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ impl<'ctx, 'app> TraversalContext for TraversalOptions<'ctx, 'app> {

let file_features = self.workspace.file_features(SupportsFeatureParams {
path: biome_path.clone(),
feature: self.execution.to_features(),
features: self.execution.to_features(),
});

let file_features = match file_features {
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_cli/tests/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2799,7 +2799,7 @@ fn use_literal_keys_should_emit_correct_ast_issue_266() {
}

#[test]
fn should_show_diagnostics_for_formatter_when_linter_ignores_folder() {
fn should_show_formatter_diagnostics_for_files_ignored_by_linter() {
let mut fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

Expand Down Expand Up @@ -2840,7 +2840,7 @@ fn should_show_diagnostics_for_formatter_when_linter_ignores_folder() {

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"should_show_diagnostics_for_formatter_when_linter_ignores_folder",
"should_show_formatter_diagnostics_for_files_ignored_by_linter",
fs,
console,
result,
Expand Down
4 changes: 2 additions & 2 deletions crates/biome_cli/tests/commands/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3463,7 +3463,7 @@ fn format_empty_svelte_ts_files_write() {
}

#[test]
fn should_fix_file_ignored_by_linter_inside_folder() {
fn should_format_files_in_folders_ignored_by_linter() {
let mut fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

Expand Down Expand Up @@ -3511,7 +3511,7 @@ fn should_fix_file_ignored_by_linter_inside_folder() {

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"should_fix_file_ignored_by_linter_inside_folder",
"should_format_files_in_folders_ignored_by_linter",
fs,
console,
result,
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_formatter_test/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl<'a> SpecTestFile<'a> {
.workspace
.file_features(SupportsFeatureParams {
path: input_file.clone(),
feature: FeaturesBuilder::new().with_formatter().build(),
features: FeaturesBuilder::new().with_formatter().build(),
})
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions crates/biome_lsp/src/handlers/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub(crate) fn code_actions(

let file_features = &session.workspace.file_features(SupportsFeatureParams {
path: biome_path,
feature: FeaturesBuilder::new()
features: FeaturesBuilder::new()
.with_linter()
.with_organize_imports()
.build(),
Expand Down Expand Up @@ -208,7 +208,7 @@ fn fix_all(
.workspace
.file_features(SupportsFeatureParams {
path: biome_path.clone(),
feature: vec![FeatureName::Format],
features: vec![FeatureName::Format],
})?
.supports_format();
let fixed = session.workspace.fix_file(FixFileParams {
Expand Down
6 changes: 3 additions & 3 deletions crates/biome_lsp/src/handlers/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(crate) fn format(

let file_features = session.workspace.file_features(SupportsFeatureParams {
path: biome_path.clone(),
feature: FeaturesBuilder::new().with_formatter().build(),
features: FeaturesBuilder::new().with_formatter().build(),
})?;

if file_features.supports_format() {
Expand Down Expand Up @@ -85,7 +85,7 @@ pub(crate) fn format_range(

let file_features = session.workspace.file_features(SupportsFeatureParams {
path: biome_path.clone(),
feature: FeaturesBuilder::new().with_formatter().build(),
features: FeaturesBuilder::new().with_formatter().build(),
})?;

if file_features.supports_format() {
Expand Down Expand Up @@ -141,7 +141,7 @@ pub(crate) fn format_on_type(

let file_features = session.workspace.file_features(SupportsFeatureParams {
path: biome_path.clone(),
feature: FeaturesBuilder::new().with_formatter().build(),
features: FeaturesBuilder::new().with_formatter().build(),
})?;

if file_features.supports_format() {
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_lsp/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ impl Session {
let biome_path = self.file_path(&url)?;
let doc = self.document(&url)?;
let file_features = self.workspace.file_features(SupportsFeatureParams {
feature: FeaturesBuilder::new()
features: FeaturesBuilder::new()
.with_linter()
.with_organize_imports()
.build(),
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_service/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mod server;
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
pub struct SupportsFeatureParams {
pub path: BiomePath,
pub feature: Vec<FeatureName>,
pub features: Vec<FeatureName>,
}

#[derive(Debug, serde::Serialize, serde::Deserialize, Default)]
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_service/src/workspace/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ impl Workspace for WorkspaceServer {
} else if self.is_ignored_by_top_level_config(path) {
file_features.set_ignored_for_all_features();
} else {
for feature in params.feature {
for feature in params.features {
if self.is_ignored_by_feature_config(path, feature) {
file_features.ignored(feature);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@biomejs/backend-jsonrpc/src/workspace.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bb1ca3b

Please sign in to comment.