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 duplicate issues on provider usage #260

Merged
merged 3 commits into from
Nov 29, 2023
Merged

Conversation

pwrightcertinia
Copy link
Contributor

fixes apex-dev-tools/tooling-issues#129

Some of the providers use getValidationMap which involves calling validate again on a given block/body. This would cause a duplicate issue to be saved, so these calls are suppressed by the VerifyContext.

This requires calling log, logError etc. via the context (or children) rather than directly through OrgInfo. Some of the CST types don't do this, and it is a lot more apparent now because we have the hover provider firing quite often (despite it only supporting a very limited number of symbols/cases).

This should cover all the cst types, the issues are only disabled at the class body declaration level and below. So uses of OrgInfo elsewhere in the TypeDeclaration like create/validate aren't getting suppressed, but the type already exists so...

I had to do something a bit unusual passing context in to block.statements() as it reports syntax/parser issues during construction of the block. But it is an Option so if you were to construct it elsewhere without a context (e.g. RenameProvider) then it effectively suppresses the extra issues from coming out again.

@pwrightcertinia pwrightcertinia merged commit 4ea2651 into main Nov 29, 2023
2 checks passed
@pwrightcertinia pwrightcertinia deleted the fix-duplicate-issues branch November 29, 2023 14:26
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.

1 participant