oouo-diogo-perdigao / vscode-docthis Goto Github PK
View Code? Open in Web Editor NEWThis project forked from joelday/vscode-docthis
JSDoc generator extension for Visual Studio Code.
License: MIT License
This project forked from joelday/vscode-docthis
JSDoc generator extension for Visual Studio Code.
License: MIT License
Currently, the extension doesn't support arrow functions and arrow function methods. VSCode has a basic support for it. For arrow functions, handling just like normal functions works fine. For arrow function methods, an additional tag @method
is necessary, since JSDoc understand it as an class property.
When trying to generate documentation for a private member, it just documents the class:
class Foo {
#bar (a, b){
// ...
}
}
Expected:
class Foo {
/**
*
* @param {*} a
* @param {*} b
*/
#bar (a, b){
// ...
}
}
Actually:
/**
*
* @class Foo
*/
class Foo {
#bar (a, b){
// ...
}
}
Support for the official TSDoc (https://tsdoc.org/) would be very useful.
Vue2 and Vue3 support plz!
Like:
//Vue2
methods: {
/**
* something here!
*/
func(paramA, paramB){
//something here
return ;
}
}
This is an awesome plugin, to the point where I can't even imagine my life without it !
I believe this plugin will become very popular in the future.
Is it possible to docuemtn the code after typing "/**" and then pressing TAB instead of having to do CTRL + ALT + D? Like replace the default documentation with this extension's documentation.
First of all, thank you SO much for the wonderful extension!
Description:
Hello there, there seems to be a rather annoying issue. Whenever you use the extension the line above gets overwritten, if you had something declared, it gets deleted.
Steps to reproduce:
const someVar: string; // <-- This will be deleted
const someOtherVar: string; // <--Try documenting this
Expected result:
Line should be respected and stay while documenting the intended line.
Actual:
Line above gets deleted:
/**
*
*
* @type {string}
*/
var someOtherVar: string;
Workaround:
Easiest thing is to insert a line break in between them and then document. This is rather annoying.
prefer
/**
* Assign the project to an employee.
* @param {Object} employee - The employee who is responsible for the project.
* @param {string} employee.name - The name of the employee.
* @param {string} employee.department - The employee's department.
*/
Project.prototype.assign = function({ name, department }) {
// ...
};
but get
/**
*
*
* @param {*} { name, department }
* @return {*}
*/
Project.prototype.assign = function({ name, department }) {
// ...
};
https://jsdoc.app/tags-param.html Documenting a destructuring parameter
Now there's no indent would be added after *
, we need an option to add indents.
It is just like Vue, maybe it would be beneficial to add it?
Dear All,
How can I create interface fields with this extension into jsdoc?
Current result:
/**
*
*
* @interface WorksOfDaysOfEmployment
*/
interface WorksOfDaysOfEmployment {
employment: components["schemas"]["EmploymentRelationshipDTOForClient"],
worksOfDays:WorksOfDay
}
Goal to be achieved:
/**
* @interface WorksOfDaysOfEmployment
* @property {components["schemas"]["EmploymentRelationshipDTOForClient"]} employment - Az alkalmazotti kapcsolat.
* @property {WorksOfDay} worksOfDays - Az egyes napokon végzett munkák tömbjei.
*/
interface WorksOfDaysOfEmployment {
employment: components["schemas"]["EmploymentRelationshipDTOForClient"],
worksOfDays:WorksOfDay
}
I'm the author of the Spin2 VSCode Extension.
I also hook ctrl+alt-D. My extension is active for .spin and .spin2 files. When both of our extensions are installed this one (doc this) intercepts the ctrl+alt-D request and generates an error saying it only supports javascript and typescript. Then my extension doesn't get the keystroke.
How about you only intercept the keystroke if it's against one of the document suffixes you support? Alternatively, at least let the keystroke be passed on to other extensions!
Doesn't work for .vue components?
try to Document this,
methods: {
clear() {
this.clearData()
this.$router.push('/wwwww')
......
}
}
and getting error
Sorry! 'Document This' wasn't able to produce documentation at the current position.
How can I apply the JsDocs to full projects at once? It can be with this extension or a CLI command.
When generating a JSDoc for an ES5 class, this is generated by default:
/**
*
* @class Bar
*/
class Bar {}
The problem is, in JSDoc 3, ES5 classes are automatically recognized. Doing this generates 2 Bar class declarations.
Adding the @Class as an optional generator would fix it.
If I type /**
and hit Enter, when DT can add documentation for me, great. But when it cannot it makes my entire comment disappear instead of just letting me edit manually which means I have to employ hacks to actually be able to add documentation to my code!
This is so annoying that I'm uninstalling the extension.
Works great in .js and .ts files, but in .vue files the extension fails with Sorry! 'Document This' wasn't able to produce documentation at the current position.
For example, this computed property:
private get assetDisplayName(): string {
if (asset.enabled) {
return 'enabled';
}
return 'disabled';
}
I see in extension.ts
that you are supporting Vue files, but it seems like something is broken maybe?
Thank you 🙏
it would be nice if you left a kep mapping for mac users also.. thanks.
P.S. cant find it in the web
Your extensions always activates and slows down vscode startup regardless of if it is used, you should add contextual activationevents to only activate when necessary. Thanks!
https://code.visualstudio.com/api/references/activation-events
Hi there,
When I set IncludeTypes to false inside of the settings of the plugin, the @returns still has type annotation for a "any" object type like so:
/**
* @returns {*}
*/
Is there a way to remove the {*} part? Since typescript is generating warnings because of this.
Please let me know what I can do to generate proper typescript JSDoc for my code.
@return
can not get type,so I don't need it ,how to disable generate?
Not sure how involved this would be but would it be possible to update existing documentation when re-running the extension? It should update the params, and types, but it shouldn't remove added descriptions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.