Skip to content

Commit

Permalink
Cleanup promise handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dansomething committed Jul 20, 2024
1 parent a539bc4 commit bb56b97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/debugserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function resolveMainMethodsCurrentFile(): Promise<MainMethodResult>

async function resolveMainMethod(document: TextDocument): Promise<MainMethodResult> {
const resourcePath = getJavaResourcePath(document);
return await executeCommand(Commands.JAVA_RESOLVE_MAINMETHOD, resourcePath);
return executeCommand(Commands.JAVA_RESOLVE_MAINMETHOD, resourcePath);
}

export async function resolveClassPathCurrentFile(): Promise<IClassPath> {
Expand Down
7 changes: 2 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { onConfigurationChange, updateDebugSettings } from './settings';
export async function activate(context: ExtensionContext): Promise<void> {
registerCommands(context);
context.subscriptions.push(onConfigurationChange());
return Promise.resolve();
}

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

const overrides = getOverrides(args);

const settings = {
Expand Down Expand Up @@ -102,11 +100,10 @@ function parseOverrides(args: string): any {
return overrides;
}

function showCommandResult(func: () => Promise<any>): (...args: any[]) => Promise<void> {
function showCommandResult(func: () => Promise<any>): (...args: any[]) => Promise<string | undefined> {
return async () => {
const result = await func();
const json = JSON.stringify(result, null, 2);
window.showInformationMessage(json);
return Promise.resolve();
return window.showInformationMessage(json);
};
}

0 comments on commit bb56b97

Please sign in to comment.