Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
"LanguageService.bannerMessage": "Can you please take 2 minutes to tell us how the Python Language Server is working for you?",
"LanguageService.bannerLabelYes": "Yes, take survey now",
"LanguageService.bannerLabelNo": "No, thanks",
"LanguageService.lsFailedToStart": "We encountered an issue starting the Language Server. Reverting to the alternative, Jedi. Check the Output panel for details.",
"LanguageService.lsFailedToDownload": "We encountered an issue downloading the Language Server. Reverting to the alternative, Jedi. Check the Output panel for details.",
"LanguageService.lsFailedToExtract": "We encountered an issue extracting the Language Server. Reverting to the alternative, Jedi. Check the Output panel for details.",
"LanguageService.lsFailedToStart": "We encountered an issue starting the Language Server. Reverting to the alternative, Jedi. Check the Python output panel for details.",
"LanguageService.lsFailedToDownload": "We encountered an issue downloading the Language Server. Reverting to the alternative, Jedi. Check the Python output panel for details.",
"LanguageService.lsFailedToExtract": "We encountered an issue extracting the Language Server. Reverting to the alternative, Jedi. Check the Python output panel for details.",
"DataScience.unknownMimeTypeFormat": "Mime type {0} is not currently supported.",
"DataScience.historyTitle": "Python Interactive",
"DataScience.badWebPanelFormatString": "<html><body><h1>{0} is not a valid file name</h1></body></html>",
Expand Down Expand Up @@ -180,5 +180,6 @@
"debug.attachRemoteHostValidationError": "Enter a valid host name or IP address",
"UnitTests.testErrorDiagnosticMessage": "Error",
"UnitTests.testFailDiagnosticMessage": "Fail",
"UnitTests.testSkippedDiagnosticMessage": "Skipped"
"UnitTests.testSkippedDiagnosticMessage": "Skipped",
"Common.openOutputPanel":"Show output"
}
13 changes: 10 additions & 3 deletions src/client/activation/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { STANDARD_OUTPUT_CHANNEL } from '../common/constants';
import { IFileSystem } from '../common/platform/types';
import { IOutputChannel } from '../common/types';
import { createDeferred } from '../common/utils/async';
import { LanguageService } from '../common/utils/localize';
import { Common, LanguageService } from '../common/utils/localize';
import { StopWatch } from '../common/utils/stopWatch';
import { sendTelemetryEvent } from '../telemetry';
import {
Expand Down Expand Up @@ -52,7 +52,7 @@ export class LanguageServerDownloader implements ILanguageServerDownloader {
this.output.appendLine('download failed.');
this.output.appendLine(err);
success = false;
this.appShell.showErrorMessage(LanguageService.lsFailedToDownload());
this.showMessageAndOptionallyShowOutput(LanguageService.lsFailedToDownload()).ignoreErrors();
sendTelemetryEvent(PYTHON_LANGUAGE_SERVER_ERROR, undefined, { error: 'Failed to download (platform)' }, err);
throw new Error(err);
} finally {
Expand All @@ -70,7 +70,7 @@ export class LanguageServerDownloader implements ILanguageServerDownloader {
this.output.appendLine('extraction failed.');
this.output.appendLine(err);
success = false;
this.appShell.showErrorMessage(LanguageService.lsFailedToExtract());
this.showMessageAndOptionallyShowOutput(LanguageService.lsFailedToExtract()).ignoreErrors();
sendTelemetryEvent(PYTHON_LANGUAGE_SERVER_ERROR, undefined, { error: 'Failed to extract (platform)' }, err);
throw new Error(err);
} finally {
Expand All @@ -83,6 +83,13 @@ export class LanguageServerDownloader implements ILanguageServerDownloader {
}
}

protected async showMessageAndOptionallyShowOutput(message: string) {
const selection = await this.appShell.showErrorMessage(message, Common.openOutputPanel());
if (selection !== Common.openOutputPanel()) {
return;
}
this.output.show(true);
}
protected async downloadFile(uri: string, title: string): Promise<string> {
this.output.append(`Downloading ${uri}... `);
const tempFile = await this.fs.createTemporaryFile(downloadFileExtension);
Expand Down
7 changes: 4 additions & 3 deletions src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ export namespace Diagnostics {
export namespace Common {
export const canceled = localize('Common.canceled', 'Canceled');
export const loadingExtension = localize('Common.loadingPythonExtension', 'Python extension loading...');
export const openOutputPanel = localize('Common.openOutputPanel', 'Show output');
}

export namespace LanguageService {
export const bannerMessage = localize('LanguageService.bannerMessage', 'Can you please take 2 minutes to tell us how the Python Language Server is working for you?');
export const bannerLabelYes = localize('LanguageService.bannerLabelYes', 'Yes, take survey now');
export const bannerLabelNo = localize('LanguageService.bannerLabelNo', 'No, thanks');
export const lsFailedToStart = localize('LanguageService.lsFailedToStart', 'We encountered an issue starting the Language Server. Reverting to the alternative, Jedi. Check the Output panel for details.');
export const lsFailedToDownload = localize('LanguageService.lsFailedToDownload', 'We encountered an issue downloading the Language Server. Reverting to the alternative, Jedi. Check the Output panel for details..');
export const lsFailedToExtract = localize('LanguageService.lsFailedToExtract', 'We encountered an issue extracting the Language Server. Reverting to the alternative, Jedi. Check the Output panel for details.');
export const lsFailedToStart = localize('LanguageService.lsFailedToStart', 'We encountered an issue starting the Language Server. Reverting to the alternative, Jedi. Check the Python output panel for details.');
export const lsFailedToDownload = localize('LanguageService.lsFailedToDownload', 'We encountered an issue downloading the Language Server. Reverting to the alternative, Jedi. Check the Python output panel for details.');
export const lsFailedToExtract = localize('LanguageService.lsFailedToExtract', 'We encountered an issue extracting the Language Server. Reverting to the alternative, Jedi. Check the Python output panel for details.');
}

export namespace Interpreters {
Expand Down
2 changes: 1 addition & 1 deletion src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ async function getActivationTelemetryProps(serviceContainer: IServiceContainer):
// error handling

function handleError(ex: Error) {
notifyUser('extension activation failed (see console log).');
notifyUser('Extension activation failed, run the \'Developer: Toggle Developer Tools\' command for more information.');
traceError('extension activation failed', ex);
sendErrorTelemetry(ex)
.ignoreErrors();
Expand Down
6 changes: 3 additions & 3 deletions src/test/activation/downloader.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ILanguageServerFolderService, IPlatformData } from '../../client/activa
import { IApplicationShell } from '../../client/common/application/types';
import { IFileSystem } from '../../client/common/platform/types';
import { IOutputChannel } from '../../client/common/types';
import { LanguageService } from '../../client/common/utils/localize';
import { Common, LanguageService } from '../../client/common/utils/localize';

// tslint:disable-next-line:max-func-body-length
suite('Activation - Downloader', () => {
Expand Down Expand Up @@ -84,7 +84,7 @@ suite('Activation - Downloader', () => {
.setup(f => f.getLatestLanguageServerVersion())
.returns(() => Promise.resolve(pkg))
.verifiable(TypeMoq.Times.once());
appShell.setup(a => a.showErrorMessage(LanguageService.lsFailedToDownload()))
appShell.setup(a => a.showErrorMessage(LanguageService.lsFailedToDownload(), Common.openOutputPanel()))
.returns(() => Promise.resolve(undefined))
.verifiable(TypeMoq.Times.once());
try {
Expand All @@ -100,7 +100,7 @@ suite('Activation - Downloader', () => {
.setup(f => f.getLatestLanguageServerVersion())
.returns(() => Promise.resolve(pkg))
.verifiable(TypeMoq.Times.once());
appShell.setup(a => a.showErrorMessage(LanguageService.lsFailedToExtract()))
appShell.setup(a => a.showErrorMessage(LanguageService.lsFailedToExtract(), Common.openOutputPanel()))
.returns(() => Promise.resolve(undefined))
.verifiable(TypeMoq.Times.once());
try {
Expand Down
3 changes: 1 addition & 2 deletions src/test/datascience/history.functional.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import * as React from 'react';
import { SemVer } from 'semver';
import * as TypeMoq from 'typemoq';
import { CancellationToken, Disposable, TextDocument, TextEditor } from 'vscode';

import {
IApplicationShell,
IDocumentManager,
Expand All @@ -21,6 +20,7 @@ import {
WebPanelMessage,
} from '../../client/common/application/types';
import { EXTENSION_ROOT_DIR } from '../../client/common/constants';
import { IDataScienceSettings } from '../../client/common/types';
import { createDeferred, Deferred } from '../../client/common/utils/async';
import { noop } from '../../client/common/utils/misc';
import { Architecture } from '../../client/common/utils/platform';
Expand All @@ -35,7 +35,6 @@ import { sleep } from '../core';
import { DataScienceIocContainer } from './dataScienceIocContainer';
import { SupportedCommands } from './mockJupyterManager';
import { waitForUpdate } from './reactHelpers';
import { IDataScienceSettings } from '../../client/common/types';

enum cellInputState {
Hidden,
Expand Down