Closed rohan-97 closed 4 years ago
@rohan-97 Thx for reporting.
class.txt
, def.txt
, noarg.txt
So, you may do
mv /root/.pydocstring/python_commenter.txt /root/.pydocstring/class.txt
cp /path/to/vim-pydocstring/tests/templates/def.txt /root/.pydocstring/def.txt
cp /path/to/vim-pydocstring/tests/templates/def.txt /root/.pydocstring/noarg.txt
Error detected while processing function <lambda>13[1]..<SNR>158_callback: line 1: E474: Invalid argument E899: Argument of reverse() must be a List or Blob E474: Invalid argument E899: Argument of reverse() must be a List or Blob
It seems to happen always:
while the :PydocstringFormat
works perfectly.
Do you have any idea?
@AleCandido Could you show me pydocstring vimrc settings?
Yes:
let g:pydocstring_doq_path = '~/.local/bin/doq'
"let g:pydocstring_formatter = 'numpy'
"let g:pydocstring_templates_path = '~/correct/path'
and I tried also with the meaningful combinations of the commented lines.
@AleCandido Thx
Could you run following command at you shell?
cat foo.py | /path/to/doq --style=json --formatter=sphinx --omit=self,cls --indent=4 --ignore_exception
foo.py
is your python file/path/to/doq
is path to your doq fileIf can be useful I also tried with the older releases (tags), but for 2.0.0
and 2.1.0
it is unable to find my doq installation, but I saw that in 2.2.0
you added this expand()
to all the occurrences of g:pydocstring_doq_path
, so I suppose it is because my path includes ~
.
@AleCandido Yes, I fixed it ver 2.2.0 Could you update latest and try?
I was already on the latest, now I'm back and I tried with cat
, but the problem is that there is no --ignore-exception
option in doq
(my version is 0.4.1
).
@AleCandido
0.4.1 is old. Lataset is 0.5.1
.
Could you update doq to latest?
Sorry, I noticed just now that there is a new version of doq
, so I upgraded, this is the output:
def foo(x): pass
output:
[{"docstring": " \"\"\"foo.\n\n :param x:\n \"\"\"", "start_col": 4, "start_lineno": 1, "end_col": 0, "end_lineno": 2}]
Good! So, what about run via pydocstring.vim?
I don't know, I said that :PydocstringFormat
is working great, so I was quite sure that doq
is working as well, but the problem is :Pydocstring
command itself, I don't know why (the exact error is reported above).
Humm strange. Could you record screencast(gif) and upload it to here? I can't reploduce.
I want to see steps.
Even more strange: I am not able to reproduce anymore.
I was trying to record as you said, so I just installed terminalizer with yarn global add
, and I started recording, while I was recording it worked, and since then it keeps working.
For sure I'm happy about this, and sorry about wasting your time, but I'm really puzzled about this change. For sure I was doing stuffs and manage system installations and so on, but they were decoupled from pydocstring
and even vim
, so I don't really know how it is possible.
Since I am not able to reproduce anymore I just give up for the time being, I will let you know if in the future I will come up with any idea, if you have suggestions I would be happy to make some other attempts.
Thank you for support, and for sure for your project :wink:.
No problem. Great to hear you can use pydocstring.vim! 🎉
Hi @heavenshell ,
Thanks for quick reply and support. I tried your solution and it worked fine.
Thank You!
Great! your welcome!
Hi @heavenshell ,
I wanted to add custom template for docstring. I followed template shown in Readme.rst
I copied contents from tests/templates/class.txt to another custom file (/root/.pydocstring/python_commenter.txt) Following are the contents my .vimrc
Following are the contents and permission of python_commenter.txt
However when I open Python file using vim and try to do
:Pydocstring
I get following errorI searched for reverse in this repository and found one occurance in line 51 of /autoload/pydocstring.vim
Based on error, I think json_decode(a:msg) is not returning List or Blob, whereas reverse() requires List of Blob.
Please let me know whether this information was enough or you want some more information in order to reproduce this issue.
Or I am doing this in a wrong way.
Thanks!