Skip to content

Commit

Permalink
Remove sourceMaps
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed Dec 9, 2024
1 parent 9f4e4f2 commit f54c9f8
Show file tree
Hide file tree
Showing 17 changed files with 4 additions and 513 deletions.
4 changes: 0 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ src/test/proc.ts
src/test/smokeTest.ts
src/test/standardTest.ts
src/test/startupTelemetry.unit.test.ts
src/test/sourceMapSupport.test.ts
src/test/sourceMapSupport.unit.test.ts
src/test/testBootstrap.ts
src/test/testLogger.ts
src/test/testRunner.ts
Expand Down Expand Up @@ -129,7 +127,6 @@ src/test/application/diagnostics/checks/invalidPythonPathInDebugger.unit.test.ts
src/test/application/diagnostics/checks/envPathVariable.unit.test.ts
src/test/application/diagnostics/applicationDiagnostics.unit.test.ts
src/test/application/diagnostics/promptHandler.unit.test.ts
src/test/application/diagnostics/sourceMapSupportService.unit.test.ts
src/test/application/diagnostics/commands/ignore.unit.test.ts

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

src/client/extension.ts
src/client/sourceMapSupport.ts
src/client/startupTelemetry.ts

src/client/terminals/codeExecution/terminalCodeExecution.ts
Expand Down
8 changes: 1 addition & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,6 @@ function getAllowedWarningsForWebPack(buildConfig) {
throw new Error('Unknown WebPack Configuration');
}
}
gulp.task('renameSourceMaps', async () => {
// By default source maps will be disabled in the extension.
// Users will need to use the command `python.enableSourceMapSupport` to enable source maps.
const extensionSourceMap = path.join(__dirname, 'out', 'client', 'extension.js.map');
await fsExtra.rename(extensionSourceMap, `${extensionSourceMap}.disabled`);
});

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

gulp.task('prePublishBundle', gulp.series('webpack', 'renameSourceMaps'));
gulp.task('prePublishBundle', gulp.series('webpack'));
gulp.task('checkDependencies', gulp.series('checkNativeDependencies'));
gulp.task('prePublishNonBundle', gulp.series('compile'));

Expand Down
17 changes: 0 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,6 @@
"command": "python.createEnvironment-button",
"title": "%python.command.python.createEnvironment.title%"
},
{
"category": "Python",
"command": "python.enableSourceMapSupport",
"title": "%python.command.python.enableSourceMapSupport.title%"
},
{
"category": "Python",
"command": "python.execInTerminal",
Expand Down Expand Up @@ -443,12 +438,6 @@
"scope": "machine-overridable",
"type": "string"
},
"python.diagnostics.sourceMapsEnabled": {
"default": false,
"description": "%python.diagnostics.sourceMapsEnabled.description%",
"scope": "application",
"type": "boolean"
},
"python.envFile": {
"default": "${workspaceFolder}/.env",
"description": "%python.envFile.description%",
Expand Down Expand Up @@ -1297,12 +1286,6 @@
"title": "%python.command.python.createTerminal.title%",
"when": "!virtualWorkspace && shellExecutionSupported"
},
{
"category": "Python",
"command": "python.enableSourceMapSupport",
"title": "%python.command.python.enableSourceMapSupport.title%",
"when": "!virtualWorkspace && shellExecutionSupported"
},
{
"category": "Python",
"command": "python.execInTerminal",
Expand Down
2 changes: 0 additions & 2 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"python.command.python.execInREPL.title": "Run Selection/Line in Python REPL",
"python.command.python.execSelectionInDjangoShell.title": "Run Selection/Line in Django Shell",
"python.command.python.reportIssue.title": "Report Issue...",
"python.command.python.enableSourceMapSupport.title": "Enable Source Map Support For Extension Debugging",
"python.command.python.clearCacheAndReload.title": "Clear Cache and Reload Window",
"python.command.python.analysis.restartLanguageServer.title": "Restart Language Server",
"python.command.python.launchTensorBoard.title": "Launch TensorBoard",
Expand All @@ -33,7 +32,6 @@
"python.condaPath.description": "Path to the conda executable to use for activation (version 4.4+).",
"python.debugger.deprecatedMessage": "This configuration will be deprecated soon. Please replace `python` with `debugpy` to use the new Python Debugger extension.",
"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",
"python.diagnostics.sourceMapsEnabled.description": "Enable source map support for meaningful stack traces in error logs.",
"python.envFile.description": "Absolute path to a file containing environment variable definitions.",
"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.",
"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.",
Expand Down
6 changes: 2 additions & 4 deletions src/client/application/diagnostics/applicationDiagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Resource } from '../../common/types';
import { IServiceContainer } from '../../ioc/types';
import { traceLog, traceVerbose } from '../../logging';
import { IApplicationDiagnostics } from '../types';
import { IDiagnostic, IDiagnosticsService, ISourceMapSupportService } from './types';
import { IDiagnostic, IDiagnosticsService } from './types';

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

public register() {
this.serviceContainer.get<ISourceMapSupportService>(ISourceMapSupportService).register();
}
public register() {}

public async performPreStartupHealthCheck(resource: Resource): Promise<void> {
// When testing, do not perform health checks, as modal dialogs can be displayed.
Expand Down
46 changes: 0 additions & 46 deletions src/client/application/diagnostics/surceMapSupportService.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/client/application/diagnostics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,3 @@ export const IInvalidPythonPathInDebuggerService = Symbol('IInvalidPythonPathInD
export interface IInvalidPythonPathInDebuggerService extends IDiagnosticsService {
validatePythonPath(pythonPath?: string, pythonPathSource?: PythonPathSource, resource?: Uri): Promise<boolean>;
}
export const ISourceMapSupportService = Symbol('ISourceMapSupportService');
export interface ISourceMapSupportService {
register(): void;
enable(): Promise<void>;
}
3 changes: 0 additions & 3 deletions src/client/application/serviceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

import { IServiceManager } from '../ioc/types';
import { registerTypes as diagnosticsRegisterTypes } from './diagnostics/serviceRegistry';
import { SourceMapSupportService } from './diagnostics/surceMapSupportService';
import { ISourceMapSupportService } from './diagnostics/types';

export function registerTypes(serviceManager: IServiceManager) {
serviceManager.addSingleton<ISourceMapSupportService>(ISourceMapSupportService, SourceMapSupportService);
diagnosticsRegisterTypes(serviceManager);
}
1 change: 0 additions & 1 deletion src/client/common/application/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ interface ICommandNameWithoutArgumentTypeMapping {
['editor.action.rename']: [];
[Commands.ViewOutput]: [];
[Commands.Start_REPL]: [];
[Commands.Enable_SourceMap_Support]: [];
[Commands.Exec_Selection_In_Terminal]: [];
[Commands.Exec_Selection_In_Django_Shell]: [];
[Commands.Create_Terminal]: [];
Expand Down
1 change: 0 additions & 1 deletion src/client/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export namespace Commands {
export const Create_Environment_Check = 'python.createEnvironmentCheck';
export const Create_Terminal = 'python.createTerminal';
export const Debug_In_Terminal = 'python.debugInTerminal';
export const Enable_SourceMap_Support = 'python.enableSourceMapSupport';
export const Exec_In_Terminal = 'python.execInTerminal';
export const Exec_In_Terminal_Icon = 'python.execInTerminal-icon';
export const Exec_In_Separate_Terminal = 'python.execInDedicatedTerminal';
Expand Down
9 changes: 0 additions & 9 deletions src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ import { Commands } from '../constants';

// External callers of localize use these tables to retrieve localized values.
export namespace Diagnostics {
export const warnSourceMaps = l10n.t(
'Source map support is enabled in the Python Extension, this will adversely impact performance of the extension.',
);
export const disableSourceMaps = l10n.t('Disable Source Map Support');

export const warnBeforeEnablingSourceMaps = l10n.t(
'Enabling source map support in the Python Extension will adversely impact performance of the extension.',
);
export const enableSourceMapsAndReloadVSC = l10n.t('Enable and reload Window.');
export const lsNotSupported = l10n.t(
'Your operating system does not meet the minimum requirements of the Python Language Server. Reverting to the alternative autocompletion provider, Jedi.',
);
Expand Down
4 changes: 0 additions & 4 deletions src/client/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ if ((Reflect as any).metadata === undefined) {
require('reflect-metadata');
}

// Initialize source maps (this must never be moved up nor further down).
import { initialize } from './sourceMapSupport';
initialize(require('vscode'));

//===============================================
// We start tracking the extension's startup time at this point. The
// locations at which we record various Intervals are marked below in
Expand Down
85 changes: 0 additions & 85 deletions src/client/sourceMapSupport.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ import { DiagnosticSeverity } from 'vscode';
import { ApplicationDiagnostics } from '../../../client/application/diagnostics/applicationDiagnostics';
import { EnvironmentPathVariableDiagnosticsService } from '../../../client/application/diagnostics/checks/envPathVariable';
import { InvalidPythonInterpreterService } from '../../../client/application/diagnostics/checks/pythonInterpreter';
import {
DiagnosticScope,
IDiagnostic,
IDiagnosticsService,
ISourceMapSupportService,
} from '../../../client/application/diagnostics/types';
import { DiagnosticScope, IDiagnostic, IDiagnosticsService } from '../../../client/application/diagnostics/types';
import { IApplicationDiagnostics } from '../../../client/application/types';
import { IWorkspaceService } from '../../../client/common/application/types';
import { createDeferred, createDeferredFromPromise } from '../../../client/common/utils/async';
Expand Down Expand Up @@ -62,19 +57,6 @@ suite('Application Diagnostics - ApplicationDiagnostics', () => {
process.env.VSC_PYTHON_CI_TEST = oldValueOfVSC_PYTHON_CI_TEST;
});

test('Register should register source maps', () => {
const sourceMapService = typemoq.Mock.ofType<ISourceMapSupportService>();
sourceMapService.setup((s) => s.register()).verifiable(typemoq.Times.once());

serviceContainer
.setup((d) => d.get(typemoq.It.isValue(ISourceMapSupportService), typemoq.It.isAny()))
.returns(() => sourceMapService.object);

appDiagnostics.register();

sourceMapService.verifyAll();
});

test('Performing Pre Startup Health Check must diagnose all validation checks', async () => {
envHealthCheck
.setup((e) => e.diagnose(typemoq.It.isAny()))
Expand Down
Loading

0 comments on commit f54c9f8

Please sign in to comment.