Skip to content

Commit

Permalink
fix regressions in APIs and doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Mar 1, 2024
1 parent a173d95 commit 8a298e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions crates/biome_service/src/file_handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,16 @@ impl DocumentFileSource {
/// use biome_js_syntax::JsFileSource;
/// use biome_json_syntax::JsonFileSource;
/// use biome_service::workspace::DocumentFileSource;
/// let x = JsFileSource::js_module().into();
/// let x = DocumentFileSource::from(JsFileSource::js_module());
/// let y = DocumentFileSource::Unknown;
/// assert_eq!(x.or(y), JsFileSource::js_module().into());
///
/// let x = DocumentFileSource::Unknown;
/// let y = JsFileSource::js_module().into();
/// let y = DocumentFileSource::from(JsFileSource::js_module());
/// assert_eq!(x.or(y), JsFileSource::js_module().into());
///
/// let x = JsFileSource::js_module().into();
/// let y = JsonFileSource::json().into();
/// let x = DocumentFileSource::from(JsFileSource::js_module());
/// let y = DocumentFileSource::from(JsonFileSource::json());
/// assert_eq!(x.or(y), JsFileSource::js_module().into());
///
/// let x = DocumentFileSource::Unknown;
Expand Down
4 changes: 3 additions & 1 deletion crates/biome_service/src/workspace/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ impl WorkspaceServer {
.get(path)
.map(|doc| doc.file_source_index)
.and_then(|index| self.file_sources.read().unwrap().get_index(index).copied())
.unwrap_or_default()
.unwrap_or(
DocumentFileSource::from_path(path)
)
}

/// Return an error factory function for unsupported features at a given path
Expand Down

0 comments on commit 8a298e0

Please sign in to comment.