Skip to content

Show the prompt again if user clicks on more info #11664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 7, 2020
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
6 changes: 3 additions & 3 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@
"DataScience.liveShareServiceFailure": "Failure starting '{0}' service during live share connection.",
"DataScience.documentMismatch": "Cannot run cells, duplicate documents for {0} found.",
"DataScience.pythonInteractiveCreateFailed": "Failure to create a 'Python Interactive' window. Try reinstalling the Python extension.",
"diagnostics.removePythonPathSettingsJson": "The setting \"python.pythonPath\" defined in your workspace settings is now deprecated. Do you want us to delete it? This will only remove the \"python.pythonPath\" entry from your settings.json.",
"diagnostics.removePythonPathCodeWorkspace": "The setting \"python.pythonPath\" defined in your workspace settings is now deprecated. Do you want us to delete it? This will only remove the \"python.pythonPath\" entry from your .code-workspace file.",
"diagnostics.removePythonPathCodeWorkspaceAndSettingsJson": "The setting \"python.pythonPath\" defined in your workspace settings is now deprecated. Do you want us to delete it? This will only remove the \"python.pythonPath\" entry from your settings.json and .code-workspace file.",
"diagnostics.removePythonPathSettingsJson": "The setting \"python.pythonPath\" defined in your settings.json is now deprecated. Do you want us to delete it from your settings.json only? [Learn more](https://aka.ms/AA7jfor).",
"diagnostics.removePythonPathCodeWorkspace": "The setting \"python.pythonPath\" defined in your workspace settings is now deprecated. Do you want us to delete it from your .code-workspace file only? [Learn more](https://aka.ms/AA7jfor).",
"diagnostics.removePythonPathCodeWorkspaceAndSettingsJson": "The setting \"python.pythonPath\" defined in your workspace settings is now deprecated. Do you want us to delete it from your .code-workspace file and settings.json? [Learn more](https://aka.ms/AA7jfor).",
"diagnostics.warnSourceMaps": "Source map support is enabled in the Python Extension, this will adversely impact performance of the extension.",
"diagnostics.disableSourceMaps": "Disable Source Map Support",
"diagnostics.warnBeforeEnablingSourceMaps": "Enabling source map support in the Python Extension will adversely impact performance of the extension.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { IWorkspaceService } from '../../../common/application/types';
import { DeprecatePythonPath } from '../../../common/experimentGroups';
import { IDisposableRegistry, IExperimentsManager, Resource } from '../../../common/types';
import { Common, Diagnostics } from '../../../common/utils/localize';
import { learnMoreOnInterpreterSecurityURI } from '../../../interpreter/autoSelection/constants';
import { IServiceContainer } from '../../../ioc/types';
import { BaseDiagnostic, BaseDiagnosticsService } from '../base';
import { IDiagnosticsCommandFactory } from '../commands/types';
Expand Down Expand Up @@ -97,13 +96,6 @@ export class PythonPathDeprecatedDiagnosticService extends BaseDiagnosticsServic
{
prompt: Common.noIWillDoItLater()
},
{
prompt: Common.moreInfo(),
command: commandFactory.createCommand(diagnostic, {
type: 'launch',
options: learnMoreOnInterpreterSecurityURI
})
},
{
prompt: Common.doNotShowAgain(),
command: commandFactory.createCommand(diagnostic, { type: 'ignore', options: DiagnosticScope.Global })
Expand Down
6 changes: 3 additions & 3 deletions src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ export namespace Diagnostics {
);
export const removePythonPathSettingsJson = localize(
'diagnostics.removePythonPathSettingsJson',
'The setting "python.pythonPath" defined in your workspace settings is now deprecated. Do you want us to delete it? This will only remove the "python.pythonPath" entry from your settings.json.'
'The setting "python.pythonPath" defined in your settings.json is now deprecated. Do you want us to delete it from your settings.json only? [Learn more](https://aka.ms/AA7jfor).'
);
export const removePythonPathCodeWorkspace = localize(
'diagnostics.removePythonPathCodeWorkspace',
'The setting "python.pythonPath" defined in your workspace settings is now deprecated. Do you want us to delete it? This will only remove the "python.pythonPath" entry from your .code-workspace file.'
'The setting "python.pythonPath" defined in your workspace settings is now deprecated. Do you want us to delete it from your .code-workspace file only? [Learn more](https://aka.ms/AA7jfor).'
);
export const removePythonPathCodeWorkspaceAndSettingsJson = localize(
'diagnostics.removePythonPathCodeWorkspaceAndSettingsJson',
'The setting "python.pythonPath" defined in your workspace settings is now deprecated. Do you want us to delete it? This will only remove the "python.pythonPath" entry from your settings.json and .code-workspace file.'
'The setting "python.pythonPath" defined in your workspace settings is now deprecated. Do you want us to delete it from your .code-workspace file and settings.json? [Learn more](https://aka.ms/AA7jfor).'
);
export const invalidPythonPathInDebuggerSettings = localize(
'diagnostics.invalidPythonPathInDebuggerSettings',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ suite('Application Diagnostics - Python Path Deprecated', () => {
});
test('Python Path Deprecated Diagnostic is handled as expected', async () => {
const diagnostic = new PythonPathDeprecatedDiagnostic('message', resource);
const launchCmd = ({ cmd: 'launchCmd' } as any) as IDiagnosticCommand;
const ignoreCmd = ({ cmd: 'ignoreCmd' } as any) as IDiagnosticCommand;
filterService
.setup((f) =>
Expand All @@ -155,15 +154,6 @@ suite('Application Diagnostics - Python Path Deprecated', () => {
.callback((_d, p: MessageCommandPrompt) => (messagePrompt = p))
.returns(() => Promise.resolve())
.verifiable(typemoq.Times.once());
commandFactory
.setup((f) =>
f.createCommand(
typemoq.It.isAny(),
typemoq.It.isObjectWith<CommandOption<'launch', string>>({ type: 'launch' })
)
)
.returns(() => launchCmd)
.verifiable(typemoq.Times.once());

commandFactory
.setup((f) =>
Expand All @@ -180,16 +170,12 @@ suite('Application Diagnostics - Python Path Deprecated', () => {
messageHandler.verifyAll();
commandFactory.verifyAll();
expect(messagePrompt).not.be.equal(undefined, 'Message prompt not set');
expect(messagePrompt!.commandPrompts.length).to.equal(4, 'Incorrect length');
expect(messagePrompt!.commandPrompts.length).to.equal(3, 'Incorrect length');
expect(messagePrompt!.commandPrompts[0].command).not.be.equal(undefined, 'Command not set');
expect(messagePrompt!.commandPrompts[0].command!.diagnostic).to.be.deep.equal(diagnostic);
expect(messagePrompt!.commandPrompts[0].prompt).to.be.deep.equal(Common.yesPlease());
expect(messagePrompt!.commandPrompts[1]).to.be.deep.equal({ prompt: Common.noIWillDoItLater() });
expect(messagePrompt!.commandPrompts[2]).to.be.deep.equal({
prompt: Common.moreInfo(),
command: launchCmd
});
expect(messagePrompt!.commandPrompts[3]).to.be.deep.equal({
prompt: Common.doNotShowAgain(),
command: ignoreCmd
});
Expand Down