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:
Dhruv Manilawala 2024-09-12 00:35:26 +05:30 committed by GitHub
parent eded78a39b
commit b72d49be16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 57 additions and 4 deletions

View file

@ -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
}
}
}