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

Fix module annotation recognition #4401

Conversation

MDoerner
Copy link
Contributor

@MDoerner MDoerner commented Oct 2, 2018

This PR changes two points regarding how the DeclarationSymbolsListener finds annotations:

  1. It is now able to find member annotations even if these are line-continued. Previously, it was expecting at least one annotation per physical line, not logical line.
  2. The determination of the declaration section is no longer delegated to the VBE. Now, it ends on the first line above the member annotations of the first module body element, i.e. on the first physical line above the block of consecutive logical lines right above the first module body element.

Before, the DeclarationSymbolsListener assumed to have at least one annotations starting in each physical line above the member still belonging to the annotations section for the member. That failed terribly when introducing line continuations. Only logical lines should count.
The DeclarationSymbolsListener previously relied on the VBE to determine the declarations section, in which we allow the module annotations to be. Unfortunately, it is often rather counterintuitive how the VBE determines this section. Thus, this PR introduces our own consistent logic.
@codecov
Copy link

codecov bot commented Oct 2, 2018

Codecov Report

Merging #4401 into next will increase coverage by 0.01%.
The diff coverage is 96.97%.

@@            Coverage Diff             @@
##             next    #4401      +/-   ##
==========================================
+ Coverage   57.91%   57.92%   +0.01%     
==========================================
  Files         953      953              
  Lines       33313    33325      +12     
==========================================
+ Hits        19290    19301      +11     
- Misses      14023    14024       +1
Impacted Files Coverage Δ
...s/QuickFixes/RemoveDuplicatedAnnotationQuickFix.cs 86.67% <ø> (-2.22%) ⬇️
...duck.Parsing/Symbols/DeclarationSymbolsListener.cs 98.36% <96.97%> (-0.11%) ⬇️

@retailcoder retailcoder merged commit 496dcf9 into rubberduck-vba:next Oct 2, 2018
@MDoerner MDoerner deleted the MakeModuleAnnotationRecognitionIndependentOfTheVBE branch October 9, 2018 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants