Skip to content

Commit b342559

Browse files
authored
Remove sourceMaps (microsoft#24561)
Fixes microsoft#13961
1 parent 9f4e4f2 commit b342559

17 files changed

+4
-513
lines changed

.eslintignore

-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ src/test/proc.ts
1717
src/test/smokeTest.ts
1818
src/test/standardTest.ts
1919
src/test/startupTelemetry.unit.test.ts
20-
src/test/sourceMapSupport.test.ts
21-
src/test/sourceMapSupport.unit.test.ts
2220
src/test/testBootstrap.ts
2321
src/test/testLogger.ts
2422
src/test/testRunner.ts
@@ -129,7 +127,6 @@ src/test/application/diagnostics/checks/invalidPythonPathInDebugger.unit.test.ts
129127
src/test/application/diagnostics/checks/envPathVariable.unit.test.ts
130128
src/test/application/diagnostics/applicationDiagnostics.unit.test.ts
131129
src/test/application/diagnostics/promptHandler.unit.test.ts
132-
src/test/application/diagnostics/sourceMapSupportService.unit.test.ts
133130
src/test/application/diagnostics/commands/ignore.unit.test.ts
134131

135132
src/test/performance/load.perf.test.ts
@@ -145,7 +142,6 @@ src/client/interpreter/virtualEnvs/condaInheritEnvPrompt.ts
145142
src/client/interpreter/display/index.ts
146143

147144
src/client/extension.ts
148-
src/client/sourceMapSupport.ts
149145
src/client/startupTelemetry.ts
150146

151147
src/client/terminals/codeExecution/terminalCodeExecution.ts

gulpfile.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,6 @@ function getAllowedWarningsForWebPack(buildConfig) {
222222
throw new Error('Unknown WebPack Configuration');
223223
}
224224
}
225-
gulp.task('renameSourceMaps', async () => {
226-
// By default source maps will be disabled in the extension.
227-
// Users will need to use the command `python.enableSourceMapSupport` to enable source maps.
228-
const extensionSourceMap = path.join(__dirname, 'out', 'client', 'extension.js.map');
229-
await fsExtra.rename(extensionSourceMap, `${extensionSourceMap}.disabled`);
230-
});
231225

232226
gulp.task('verifyBundle', async () => {
233227
const matches = await glob.sync(path.join(__dirname, '*.vsix'));
@@ -238,7 +232,7 @@ gulp.task('verifyBundle', async () => {
238232
}
239233
});
240234

241-
gulp.task('prePublishBundle', gulp.series('webpack', 'renameSourceMaps'));
235+
gulp.task('prePublishBundle', gulp.series('webpack'));
242236
gulp.task('checkDependencies', gulp.series('checkNativeDependencies'));
243237
gulp.task('prePublishNonBundle', gulp.series('compile'));
244238

package.json

-17
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,6 @@
300300
"command": "python.createEnvironment-button",
301301
"title": "%python.command.python.createEnvironment.title%"
302302
},
303-
{
304-
"category": "Python",
305-
"command": "python.enableSourceMapSupport",
306-
"title": "%python.command.python.enableSourceMapSupport.title%"
307-
},
308303
{
309304
"category": "Python",
310305
"command": "python.execInTerminal",
@@ -443,12 +438,6 @@
443438
"scope": "machine-overridable",
444439
"type": "string"
445440
},
446-
"python.diagnostics.sourceMapsEnabled": {
447-
"default": false,
448-
"description": "%python.diagnostics.sourceMapsEnabled.description%",
449-
"scope": "application",
450-
"type": "boolean"
451-
},
452441
"python.envFile": {
453442
"default": "${workspaceFolder}/.env",
454443
"description": "%python.envFile.description%",
@@ -1297,12 +1286,6 @@
12971286
"title": "%python.command.python.createTerminal.title%",
12981287
"when": "!virtualWorkspace && shellExecutionSupported"
12991288
},
1300-
{
1301-
"category": "Python",
1302-
"command": "python.enableSourceMapSupport",
1303-
"title": "%python.command.python.enableSourceMapSupport.title%",
1304-
"when": "!virtualWorkspace && shellExecutionSupported"
1305-
},
13061289
{
13071290
"category": "Python",
13081291
"command": "python.execInTerminal",

package.nls.json

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"python.command.python.execInREPL.title": "Run Selection/Line in Python REPL",
1919
"python.command.python.execSelectionInDjangoShell.title": "Run Selection/Line in Django Shell",
2020
"python.command.python.reportIssue.title": "Report Issue...",
21-
"python.command.python.enableSourceMapSupport.title": "Enable Source Map Support For Extension Debugging",
2221
"python.command.python.clearCacheAndReload.title": "Clear Cache and Reload Window",
2322
"python.command.python.analysis.restartLanguageServer.title": "Restart Language Server",
2423
"python.command.python.launchTensorBoard.title": "Launch TensorBoard",
@@ -33,7 +32,6 @@
3332
"python.condaPath.description": "Path to the conda executable to use for activation (version 4.4+).",
3433
"python.debugger.deprecatedMessage": "This configuration will be deprecated soon. Please replace `python` with `debugpy` to use the new Python Debugger extension.",
3534
"python.defaultInterpreterPath.description": "Path to default Python to use when extension loads up for the first time, no longer used once an interpreter is selected for the workspace. See [here](https://aka.ms/AAfekmf) to understand when this is used",
36-
"python.diagnostics.sourceMapsEnabled.description": "Enable source map support for meaningful stack traces in error logs.",
3735
"python.envFile.description": "Absolute path to a file containing environment variable definitions.",
3836
"python.experiments.enabled.description": "Enables A/B tests experiments in the Python extension. If enabled, you may get included in proposed enhancements and/or features.",
3937
"python.experiments.optInto.description": "List of experiments to opt into. If empty, user is assigned the default experiment groups. See [here](https://github.com/microsoft/vscode-python/wiki/AB-Experiments) for more details.",

src/client/application/diagnostics/applicationDiagnostics.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Resource } from '../../common/types';
99
import { IServiceContainer } from '../../ioc/types';
1010
import { traceLog, traceVerbose } from '../../logging';
1111
import { IApplicationDiagnostics } from '../types';
12-
import { IDiagnostic, IDiagnosticsService, ISourceMapSupportService } from './types';
12+
import { IDiagnostic, IDiagnosticsService } from './types';
1313

1414
function log(diagnostics: IDiagnostic[]): void {
1515
diagnostics.forEach((item) => {
@@ -43,9 +43,7 @@ async function runDiagnostics(diagnosticServices: IDiagnosticsService[], resourc
4343
export class ApplicationDiagnostics implements IApplicationDiagnostics {
4444
constructor(@inject(IServiceContainer) private readonly serviceContainer: IServiceContainer) {}
4545

46-
public register() {
47-
this.serviceContainer.get<ISourceMapSupportService>(ISourceMapSupportService).register();
48-
}
46+
public register() {}
4947

5048
public async performPreStartupHealthCheck(resource: Resource): Promise<void> {
5149
// When testing, do not perform health checks, as modal dialogs can be displayed.

src/client/application/diagnostics/surceMapSupportService.ts

-46
This file was deleted.

src/client/application/diagnostics/types.ts

-5
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,3 @@ export const IInvalidPythonPathInDebuggerService = Symbol('IInvalidPythonPathInD
6464
export interface IInvalidPythonPathInDebuggerService extends IDiagnosticsService {
6565
validatePythonPath(pythonPath?: string, pythonPathSource?: PythonPathSource, resource?: Uri): Promise<boolean>;
6666
}
67-
export const ISourceMapSupportService = Symbol('ISourceMapSupportService');
68-
export interface ISourceMapSupportService {
69-
register(): void;
70-
enable(): Promise<void>;
71-
}

src/client/application/serviceRegistry.ts

-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55

66
import { IServiceManager } from '../ioc/types';
77
import { registerTypes as diagnosticsRegisterTypes } from './diagnostics/serviceRegistry';
8-
import { SourceMapSupportService } from './diagnostics/surceMapSupportService';
9-
import { ISourceMapSupportService } from './diagnostics/types';
108

119
export function registerTypes(serviceManager: IServiceManager) {
12-
serviceManager.addSingleton<ISourceMapSupportService>(ISourceMapSupportService, SourceMapSupportService);
1310
diagnosticsRegisterTypes(serviceManager);
1411
}

src/client/common/application/commands.ts

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ interface ICommandNameWithoutArgumentTypeMapping {
3434
['editor.action.rename']: [];
3535
[Commands.ViewOutput]: [];
3636
[Commands.Start_REPL]: [];
37-
[Commands.Enable_SourceMap_Support]: [];
3837
[Commands.Exec_Selection_In_Terminal]: [];
3938
[Commands.Exec_Selection_In_Django_Shell]: [];
4039
[Commands.Create_Terminal]: [];

src/client/common/constants.ts

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export namespace Commands {
4242
export const Create_Environment_Check = 'python.createEnvironmentCheck';
4343
export const Create_Terminal = 'python.createTerminal';
4444
export const Debug_In_Terminal = 'python.debugInTerminal';
45-
export const Enable_SourceMap_Support = 'python.enableSourceMapSupport';
4645
export const Exec_In_Terminal = 'python.execInTerminal';
4746
export const Exec_In_Terminal_Icon = 'python.execInTerminal-icon';
4847
export const Exec_In_Separate_Terminal = 'python.execInDedicatedTerminal';

src/client/common/utils/localize.ts

-9
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ import { Commands } from '../constants';
1010

1111
// External callers of localize use these tables to retrieve localized values.
1212
export namespace Diagnostics {
13-
export const warnSourceMaps = l10n.t(
14-
'Source map support is enabled in the Python Extension, this will adversely impact performance of the extension.',
15-
);
16-
export const disableSourceMaps = l10n.t('Disable Source Map Support');
17-
18-
export const warnBeforeEnablingSourceMaps = l10n.t(
19-
'Enabling source map support in the Python Extension will adversely impact performance of the extension.',
20-
);
21-
export const enableSourceMapsAndReloadVSC = l10n.t('Enable and reload Window.');
2213
export const lsNotSupported = l10n.t(
2314
'Your operating system does not meet the minimum requirements of the Python Language Server. Reverting to the alternative autocompletion provider, Jedi.',
2415
);

src/client/extension.ts

-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ if ((Reflect as any).metadata === undefined) {
66
require('reflect-metadata');
77
}
88

9-
// Initialize source maps (this must never be moved up nor further down).
10-
import { initialize } from './sourceMapSupport';
11-
initialize(require('vscode'));
12-
139
//===============================================
1410
// We start tracking the extension's startup time at this point. The
1511
// locations at which we record various Intervals are marked below in

src/client/sourceMapSupport.ts

-85
This file was deleted.

src/test/application/diagnostics/applicationDiagnostics.unit.test.ts

+1-19
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ import { DiagnosticSeverity } from 'vscode';
1010
import { ApplicationDiagnostics } from '../../../client/application/diagnostics/applicationDiagnostics';
1111
import { EnvironmentPathVariableDiagnosticsService } from '../../../client/application/diagnostics/checks/envPathVariable';
1212
import { InvalidPythonInterpreterService } from '../../../client/application/diagnostics/checks/pythonInterpreter';
13-
import {
14-
DiagnosticScope,
15-
IDiagnostic,
16-
IDiagnosticsService,
17-
ISourceMapSupportService,
18-
} from '../../../client/application/diagnostics/types';
13+
import { DiagnosticScope, IDiagnostic, IDiagnosticsService } from '../../../client/application/diagnostics/types';
1914
import { IApplicationDiagnostics } from '../../../client/application/types';
2015
import { IWorkspaceService } from '../../../client/common/application/types';
2116
import { createDeferred, createDeferredFromPromise } from '../../../client/common/utils/async';
@@ -62,19 +57,6 @@ suite('Application Diagnostics - ApplicationDiagnostics', () => {
6257
process.env.VSC_PYTHON_CI_TEST = oldValueOfVSC_PYTHON_CI_TEST;
6358
});
6459

65-
test('Register should register source maps', () => {
66-
const sourceMapService = typemoq.Mock.ofType<ISourceMapSupportService>();
67-
sourceMapService.setup((s) => s.register()).verifiable(typemoq.Times.once());
68-
69-
serviceContainer
70-
.setup((d) => d.get(typemoq.It.isValue(ISourceMapSupportService), typemoq.It.isAny()))
71-
.returns(() => sourceMapService.object);
72-
73-
appDiagnostics.register();
74-
75-
sourceMapService.verifyAll();
76-
});
77-
7860
test('Performing Pre Startup Health Check must diagnose all validation checks', async () => {
7961
envHealthCheck
8062
.setup((e) => e.diagnose(typemoq.It.isAny()))

0 commit comments

Comments
 (0)