@@ -6,33 +6,31 @@ import DeepCodeFilesWatcher from "../watchers/DeepCodeFilesWatcher";
66import DeepCodeWorkspaceFoldersWatcher from "../watchers/WorkspaceFoldersWatcher" ;
77import DeepCodeEditorsWatcher from "../watchers/EditorsWatcher" ;
88import DeepCodeSettingsWatcher from "../watchers/DeepCodeSettingsWatcher" ;
9- // import DeepCodeErrorhandler from "../errorHandler/DeepCodeErrorHandler";
109import { IDE_NAME } from "../../constants/general" ;
1110
1211export default abstract class BaseDeepCodeModule implements DeepCode . BaseDeepCodeModuleInterface {
13- public currentWorkspacePath : string ;
14- public workspacesPaths : Array < string > ;
15- public hashesBundles : DeepCode . HashesBundlesInterface ;
16- public serverFilesFilterList : DeepCode . AllowedServerFilterListInterface ;
17- public remoteBundles : DeepCode . RemoteBundlesCollectionInterface ;
18- public analyzer : DeepCode . AnalyzerInterface ;
19- public statusBarItem : DeepCode . StatusBarItemInterface ;
20- public filesWatcher : DeepCode . DeepCodeWatcherInterface ;
21- public workspacesWatcher : DeepCode . DeepCodeWatcherInterface ;
22- public editorsWatcher : DeepCode . DeepCodeWatcherInterface ;
23- public settingsWatcher : DeepCode . DeepCodeWatcherInterface ;
24- // public errorHandler: DeepCode.ErrorHandlerInterface;
12+ currentWorkspacePath : string ;
13+ workspacesPaths : Array < string > ;
14+ hashesBundles : DeepCode . HashesBundlesInterface ;
15+ serverFilesFilterList : DeepCode . AllowedServerFilterListInterface ;
16+ remoteBundles : DeepCode . RemoteBundlesCollectionInterface ;
17+ analyzer : DeepCode . AnalyzerInterface ;
18+ statusBarItem : DeepCode . StatusBarItemInterface ;
19+ filesWatcher : DeepCode . DeepCodeWatcherInterface ;
20+ workspacesWatcher : DeepCode . DeepCodeWatcherInterface ;
21+ editorsWatcher : DeepCode . DeepCodeWatcherInterface ;
22+ settingsWatcher : DeepCode . DeepCodeWatcherInterface ;
2523
2624 // Views and analysis progress
27- public refreshViewEmitter : vscode . EventEmitter < any > ;
28- public analysisStatus : string = '' ;
29- public analysisProgress : number = 0 ;
25+ refreshViewEmitter : vscode . EventEmitter < any > ;
26+ analysisStatus = '' ;
27+ analysisProgress = 0 ;
3028
3129 // These attributes are used in tests
32- public staticToken = '' ;
33- public staticBaseURL = '' ;
34- public defaultBaseURL = 'https://www.deepcode.ai' ;
35- public staticUploadApproved = false ;
30+ staticToken = '' ;
31+ staticBaseURL = '' ;
32+ defaultBaseURL = 'https://www.deepcode.ai' ;
33+ staticUploadApproved = false ;
3634
3735 constructor ( ) {
3836 this . currentWorkspacePath = "" ;
@@ -46,52 +44,51 @@ export default abstract class BaseDeepCodeModule implements DeepCode.BaseDeepCod
4644 this . workspacesWatcher = new DeepCodeWorkspaceFoldersWatcher ( ) ;
4745 this . editorsWatcher = new DeepCodeEditorsWatcher ( ) ;
4846 this . settingsWatcher = new DeepCodeSettingsWatcher ( ) ;
49- // this.errorHandler = new DeepCodeErrorhandler();
5047 this . refreshViewEmitter = new vscode . EventEmitter < any > ( ) ;
5148 this . analysisStatus = '' ;
5249 this . analysisProgress = 0 ;
5350 }
5451
55- public get baseURL ( ) : string {
52+ get baseURL ( ) : string {
5653 // @ts -ignore */}
5754 return this . staticBaseURL || vscode . workspace . getConfiguration ( 'deepcode' ) . get ( 'url' ) || this . defaultBaseURL ;
5855 }
5956
60- public get termsConditionsUrl ( ) : string {
57+ get termsConditionsUrl ( ) : string {
6158 return `${ this . baseURL } /tc?utm_source=vsc` ;
6259 }
6360
64- public get token ( ) : string {
61+ get token ( ) : string {
6562 // @ts -ignore */}
6663 return this . staticToken || vscode . workspace . getConfiguration ( 'deepcode' ) . get ( 'token' ) ;
6764 }
6865
69- public async setToken ( token : string ) : Promise < void > {
66+ async setToken ( token : string ) : Promise < void > {
7067 this . staticToken = '' ;
7168 await vscode . workspace . getConfiguration ( 'deepcode' ) . update ( 'token' , token , true ) ;
7269 }
7370
74- public get source ( ) : string {
71+ get source ( ) : string {
7572 return process . env [ 'GITPOD_WORKSPACE_ID' ] ? 'gitpod' : IDE_NAME ;
7673 }
7774
78- public get uploadApproved ( ) : boolean {
75+ get uploadApproved ( ) : boolean {
7976 return this . staticUploadApproved || this . source !== IDE_NAME || ! ! ( vscode . workspace . getConfiguration ( 'deepcode' ) . get ( 'uploadApproved' ) ) ;
8077 }
8178
82- public async setUploadApproved ( value : boolean = true ) : Promise < void > {
79+ async setUploadApproved ( value = true ) : Promise < void > {
8380 await vscode . workspace . getConfiguration ( 'deepcode' ) . update ( 'uploadApproved' , value , true ) ;
8481 }
8582
86- public get shouldReportErrors ( ) : boolean {
83+ get shouldReportErrors ( ) : boolean {
8784 return ! ! vscode . workspace . getConfiguration ( 'deepcode' ) . get ( 'yesCrashReport' ) ;
8885 }
8986
90- public get shouldReportEvents ( ) : boolean {
87+ get shouldReportEvents ( ) : boolean {
9188 return ! ! vscode . workspace . getConfiguration ( 'deepcode' ) . get ( 'yesTelemetry' ) ;
9289 }
9390
94- public refreshViews ( content ?: any ) : void {
91+ refreshViews ( content ?: any ) : void {
9592 this . refreshViewEmitter . fire ( content || undefined ) ;
9693 }
9794
0 commit comments