From 0daffcec249bf42275e322361fe55b89a05ff278 Mon Sep 17 00:00:00 2001 From: Colin Kennedy Date: Sat, 23 Mar 2024 07:22:10 +0000 Subject: [PATCH] Added parse rule for exceptions from a module (#168) --- doc/neogen.txt | 4 +++- lua/neogen/configurations/python.lua | 20 ++++++++++++++++++++ lua/neogen/init.lua | 4 +++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/doc/neogen.txt b/doc/neogen.txt index 29bfcfb..cd135a7 100644 --- a/doc/neogen.txt +++ b/doc/neogen.txt @@ -183,12 +183,14 @@ Feel free to submit a PR, I will be happy to help you ! We use semantic versioning ! (https://semver.org) Here is the current Neogen version: > - neogen.version = "2.17.0" + neogen.version = "2.17.1" < # Changelog~ Note: We will only document `major` and `minor` versions, not `patch` ones. (only X and Y in X.Y.z) +## 2.17.1~ + - Python raises now supports `raise foo.Bar()` syntax ## 2.17.0~ - Python now supports dataclass attributes (#126) ## 2.16.0~ diff --git a/lua/neogen/configurations/python.lua b/lua/neogen/configurations/python.lua index e4e5c7f..e10fe2e 100644 --- a/lua/neogen/configurations/python.lua +++ b/lua/neogen/configurations/python.lua @@ -202,6 +202,26 @@ return { }, }, }, + { + retrieve = "all", + node_type = "raise_statement", + recursive = true, + subtree = { + { + retrieve = "first", + node_type = "call", + recursive = true, + subtree = { + { + retrieve = "first", + node_type = "attribute", + extract = true, + as = i.Throw, + } + } + }, + }, + }, }, }, { diff --git a/lua/neogen/init.lua b/lua/neogen/init.lua index f4f54ec..b3febec 100644 --- a/lua/neogen/init.lua +++ b/lua/neogen/init.lua @@ -241,6 +241,8 @@ end --- --- Note: We will only document `major` and `minor` versions, not `patch` ones. (only X and Y in X.Y.z) --- +--- ## 2.17.1~ +--- - Python raises now supports `raise foo.Bar()` syntax --- ## 2.17.0~ --- - Python now supports dataclass attributes (#126) --- ## 2.16.0~ @@ -303,7 +305,7 @@ end --- with multiple annotation conventions. ---@tag neogen-changelog ---@toc_entry Changes in neogen plugin -neogen.version = "2.17.0" +neogen.version = "2.17.1" --minidoc_afterlines_end return neogen