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

@ -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);

View file

@ -90,6 +90,7 @@ fn format_text_document(
file_resolver_settings,
None,
Some(formatter_settings),
text_document.language_id(),
) {
return Ok(None);
}

View file

@ -54,6 +54,7 @@ fn format_text_document_range(
file_resolver_settings,
None,
Some(formatter_settings),
text_document.language_id(),
) {
return Ok(None);
}