From dd37c30729cf801a11e18d347d1dd5c23a5a0218 Mon Sep 17 00:00:00 2001 From: Jane Lewis Date: Fri, 24 May 2024 14:08:18 -0700 Subject: [PATCH] Return correct source type for pyi files --- crates/ruff_server/src/session/index.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_server/src/session/index.rs b/crates/ruff_server/src/session/index.rs index aa5a1efcad712..706cd96d12990 100644 --- a/crates/ruff_server/src/session/index.rs +++ b/crates/ruff_server/src/session/index.rs @@ -465,7 +465,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, } }