Skip to content

Commit d6c7781

Browse files
authored
Show the prompt again if user clicks on more info (#11664)
* Show the prompt again if user clicks on more info * Review feedback * Use Learn more as text for the link.
1 parent 641bece commit d6c7781

File tree

4 files changed

+7
-29
lines changed

4 files changed

+7
-29
lines changed

package.nls.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@
240240
"DataScience.liveShareServiceFailure": "Failure starting '{0}' service during live share connection.",
241241
"DataScience.documentMismatch": "Cannot run cells, duplicate documents for {0} found.",
242242
"DataScience.pythonInteractiveCreateFailed": "Failure to create a 'Python Interactive' window. Try reinstalling the Python extension.",
243-
"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.",
244-
"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.",
245-
"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.",
243+
"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).",
244+
"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).",
245+
"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).",
246246
"diagnostics.warnSourceMaps": "Source map support is enabled in the Python Extension, this will adversely impact performance of the extension.",
247247
"diagnostics.disableSourceMaps": "Disable Source Map Support",
248248
"diagnostics.warnBeforeEnablingSourceMaps": "Enabling source map support in the Python Extension will adversely impact performance of the extension.",

src/client/application/diagnostics/checks/pythonPathDeprecated.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { IWorkspaceService } from '../../../common/application/types';
99
import { DeprecatePythonPath } from '../../../common/experimentGroups';
1010
import { IDisposableRegistry, IExperimentsManager, Resource } from '../../../common/types';
1111
import { Common, Diagnostics } from '../../../common/utils/localize';
12-
import { learnMoreOnInterpreterSecurityURI } from '../../../interpreter/autoSelection/constants';
1312
import { IServiceContainer } from '../../../ioc/types';
1413
import { BaseDiagnostic, BaseDiagnosticsService } from '../base';
1514
import { IDiagnosticsCommandFactory } from '../commands/types';
@@ -97,13 +96,6 @@ export class PythonPathDeprecatedDiagnosticService extends BaseDiagnosticsServic
9796
{
9897
prompt: Common.noIWillDoItLater()
9998
},
100-
{
101-
prompt: Common.moreInfo(),
102-
command: commandFactory.createCommand(diagnostic, {
103-
type: 'launch',
104-
options: learnMoreOnInterpreterSecurityURI
105-
})
106-
},
10799
{
108100
prompt: Common.doNotShowAgain(),
109101
command: commandFactory.createCommand(diagnostic, { type: 'ignore', options: DiagnosticScope.Global })

src/client/common/utils/localize.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ export namespace Diagnostics {
3232
);
3333
export const removePythonPathSettingsJson = localize(
3434
'diagnostics.removePythonPathSettingsJson',
35-
'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.'
35+
'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).'
3636
);
3737
export const removePythonPathCodeWorkspace = localize(
3838
'diagnostics.removePythonPathCodeWorkspace',
39-
'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.'
39+
'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).'
4040
);
4141
export const removePythonPathCodeWorkspaceAndSettingsJson = localize(
4242
'diagnostics.removePythonPathCodeWorkspaceAndSettingsJson',
43-
'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.'
43+
'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).'
4444
);
4545
export const invalidPythonPathInDebuggerSettings = localize(
4646
'diagnostics.invalidPythonPathInDebuggerSettings',

src/test/application/diagnostics/checks/pythonPathDeprecated.unit.test.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ suite('Application Diagnostics - Python Path Deprecated', () => {
142142
});
143143
test('Python Path Deprecated Diagnostic is handled as expected', async () => {
144144
const diagnostic = new PythonPathDeprecatedDiagnostic('message', resource);
145-
const launchCmd = ({ cmd: 'launchCmd' } as any) as IDiagnosticCommand;
146145
const ignoreCmd = ({ cmd: 'ignoreCmd' } as any) as IDiagnosticCommand;
147146
filterService
148147
.setup((f) =>
@@ -155,15 +154,6 @@ suite('Application Diagnostics - Python Path Deprecated', () => {
155154
.callback((_d, p: MessageCommandPrompt) => (messagePrompt = p))
156155
.returns(() => Promise.resolve())
157156
.verifiable(typemoq.Times.once());
158-
commandFactory
159-
.setup((f) =>
160-
f.createCommand(
161-
typemoq.It.isAny(),
162-
typemoq.It.isObjectWith<CommandOption<'launch', string>>({ type: 'launch' })
163-
)
164-
)
165-
.returns(() => launchCmd)
166-
.verifiable(typemoq.Times.once());
167157

168158
commandFactory
169159
.setup((f) =>
@@ -180,16 +170,12 @@ suite('Application Diagnostics - Python Path Deprecated', () => {
180170
messageHandler.verifyAll();
181171
commandFactory.verifyAll();
182172
expect(messagePrompt).not.be.equal(undefined, 'Message prompt not set');
183-
expect(messagePrompt!.commandPrompts.length).to.equal(4, 'Incorrect length');
173+
expect(messagePrompt!.commandPrompts.length).to.equal(3, 'Incorrect length');
184174
expect(messagePrompt!.commandPrompts[0].command).not.be.equal(undefined, 'Command not set');
185175
expect(messagePrompt!.commandPrompts[0].command!.diagnostic).to.be.deep.equal(diagnostic);
186176
expect(messagePrompt!.commandPrompts[0].prompt).to.be.deep.equal(Common.yesPlease());
187177
expect(messagePrompt!.commandPrompts[1]).to.be.deep.equal({ prompt: Common.noIWillDoItLater() });
188178
expect(messagePrompt!.commandPrompts[2]).to.be.deep.equal({
189-
prompt: Common.moreInfo(),
190-
command: launchCmd
191-
});
192-
expect(messagePrompt!.commandPrompts[3]).to.be.deep.equal({
193179
prompt: Common.doNotShowAgain(),
194180
command: ignoreCmd
195181
});

0 commit comments

Comments
 (0)