Skip to content

Commit

Permalink
vscode-extension: starts up language server if no framework SDK is co…
Browse files Browse the repository at this point in the history
…nfigured

Displaying some kind of error for a missing SDK is now handled by the language server.
  • Loading branch information
joshtynjala committed Mar 20, 2020
1 parent 541b9b8 commit 0668b0d
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions vscode-extension/src/main/ts/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ import normalizeUri from "./utils/normalizeUri";
import findQuickCompileWorkspaceFolders from "./commands/findQuickCompileWorkspaceFolders";

const INVALID_SDK_ERROR = "as3mxml.sdk.editor in settings does not point to a valid SDK. Requires Apache Royale 0.9.6 or newer.";
const MISSING_FRAMEWORK_SDK_ERROR = "You must configure an SDK to enable all ActionScript & MXML features.";
const INVALID_JAVA_ERROR = "as3mxml.java.path in settings does not point to a valid executable. It cannot be a directory, and Java 1.8 or newer is required.";
const MISSING_JAVA_ERROR = "Could not locate valid Java executable. To configure Java manually, use the as3mxml.java.path setting.";
const INITIALIZING_MESSAGE = "Initializing ActionScript & MXML language server...";
const RELOAD_WINDOW_MESSAGE = "To apply new settings for ActionScript & MXML, please reload the window.";
const RELOAD_WINDOW_BUTTON_LABEL = "Reload Window";
const CONFIGURE_SDK_LABEL = "Configure SDK";
const STARTUP_ERROR = "The ActionScript & MXML extension failed to start.";
const QUICK_COMPILE_AND_DEBUG_INIT_MESSAGE = "Quick Compile & Debug is waiting for initialization...";
const QUICK_COMPILE_AND_RUN_INIT_MESSAGE = "Quick Compile & Run is waiting for initialization...";
Expand Down Expand Up @@ -272,7 +270,7 @@ export function activate(context: vscode.ExtensionContext)

sdkStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);
updateSDKStatusBarItem();
sdkStatusBarItem.tooltip = "Select ActionScript SDK";
sdkStatusBarItem.tooltip = "Select ActionScript & MXML SDK";
sdkStatusBarItem.command = "as3mxml.selectWorkspaceSDK";
sdkStatusBarItem.show();

Expand Down Expand Up @@ -329,17 +327,6 @@ function hasInvalidEditorSDK(): boolean
return !editorSDKHome && sdkPath != null;
}

function showMissingFrameworkSDKError()
{
vscode.window.showErrorMessage(MISSING_FRAMEWORK_SDK_ERROR, CONFIGURE_SDK_LABEL).then((value: string) =>
{
if(value === CONFIGURE_SDK_LABEL)
{
selectWorkspaceSDK();
}
});
}

function startClient()
{
if(!savedContext)
Expand All @@ -362,11 +349,6 @@ function startClient()
vscode.window.showErrorMessage(INVALID_SDK_ERROR);
return;
}
if(!frameworkSDKHome)
{
showMissingFrameworkSDKError();
return;
}

vscode.window.withProgress({location: vscode.ProgressLocation.Window}, (progress) =>
{
Expand Down

0 comments on commit 0668b0d

Please sign in to comment.