autoDocstring icon indicating copy to clipboard operation
autoDocstring copied to clipboard

can't change vscode docstring format

Open ItsDrike opened this issue 4 years ago • 9 comments

I tried to change the docstring format to sphinx, but it didn't work and it only gave me [summary] (as if it ignored the args, kwargs, etc..) I also tried to use other formats (google and numpy). I even tried to set a custom format to match the sphinx, but it did the same thing.

Then I tried to actually just paste the default format and use it as custom format, and again, it only gave me a summary, no arguments, returns or anything else.

I used "autoDocstring.docstringFormat": "sphinx" to change the docstring format

For the custom one I used: "autoDocstring.customTemplatePath": "/home/koumakpet/.vscode-oss/custom/autoDocstring/test"

I don't quite get it, am I doing something wrong or is there a bug or what could be the problem. I should mention that I'm using Arch Linux OS, maybe it is important.

In case you wonder if the content really was the same this is /home/koumakpet/.vscode-oss/autoDocstring/test file, which I specified to be used:

image

ItsDrike avatar Apr 07 '20 17:04 ItsDrike

Can you post the function you are trying to generate the docstring for? Is it working for other docstringFormats?

NilsJPWerner avatar Apr 07 '20 20:04 NilsJPWerner

I tried it on multiple functions, none of them worked, some had just 1 argument, others had multiple arguments and some keyword arguments, so I don't really think the specific function is important.

The other docstring formats are not working either, as I said, I've tried it on google and numpy formats (assuming the correct syntax was just to do "autoDocstring.docstringFormat": "google". Each format, except for the default one only gave me the summary, it was as if it just wasn't detecting any args/kwargs/returns/...

ItsDrike avatar Apr 08 '20 01:04 ItsDrike

Have you tried running the extension without any other extensions activated?

It is strange that the default format works but the others do not since they are accessed the same way. There might be some difference in how the vscode settings api works in arch linux. I will try and spin up an arch linux vm to recreate the issue. What version of vscode are you using?

NilsJPWerner avatar Apr 08 '20 13:04 NilsJPWerner

image

I do have quite a lot of extensions so it is possible that some could cause it, but I don't quite see what could go wrong, other extensions doesn't really change the content of other files than default or anything like that so I really don't know.

ItsDrike avatar Apr 08 '20 20:04 ItsDrike

Any followups on this?

ItsDrike avatar May 13 '20 21:05 ItsDrike

I found that the setting has to be placed in either the User or Workspace settings file. It wont work at the folder level

jonlundy avatar May 20 '20 16:05 jonlundy

Hi @ItsDrike is this still a problem? If so can you check the autodocstring output log when it runs. I have added some debugging functionality.

NilsJPWerner avatar Jun 30 '20 13:06 NilsJPWerner

Hello! I am actually experiencing this issue now. i am trying to switch from the default to docBlockr but it's not working. I turned on DEBUG to try and grab more info but that option is not applying as well. I also disabled all other extensions while testing

I am on Windows 10. So far the settings I've tested has had no effect: docstringFormat logLevel

And these settings are turning off and on as expected: includeExtendedSummary includeName quoteStyle

I don't think the "guess" option every really did work for me so I could not tell the status of that I also don't know how to operate the new line option as it just seems to break docstring for me

Philipose avatar Sep 24 '20 14:09 Philipose

I did some investigation and it seems like the logic for switching to docBlockr does not actually exist, despite it being an option.

Looking at this file: src/docstring/get_template.ts

I noticed it only has google, sphinx and numpy. Switching to Sphinx did work, it's like that because there's no entry for switching to docBlockr.

As far as logging levels, I also tried none but to no effect. I will try to investigate and test if I can add it as well

Philipose avatar Sep 24 '20 14:09 Philipose