mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-02 18:02:23 +00:00
Add support for extensionless Python files for server (#13326)
## Summary Closes: #12539 ## Test Plan https://github.com/user-attachments/assets/e49b2669-6f12-4684-9e45-a3321b19b659
This commit is contained in:
parent
eded78a39b
commit
b72d49be16
9 changed files with 57 additions and 4 deletions
|
@ -9,6 +9,7 @@ use rustc_hash::FxHashMap;
|
|||
|
||||
pub(crate) use ruff_settings::RuffSettings;
|
||||
|
||||
use crate::edit::LanguageId;
|
||||
use crate::{
|
||||
edit::{DocumentKey, DocumentVersion, NotebookDocument},
|
||||
PositionEncoding, TextDocument,
|
||||
|
@ -603,4 +604,12 @@ impl DocumentQuery {
|
|||
.and_then(|cell_uri| notebook.cell_document_by_uri(cell_uri)),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn text_document_language_id(&self) -> Option<LanguageId> {
|
||||
if let DocumentQuery::Text { document, .. } = self {
|
||||
document.language_id()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue