:chore: some code cleanup

- use readonly for static ids
- prefer undefined over null in my code
- remove some obsolete todos
- do not require Promise from action.run()
This commit is contained in:
Benjamin Pasero
2021-05-03 10:53:20 +02:00
parent b0334d2c19
commit 51ed283cc5
24 changed files with 65 additions and 65 deletions

View File

@@ -247,7 +247,7 @@ export class CodeApplication extends Disposable {
//#endregion
let macOpenFileURIs: IWindowOpenable[] = [];
let runningTimeout: NodeJS.Timeout | null = null;
let runningTimeout: NodeJS.Timeout | undefined = undefined;
app.on('open-file', (event, path) => {
this.logService.trace('app#open-file: ', path);
event.preventDefault();
@@ -256,9 +256,9 @@ export class CodeApplication extends Disposable {
macOpenFileURIs.push(this.getWindowOpenableFromPathSync(path));
// Clear previous handler if any
if (runningTimeout !== null) {
if (runningTimeout !== undefined) {
clearTimeout(runningTimeout);
runningTimeout = null;
runningTimeout = undefined;
}
// Handle paths delayed in case more are coming!
@@ -272,7 +272,7 @@ export class CodeApplication extends Disposable {
});
macOpenFileURIs = [];
runningTimeout = null;
runningTimeout = undefined;
}, 100);
});