20Tauri / DoxyDoxygen

The last word in code documentation generation
140 stars 5 forks source link

[C++] alt + q does not work for class member variable #157

Open jasjuang opened 3 years ago

jasjuang commented 3 years ago

Please see the below minimal example

class sample {
 public:
  static constexpr int a = 3;
};

When I move my cursor on the line of static constexpr int a = 3, I am expecting alt + q to give me

class sample {
 public:
  /**
   * @brief      { variable_description }
   */
  static constexpr int a = 3;
};

but instead it ignores the variable and generate comments for the class instead like the below

/**
 * @brief      This class describes a sample.
 */
class sample {
 public:
  static constexpr int a = 3;
};
20Tauri commented 3 years ago

Thank you for reporting

It's a known problem

Alt+Q use SublimeText grammar to detect the nearest entity and unfortunatly the scope is source.c++ meta.class.c++ meta.block.c++. So no way to be sure of the entity (before applying the internal parser that produces the docblock) To "fix" this problem, the approach should be changed. Using the internal parser by successive tests would decrease performance and detect too many things (function variable ...), not sure that was a good idea. So for now, this limitation will probably still be present