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

Reduce number of parse calls #58

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

Discookie
Copy link
Collaborator

Fixes #39.

The extension no longer executes a parse call when:

src/backend/processor/diagnostics.ts Outdated Show resolved Hide resolved
Comment on lines 81 to 82
const dummyData: ParseResult = { reports: [], version: 1 };
this.parseDiagnosticsData(JSON.stringify(dummyData));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like this approach that we are creating a dummy data only to call this function. Why do we need to call parseDiagnosticsData here? To initialize this._diagnosticEntries and other variables? In this case we can initialize these fields here too. Also if it contains some extra logic we can create a separate function for it and we can call it here and in the parseDiagnosticsData function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the field initializations here.

The parseMetadata does a little bit of extra processing when deciding whether this._selectedEntry should be kept, but selectedEntry cannot exist inside the unloading if, so it's no concern here.

@csordasmarton csordasmarton added this to the 1.0.1 milestone Jan 28, 2022
@Discookie Discookie force-pushed the ericsson/fix-double-parse branch from 5b250e8 to c95cb6d Compare January 28, 2022 13:06
Does not call parse:
* When open files did not change
* When there's no files open
* When an opened window is an 'output://' window
@Discookie Discookie force-pushed the ericsson/fix-double-parse branch from c95cb6d to 2421b52 Compare January 28, 2022 13:11
Copy link
Contributor

@csordasmarton csordasmarton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@csordasmarton csordasmarton merged commit 65747d4 into Ericsson:main Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CodeChecker parse command runs twice when changing between opening files
2 participants