The Wayback Machine - https://web.archive.org/web/20210815103201/https://github.com/rubberduck-vba/Rubberduck/issues/5829
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiple untyped declaration example for rubberduckvba.com #5829

Open
IvenBach opened this issue Jul 5, 2021 · 2 comments
Open

Add multiple untyped declaration example for rubberduckvba.com #5829

IvenBach opened this issue Jul 5, 2021 · 2 comments

Comments

@IvenBach
Copy link
Member

@IvenBach IvenBach commented Jul 5, 2021

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.

@MDoerner
Copy link
Contributor

@MDoerner MDoerner commented Jul 5, 2021

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.

@retailcoder
Copy link
Member

@retailcoder retailcoder commented Jul 5, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants