diff --git a/package.json b/package.json index 3250380..43b910f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "publisher": "mouseliu", "repository": "https://github.com/xjsender/haoide-vscode", "description": "haoide-vscode is a vscode extension for force.com development", - "version": "0.1.3", + "version": "0.1.4", "engines": { "vscode": "^1.35.0" }, diff --git a/src/commands/main.ts b/src/commands/main.ts index a55233a..e987141 100644 --- a/src/commands/main.ts +++ b/src/commands/main.ts @@ -38,7 +38,8 @@ export async function updateUserLanguage() { "serverUrl": "/sobjects/User/" + _session.getUserId(), "data": { "LanguageLocaleKey": chosenItem.label - } + }, + "progressMessage": "Updating user language" }) .then( body => { vscode.window.showInformationMessage( @@ -88,7 +89,8 @@ export function executeQuery() { let restApi = new RestApi(); ProgressNotification.showProgress(restApi, "query", { - soql: soql + soql: soql, + progressMessage: "Executing query request" }) .then( body => { util.openNewUntitledFile( @@ -112,7 +114,9 @@ export async function reloadSobjectCache(sobjects?: string[]) { // If sobjects is not specified, describe global if (!sobjects || sobjects.length === 0) { return ProgressNotification.showProgress( - restApi, "describeGlobal", {} + restApi, "describeGlobal", { + progressMessage: "Executing describeGlobal request" + } ) .then( body => { let sobjectsDesc: any[] = body["sobjects"]; diff --git a/src/commands/utility.ts b/src/commands/utility.ts index 73fd799..0f48c49 100644 --- a/src/commands/utility.ts +++ b/src/commands/utility.ts @@ -86,7 +86,11 @@ export async function switchProject(projectName?: string) { }; }) ); - console.log(chosenItem); + + // When user cancel request + if (!chosenItem) { + return; + } projectName = chosenItem.label; } diff --git a/src/salesforce/api/rest.ts b/src/salesforce/api/rest.ts index 8f4af88..2304c7d 100644 --- a/src/salesforce/api/rest.ts +++ b/src/salesforce/api/rest.ts @@ -81,7 +81,9 @@ export default class RestApi { // Send notification ProgressNotification.notify( - options.progress, `Start rest ${options.method} request...` + options.progress, + options.progressMessage || + `Start rest ${options.method} request...` ); request(requestOptions).then( body => { @@ -90,7 +92,6 @@ export default class RestApi { options.progress, `${options.method} is finished`, 100 ); - console.log(body); resolve(body); }) .catch(err => { @@ -325,11 +326,11 @@ export default class RestApi { * @returns Promise */ public describeGlobal(options: any) { - return this.get({ + return this.get(_.extend(options, { serverUrl: `/sobjects`, progress: options.progress, timeout: options.timeout || 120 - }); + })); } /** diff --git a/src/utils/context.ts b/src/utils/context.ts index 158504c..ca92d71 100644 --- a/src/utils/context.ts +++ b/src/utils/context.ts @@ -3,7 +3,6 @@ import * as vscode from "vscode"; export function setHasOpenProject() { vscode.workspace.findFiles('**/session.json') .then( files => { - console.log(files); vscode.commands.executeCommand( 'setContext', 'haoide.hasOpenProject', files && files.length > 0