From 980faad45445067c202f7c963b2f5ddaff585d12 Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Sat, 10 Sep 2022 11:55:53 +0200 Subject: [PATCH] fix: add missing python file extensions Signed-off-by: Jakub Panek --- lapce-core/src/language.rs | 4 ++-- lapce-proxy/src/buffer.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lapce-core/src/language.rs b/lapce-core/src/language.rs index 7119ca26..1a4324bc 100644 --- a/lapce-core/src/language.rs +++ b/lapce-core/src/language.rs @@ -268,7 +268,7 @@ pub enum LapceLanguage { ], &["source_file", "import_statement", "import_from_statement"], ), - extensions: &["py"], + extensions: &["py", "pyi", "pyc", "pyd", "pyw"], }, #[cfg(feature = "lang-toml")] SyntaxProperties { @@ -741,7 +741,7 @@ fn test_tsx_lang() { #[test] #[cfg(feature = "lang-python")] fn test_python_lang() { - assert_language(LapceLanguage::Python, &["py"]); + assert_language(LapceLanguage::Python, &["py", "pyi", "pyc", "pyd", "pyw"]); } #[test] diff --git a/lapce-proxy/src/buffer.rs b/lapce-proxy/src/buffer.rs index 4d74d4a5..d478b76b 100644 --- a/lapce-proxy/src/buffer.rs +++ b/lapce-proxy/src/buffer.rs @@ -218,7 +218,7 @@ pub fn language_id_from_path(path: &Path) -> Option<&'static str> { "php" | "phtml" | "pht" | "phps" => "php", "ps1" | "ps1xml" | "psc1" | "psm1" | "psd1" | "pssc" | "psrc" => "powershell", - "py" => "python", + "py" | "pyi" | "pyc" | "pyd" | "pyw" => "python", "r" => "r", "rb" => "ruby", "rs" => "rust",