message: Show some error messages if user tries to use the extension in an invalid state.
diff: @@ -408,8 +408,7 @@ export class CMakeTools implements vscode.Disposable, api.CMakeToolsAPI {
  * Wraps pre/post configure logic around an actual configure function
  * @param cb The actual configure callback. Called to do the configure
  */
  - private async _doConfigure(cb: (consumer: diags.CMakeOutputConsumer) => Promise<number>):
  - Promise<number> {
  + private async _doConfigure(cb: (consumer: diags.CMakeOutputConsumer) => Promise<number>): Promise<number> {
  if (!this._kitManager.hasActiveKit) {
  log.debug('No kit selected yet. Asking for a Kit first.');
  await this.selectKit();
  @@ -464,7 +463,6 @@ export class CMakeTools implements vscode.Disposable, api.CMakeToolsAPI {
  if (!drv) {
  log.debug('Build of project is not possible, because driver is not ready.');
  vscode.window.showErrorMessage('Unable to build, try to run configure before build.');
  -
  return -1;
  }
  @@ -503,6 +501,7 @@ export class CMakeTools implements vscode.Disposable, api.CMakeToolsAPI {
  async editCache(): Promise<void> {
  const drv = await this.getCMakeDriverInstance();
  if (!drv) {
  + vscode.window.showErrorMessage('Set up your CMake project before trying to edit the cache.');
  return;
  }
  @@ -533,6 +532,7 @@ export class CMakeTools implements vscode.Disposable, api.CMakeToolsAPI {
  async showTargetSelector(): Promise<string|null> {
  const drv = await this.getCMakeDriverInstance();
  if (!drv) {
  + vscode.window.showErrorMessage('Set up your CMake project before selecting a target.');
  return '';
  }
  @@ -581,7 +581,7 @@ export class CMakeTools implements vscode.Disposable, api.CMakeToolsAPI {
  const drv = await this.getCMakeDriverInstance();
  if (!drv) {
  - return -1;
  + throw new Error('Impossible: CMake driver died immediately after build succeeded.');
  }
  return this._ctestController.runCTest(drv);
  }
  @@ -681,6 +681,7 @@ export class CMakeTools implements vscode.Disposable, api.CMakeToolsAPI {
  async debugTarget(): Promise<vscode.DebugSession|null> {
  const drv = await this.getCMakeDriverInstance();
  if (!drv) {
  + vscode.window.showErrorMessage('Set up and build your CMake project before debugging.');
  return null;
  }
  if (drv instanceof LegacyCMakeDriver) {
  @@ -735,6 +736,7 @@ export class CMakeTools implements vscode.Disposable, api.CMakeToolsAPI {
  public async quickStart(): Promise<Number> {
  const drv = await this.getCMakeDriverInstance();
  if (!drv) {
  + vscode.window.showErrorMessage('CMake driver is not yet ready.');
  return -2;
  }
  