Rubberduck icon indicating copy to clipboard operation
Rubberduck copied to clipboard

Add multiple untyped declaration example for rubberduckvba.com

Open IvenBach opened this issue 4 years ago • 5 comments

Justification It's much more common to see the code below:

Public Sub Foo()
    Dim i, j, k As Long
    'code
End Sub

than it is to see:

Public Sub Foo()
    Dim i As Long, j As Long, k As Long
    'code
End Sub

This is a very common pitfall. Example code in a MultipleDeclarations inspection that looks more like what new programmers would write can help those seeing it understand the inspection.

Description Add an example with multiple declarations on a single line without typing.

IvenBach avatar Jul 05 '21 01:07 IvenBach

This example should also be added to VariableTypeNotDeclaredInspection.

Since the website content is automatically generated from the xml-doc comments, this example, together with the corresponding examples not triggering the inspection, should be added to the xml-docs.

MDoerner avatar Jul 05 '21 08:07 MDoerner

IMO the existing examples should remain, and an additional two (?) examples would show the "more common" case with implicit variants (perhaps reorder the examples to put the new ones first); the reason this particular example is specifying explicit data types is because we want the emphasis to be on what triggers this inspection - implicit variant declarations being flagged by a separate inspection with its own examples.

retailcoder avatar Jul 05 '21 17:07 retailcoder

Hey I would like to contribute, but I'm not entirely sure what the proposal is. Can I get some more information?

pedro-camargo11 avatar Sep 14 '22 02:09 pedro-camargo11

@pedro-camargo11 basically the suggestion is to add the first codeblock as an additional example to the following XML-documentation:

https://github.com/rubberduck-vba/Rubberduck/blob/b53f353bdba34ebc4e0baca2a7b39254e29da262/Rubberduck.CodeAnalysis/Inspections/Concrete/MultipleDeclarationsInspection.cs#L11-L31

The syntax for the XML should be fairly obvious. That XML is automatically used to generate the content on the website that is served as user-documentation.

Vogel612 avatar Sep 14 '22 03:09 Vogel612

Hi @Vogel612 Actually I´ve Done this task. Can u review the fix?

GmausDev avatar Oct 12 '22 21:10 GmausDev