mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-21 02:50:31 +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
|
@ -21,11 +21,14 @@ impl super::SyncNotificationHandler for DidOpen {
|
|||
types::DidOpenTextDocumentParams {
|
||||
text_document:
|
||||
types::TextDocumentItem {
|
||||
uri, text, version, ..
|
||||
uri,
|
||||
text,
|
||||
version,
|
||||
language_id,
|
||||
},
|
||||
}: types::DidOpenTextDocumentParams,
|
||||
) -> Result<()> {
|
||||
let document = TextDocument::new(text, version);
|
||||
let document = TextDocument::new(text, version).with_language_id(&language_id);
|
||||
|
||||
session.open_text_document(uri.clone(), document);
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@ fn format_text_document(
|
|||
file_resolver_settings,
|
||||
None,
|
||||
Some(formatter_settings),
|
||||
text_document.language_id(),
|
||||
) {
|
||||
return Ok(None);
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ fn format_text_document_range(
|
|||
file_resolver_settings,
|
||||
None,
|
||||
Some(formatter_settings),
|
||||
text_document.language_id(),
|
||||
) {
|
||||
return Ok(None);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue