Skip to content

Reduce number of parse calls#58

Merged
csordasmarton merged 1 commit intoEricsson:mainfrom
Discookie:ericsson/fix-double-parse
Jan 31, 2022
Merged

Reduce number of parse calls#58
csordasmarton merged 1 commit intoEricsson:mainfrom
Discookie:ericsson/fix-double-parse

Conversation

@Discookie
Copy link
Copy Markdown
Collaborator

Fixes #39.

The extension no longer executes a parse call when:

Comment thread src/backend/processor/diagnostics.ts Outdated
Comment thread src/backend/processor/diagnostics.ts Outdated
Comment on lines +81 to +82
const dummyData: ParseResult = { reports: [], version: 1 };
this.parseDiagnosticsData(JSON.stringify(dummyData));
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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