DoxyIt icon indicating copy to clipboard operation
DoxyIt copied to clipboard

Member Variable / Class Documentation Support

Open ntjess opened this issue 6 years ago • 7 comments

It would be great if DoxyIt supported class and member variable documentation as well.

Ideally this would be implemented as additional radio buttons near the top of the settings dialog: image

[QtCreator demonstrates this behavior, but is not nearly as customizable as your wonderful plugin].

ntjess avatar Jan 23 '19 00:01 ntjess

I agree that this would be a nice feature to have. I'd like to offer a more flexible alternative by having a method to add user defined format types: DoxyIt Feature Request 6-22-2019

This would allow support for any user defined format including classes and alternate styles of comment blocks so you don't have to change the settings if you are working with code that uses a different style of comment blocks.

Bartimaeus- avatar Jun 22 '19 20:06 Bartimaeus-

@Bartimaeus- I agree this is definitely a nice way to add some flexibility to allow multiple formats for each language. However there is alot more that goes into it than just specifying a format. It would also then require a whole separate GUI to input and test the regular expressions for each 'format', and then dynamically adjust the plugin menu based on what type of file is opened. Again it is doable, just not easy.

dail8859 avatar Jun 26 '19 22:06 dail8859

@dail8859 that does seem like a lot of work. I guess that I wasn't really thinking about defining "formats" that were context-aware in the way that the "Function" and "File" formats are done and was more thinking of it an auto-completer function.

Absurd example: image

Where anywhere you type //hammer and hit enter/tab it would fill out that section. The practical uses that I was thinking of would be for putting documentation after members in classes or for inserting general purpose blocks of text into a file

example line: int var; /*!< Detailed description after the member */ where typing /*! and hitting Tab would autocomplete the rest of the tag: int var; /*!< */ (ideally placing the cursor in the middle of the block for typing)

All of that being said, I can totally understand not wanting to put in the effort to do what I'm describing, and I don't want this to distract from the original feature request. Support for class and member variables would be a very great add without any of what I talked about above to try and generalize the feature.

Bartimaeus- avatar Jul 02 '19 00:07 Bartimaeus-

...was more thinking of it an auto-completer function.

For this kind of functionality I'd recommend a plugin specifically made to handle snippets. I have used some in the past but it was quite a while ago. I know you could specify keywords and the press tab to expand the snippets, which sounds exactly like what you are wanting.

dail8859 avatar Jul 02 '19 00:07 dail8859

I would also love to see the shortcut Ctrl+Alt+Shift+D to automatically recognize if my cursor is in front of a class, property or method (the last one you already did). Not sure about other languages (or user defined languages) since I only code in PHP.

I do use the Snippets plugin, but would love to see everything I need in one place, under one shortcut, specifically because of the tab jump locations.

Basically, the GUI would need to be altered to accommodate 2 more templates/formats. As I understood, then you only need the regexes, which is not my best field.

I imagine a regex to check if there is a word class in the next line, which is probably the easiest thing, but I'm not sure about the property regex. Maybe if no other expression match (is it a class or method/function) but you do have one of [public|static|protected|private] words, then it must be a property?

Anyway, I really like this plugin, but seems like this would double it's usability, at least in my case.

EDIT: I forgot about some more templates/formats: the interface and trait, as well as require(_once) and include(_once), for which I also feel like creating regular expressions shouldn't be a big deal.

andrija-naglic avatar Jul 26 '19 16:07 andrija-naglic

I'll definitely try to give this some thought soon.

My biggest dread is doing anything GUI related at all. All the plugins I developed after this one have minimal or no GUIs at all. Win32 GUIs are a huge pain. The settings dialog for DoxyIt is already painful enough without it being very dynamic at all.

Also, to efficiently parse out programming language features with just regular expressions can potentially lead to false-positives, lots of corner cases, and ambiguities. Regular expressions such as (?:([\\w:]+)[*&]*\\s+(?:[*&=]*\\s+)?[*&]*)?([^\\s\\(]+)\\s*(\\([^)]*\\)) are not fun to test or modify.

Again overall this feature is definitely a great idea if it can be done correctly. I just don't know how much effort it will take.

dail8859 avatar Jul 26 '19 17:07 dail8859

I hear you and I assumed it would be difficult. I'm also sorry I can't help more since it's not my area of expertise but I hope this thread will get more attention and someone else might get interested in creating a PR .)

On Fri, Jul 26, 2019, 19:47 dail8859 [email protected] wrote:

I'll definitely try to give this some thought soon.

My biggest dread is doing anything GUI related at all. All the plugins I developed after this one have minimal or no GUIs at all. Win32 GUIs are a huge pain. The settings dialog for DoxyIt is already painful enough without it being very dynamic at all.

Also, to efficiently parse out programming language features with just regular expressions can potentially lead to false-positives, lots of corner cases, and ambiguities. Regular expressions such as (?:([\w:]+)[&]\s+(?:[&=]\s+)?[&])?([^\s\(]+)\s*(\([^)]*\)) are not fun to test or modify.

Again overall this feature is definitely a great idea if it can be done correctly. I just don't know how much effort it will take.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dail8859/DoxyIt/issues/20?email_source=notifications&email_token=AAZHIC73DES56CWGDS3FO7DQBM2BLA5CNFSM4GRXCK7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD25IVPI#issuecomment-515541693, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZHICZC4AWDP2RFUQPKRKLQBM2BLANCNFSM4GRXCK7A .

andrija-naglic avatar Jul 26 '19 18:07 andrija-naglic