fix: add missing python file extensions

Signed-off-by: Jakub Panek <me@panekj.dev>
This commit is contained in:
Jakub Panek 2022-09-10 11:55:53 +02:00
parent 09680ccdff
commit 980faad454
2 changed files with 3 additions and 3 deletions

View File

@ -268,7 +268,7 @@ pub enum LapceLanguage {
], ],
&["source_file", "import_statement", "import_from_statement"], &["source_file", "import_statement", "import_from_statement"],
), ),
extensions: &["py"], extensions: &["py", "pyi", "pyc", "pyd", "pyw"],
}, },
#[cfg(feature = "lang-toml")] #[cfg(feature = "lang-toml")]
SyntaxProperties { SyntaxProperties {
@ -741,7 +741,7 @@ fn test_tsx_lang() {
#[test] #[test]
#[cfg(feature = "lang-python")] #[cfg(feature = "lang-python")]
fn test_python_lang() { fn test_python_lang() {
assert_language(LapceLanguage::Python, &["py"]); assert_language(LapceLanguage::Python, &["py", "pyi", "pyc", "pyd", "pyw"]);
} }
#[test] #[test]

View File

@ -218,7 +218,7 @@ pub fn language_id_from_path(path: &Path) -> Option<&'static str> {
"php" | "phtml" | "pht" | "phps" => "php", "php" | "phtml" | "pht" | "phps" => "php",
"ps1" | "ps1xml" | "psc1" | "psm1" | "psd1" | "pssc" "ps1" | "ps1xml" | "psc1" | "psm1" | "psd1" | "pssc"
| "psrc" => "powershell", | "psrc" => "powershell",
"py" => "python", "py" | "pyi" | "pyc" | "pyd" | "pyw" => "python",
"r" => "r", "r" => "r",
"rb" => "ruby", "rb" => "ruby",
"rs" => "rust", "rs" => "rust",