New vim-pydocstring plan
Closed this issue · 3 comments
heavenshell commented
Current problems of vim-pydocstrings
- Not maintanable code
- Parse arguments by regex is very hard and buggy
- Combination of Typings and default value are very complex
- Template file is not extendable
- Use template engine?
- Jinja2 is good but too much
How(idea)
- Use Python3's ast module and Vim8's job and channel
- Pick code sigunature and pass to parser script via job and channel
- Parser script parse signature and return JSON
e.g.
def foo(arg1, arg2: List[int, str]=[1, 'foo']) -> None:
pass
{
"name": "foo",
"args": [
{ "arg": "arg1", "type": "", "default": ""},
{ "arg": "arg2", "type": "List[int, str]", "default": "[1, 'foo']"},
],
"rtype": "None"
}
- vim-pydocstring receive JSON and put to template
heavenshell commented
2.0.0 was released 🎉
yzlnew commented
Will Neovim be supported in the future?
heavenshell commented
@yzlnew
I'm not Neovim user, so Neovim user can send me PR 😊
(I don't have Neovim env and I have no plan to install Neovim in my env)