Added code-runner-output and arduino-output to filtered out outputs

This commit is contained in:
Juha Ristolainen 2020-01-06 14:42:11 +00:00
parent 75f1767d3d
commit a5430b9acf
No known key found for this signature in database
GPG Key ID: D42FA9BA33B05AA9
3 changed files with 23 additions and 2 deletions

View File

@ -2,6 +2,13 @@
All notable changes to the "code-stats-vscode" extension will be documented in this file.
## [1.0.16] - 2020-01-06
### Changed
Updated dependencies.
Filtered out certain output types like code runner output, etc.
## [1.0.15] - 2019-04-04
### Changed

View File

@ -24,6 +24,11 @@ This extension contributes the following settings:
## Release Notes
### 1.0.16
Updated dependencies.
Added filtering out of some output languages like code runner, etc.
### 1.0.15
Added Q# to languages.

View File

@ -27,6 +27,12 @@ export class XpCounter {
// wait 10s after each change in the document before sending an update
private UPDATE_DELAY = 10000;
// List of detected output languages to filter out and not send to the backend.
private filterOutLanguages: string[] = [
"arduino-output",
"code-runner-output"
]
constructor(context: ExtensionContext) {
this.pulse = new Pulse();
this.initAPI();
@ -127,8 +133,11 @@ export class XpCounter {
}
private isSupportedLanguage(language: string): boolean {
// todo: check supported languages
// only update xp if one of supported languages
// Check if detected language is something we don't want to send to backend like the code runner output
if (this.filterOutLanguages.includes(language)) {
console.log("Filtering out " + language);
return false;
}
return true;
}