Skip to content

Commit bb56b97

Browse files
committed
Cleanup promise handling
1 parent a539bc4 commit bb56b97

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/debugserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export async function resolveMainMethodsCurrentFile(): Promise<MainMethodResult>
1919

2020
async function resolveMainMethod(document: TextDocument): Promise<MainMethodResult> {
2121
const resourcePath = getJavaResourcePath(document);
22-
return await executeCommand(Commands.JAVA_RESOLVE_MAINMETHOD, resourcePath);
22+
return executeCommand(Commands.JAVA_RESOLVE_MAINMETHOD, resourcePath);
2323
}
2424

2525
export async function resolveClassPathCurrentFile(): Promise<IClassPath> {

src/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { onConfigurationChange, updateDebugSettings } from './settings';
1212
export async function activate(context: ExtensionContext): Promise<void> {
1313
registerCommands(context);
1414
context.subscriptions.push(onConfigurationChange());
15-
return Promise.resolve();
1615
}
1716

1817
function registerCommands(context: ExtensionContext): void {
@@ -50,7 +49,6 @@ async function startVimspector(...args: any[]): Promise<any> {
5049
const debugConfig = workspace.getConfiguration('java.debug');
5150
// See package.json#configuration.properties
5251
const vars = debugConfig.get<ISubstitutionVar>('vimspector.substitution');
53-
5452
const overrides = getOverrides(args);
5553

5654
const settings = {
@@ -102,11 +100,10 @@ function parseOverrides(args: string): any {
102100
return overrides;
103101
}
104102

105-
function showCommandResult(func: () => Promise<any>): (...args: any[]) => Promise<void> {
103+
function showCommandResult(func: () => Promise<any>): (...args: any[]) => Promise<string | undefined> {
106104
return async () => {
107105
const result = await func();
108106
const json = JSON.stringify(result, null, 2);
109-
window.showInformationMessage(json);
110-
return Promise.resolve();
107+
return window.showInformationMessage(json);
111108
};
112109
}

0 commit comments

Comments
 (0)