@@ -26,11 +26,11 @@ export class DecorationProvider implements vscode.FileDecorationProvider {
2626 public onDidChangeFileDecorations : vscode . Event <
2727 vscode . Uri | vscode . Uri [ ] | undefined
2828 > ;
29- private _eventEmiter : vscode . EventEmitter < vscode . Uri | vscode . Uri [ ] > ;
29+ private eventEmitter : vscode . EventEmitter < vscode . Uri | vscode . Uri [ ] > ;
3030
3131 constructor ( ) {
32- this . _eventEmiter = new vscode . EventEmitter ( ) ;
33- this . onDidChangeFileDecorations = this . _eventEmiter . event ;
32+ this . eventEmitter = new vscode . EventEmitter ( ) ;
33+ this . onDidChangeFileDecorations = this . eventEmitter . event ;
3434 this . disposables . push (
3535 vscode . window . registerFileDecorationProvider ( this )
3636 ) ;
@@ -39,34 +39,27 @@ export class DecorationProvider implements vscode.FileDecorationProvider {
3939 public provideFileDecoration (
4040 uri : vscode . Uri
4141 ) : vscode . ProviderResult < vscode . FileDecoration > {
42- let currentPrjDir ,
43- prjConfigDir ,
44- configFilePath ,
45- configData ,
46- includePathArr = new Array ( ) ,
47- excludeFileArr = new Array ( ) ,
48- pathRelative ;
49-
50- /* Read include_paths and exclude_fils from the config file */
51- currentPrjDir =
42+ const currentPrjDir =
5243 os . platform ( ) === 'win32'
5344 ? ( vscode . workspace . workspaceFolders ?. [ 0 ] . uri . fsPath as string )
5445 : os . platform ( ) === 'linux' || os . platform ( ) === 'darwin'
55- ? ( currentPrjDir = vscode . workspace . workspaceFolders ?. [ 0 ] . uri
56- . path as string )
46+ ? ( vscode . workspace . workspaceFolders ?. [ 0 ] . uri . path as string )
5747 : '' ;
5848
59- pathRelative = ( uri . fsPath ? uri . fsPath : uri . toString ( ) ) . replace (
49+ const pathRelative = ( uri . fsPath ? uri . fsPath : uri . toString ( ) ) . replace (
6050 currentPrjDir ,
6151 '..'
6252 ) ;
6353
64- prjConfigDir = path . join ( currentPrjDir , '.wamr' ) ;
65- configFilePath = path . join ( prjConfigDir , 'compilation_config.json' ) ;
54+ const prjConfigDir = path . join ( currentPrjDir , '.wamr' ) ;
55+ const configFilePath = path . join (
56+ prjConfigDir ,
57+ 'compilation_config.json'
58+ ) ;
6659 if ( readFromFile ( configFilePath ) !== '' ) {
67- configData = JSON . parse ( readFromFile ( configFilePath ) ) ;
68- includePathArr = configData [ 'include_paths ' ] ;
69- excludeFileArr = configData [ 'exclude_files ' ] ;
60+ const configData = JSON . parse ( readFromFile ( configFilePath ) ) ;
61+ const includePathArr = configData [ 'includePaths ' ] ;
62+ const excludeFileArr = configData [ 'excludeFiles ' ] ;
7063
7164 if ( includePathArr . indexOf ( pathRelative ) > - 1 ) {
7265 return DECORATION_INCLUDE_PATHS ;
@@ -81,7 +74,7 @@ export class DecorationProvider implements vscode.FileDecorationProvider {
8174 }
8275
8376 public updateDecorationsForSource ( uri : vscode . Uri ) : void {
84- this . _eventEmiter . fire ( uri ) ;
77+ this . eventEmitter . fire ( uri ) ;
8578 }
8679}
8780
0 commit comments