Skip to content

Commit

Permalink
Move the unsupported error message higher up
Browse files Browse the repository at this point in the history
  • Loading branch information
andreeis committed Aug 7, 2019
1 parent 8e31eb9 commit 007292c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 0 additions & 11 deletions Extension/src/LanguageServer/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,6 @@ export function activate(activationEventOccurred: boolean): void {
return;
}

let errMsg: string;
if (process.arch !== 'x32' && process.arch !== 'x64') {
errMsg = "Architecture " + String(process.arch) + " is not supported. ";
} else if (process.platform === 'linux' && fs.existsSync('/etc/alpine-release')) {
errMsg = "Alpine containers are not supported. ";
}
if (errMsg) {
vscode.window.showErrorMessage(errMsg);
return;
}

taskProvider = vscode.tasks.registerTaskProvider(taskSourceStr, {
provideTasks: () => {
return getBuildTasks(false);
Expand Down
11 changes: 11 additions & 0 deletions Extension/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ let reloadMessageShown: boolean = false;
let disposables: vscode.Disposable[] = [];

export async function activate(context: vscode.ExtensionContext): Promise<CppToolsApi & CppToolsExtension> {
let errMsg: string = "";
if (process.arch !== 'x32' && process.arch !== 'x64') {
errMsg = "Architecture " + String(process.arch) + " is not supported. ";
} else if (process.platform === 'linux' && fs.existsSync('/etc/alpine-release')) {
errMsg = "Alpine containers are not supported. ";
}
if (errMsg) {
vscode.window.showErrorMessage(errMsg);
return;

This comment has been minimized.

Copy link
@bobbrow

bobbrow Aug 7, 2019

Member

The contract is to return a CppToolsApi & CppToolsExtension. We should create an empty implementation of those interfaces and return it so it doesn't crash custom config providers.

}

util.setExtensionContext(context);
initializeTemporaryCommandRegistrar();
Telemetry.activate();
Expand Down

0 comments on commit 007292c

Please sign in to comment.