nikhilkalige / docblockr

DocBlockr is a package for Atom which is designed to make writing documentation faster and easier.
MIT License
406 stars 93 forks source link

Replace type by parameter name (C++) #359

Open alve89 opened 3 years ago

alve89 commented 3 years ago

I'm using your package for documenting my C++ code. For documentation I'm using Doxygen, which expects as second part of the @param line the variable name. Your package automatically generates the variable type. Is there

  1. a way to change that quick-and-dirty and, much more important,
  2. a chance you either change that in your package or - rather - add an option in the package settings, e. g. which part of the function declaration should automatically be added?

    This is how it currently is (auto-generated comment)
    /**
     * [getTemperature description]
     * @param  byte [description]
     * @return      [description]
     */
    float getTemperature(uint8_t);
    
    This is how it could be with set the second part to 'variable name' 
    /**
     * [getTemperature description]
     * @param  sensorId [description]
     * @return  [description]
     */
    float getTemperature(uint8_t sensorId);
    
    This would be the perfect solution, but I don't know if your package can handle this
    /**
     * [getTemperature description]
     * @param  sensorId    [description]
     * @return  [description]
     */
    float getTemperature(uint8_t); // parameter name is not necessary in the declaration => get the parameter name from the cpp file, if no name is given in the declaration
MoritzKn commented 3 years ago

Yes, this makes sense. I don't see the point of having the types for C++ comments at all. I think for some languages this is already the case (e.g. TypeScript IIRC). Should be an easy enough change. Feel free to have a look and submit a PR.

But keep in mind this package is pretty much unmaintained: All I am doing at the moment is merging PRs. Be prepared to dive into the code on your own. It's been so long, even if I had the time, I probably couldn't help you much anyways.