Skip to content

Commit

Permalink
chore: add additional debug logs for #3839
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 committed Sep 11, 2024
1 parent 39a820e commit c352b0a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/biome_service/src/file_handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub use javascript::JsFormatterSettings;
use std::borrow::Cow;
use std::ffi::OsStr;
use std::path::Path;
use tracing::instrument;

mod astro;
mod css;
Expand Down Expand Up @@ -105,6 +106,7 @@ impl From<&Path> for DocumentFileSource {
}

impl DocumentFileSource {
#[instrument(level = "debug")]
fn try_from_well_known(path: &Path) -> Result<Self, FileSourceError> {
if let Ok(file_source) = JsonFileSource::try_from_well_known(path) {
return Ok(file_source.into());
Expand All @@ -128,6 +130,7 @@ impl DocumentFileSource {
.map_or(DocumentFileSource::Unknown, |file_source| file_source)
}

#[instrument(level = "debug")]
fn try_from_extension(extension: &OsStr) -> Result<Self, FileSourceError> {
if let Ok(file_source) = JsonFileSource::try_from_extension(extension) {
return Ok(file_source.into());
Expand All @@ -153,6 +156,7 @@ impl DocumentFileSource {
.map_or(DocumentFileSource::Unknown, |file_source| file_source)
}

#[instrument(level = "debug")]
fn try_from_language_id(language_id: &str) -> Result<Self, FileSourceError> {
if let Ok(file_source) = JsonFileSource::try_from_language_id(language_id) {
return Ok(file_source.into());
Expand Down Expand Up @@ -183,6 +187,7 @@ impl DocumentFileSource {
.map_or(DocumentFileSource::Unknown, |file_source| file_source)
}

#[instrument(level = "debug")]
fn try_from_path(path: &Path) -> Result<Self, FileSourceError> {
if let Ok(file_source) = Self::try_from_well_known(path) {
return Ok(file_source);
Expand Down

0 comments on commit c352b0a

Please sign in to comment.