Skip to content

Commit

Permalink
Return correct source type for pyi files
Browse files Browse the repository at this point in the history
  • Loading branch information
snowsignal committed May 24, 2024
1 parent 33fd500 commit 37b6ff0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/ruff_server/src/session/index.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use anyhow::anyhow;
use rustc_hash::FxHashMap;
use std::{
collections::BTreeMap,
path::{Path, PathBuf},
sync::Arc,
collections::BTreeMap, path::{Path, PathBuf}, sync::Arc
};

use crate::{
Expand Down Expand Up @@ -465,7 +463,7 @@ impl DocumentQuery {
/// Get the source type of the document associated with this query.
pub(crate) fn source_type(&self) -> ruff_python_ast::PySourceType {
match self {
Self::Text { .. } => ruff_python_ast::PySourceType::Python,
Self::Text { .. } => ruff_python_ast::PySourceType::from(self.file_path()),
Self::Notebook { .. } => ruff_python_ast::PySourceType::Ipynb,
}
}
Expand Down

0 comments on commit 37b6ff0

Please sign in to comment.