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
5 changes: 4 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
]
],
"env": {
"MOCHA_REPORTER_JUNIT": "true"
}
},
{
"name": "Unit Tests (without VS Code, *.unit.test.ts)",
Expand Down
2 changes: 1 addition & 1 deletion build/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ exports.ExtensionRootDir = path.join(__dirname, '..');
const jsonFileWithListOfOldFiles = path.join(__dirname, 'existingFiles.json');
function getListOfExcludedFiles() {
const files = JSON.parse(fs.readFileSync(jsonFileWithListOfOldFiles).toString());
return files.map(file => path.join(exports.ExtensionRootDir, file));
return files.map(file => path.join(exports.ExtensionRootDir, file.replace(/\//g, path.sep)));
}
exports.filesNotToCheck = getListOfExcludedFiles();
2 changes: 1 addition & 1 deletion build/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const ExtensionRootDir = path.join(__dirname, '..');
const jsonFileWithListOfOldFiles = path.join(__dirname, 'existingFiles.json');
function getListOfExcludedFiles() {
const files = JSON.parse(fs.readFileSync(jsonFileWithListOfOldFiles).toString()) as string[];
return files.map(file => path.join(ExtensionRootDir, file));
return files.map(file => path.join(ExtensionRootDir, file.replace(/\//g, path.sep)));
}

export const filesNotToCheck: string[] = getListOfExcludedFiles();
3 changes: 2 additions & 1 deletion build/tslint-rules/baseRuleWalker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const Lint = require("tslint");
const constants_1 = require("../constants");
class BaseRuleWalker extends Lint.RuleWalker {
Expand All @@ -11,7 +12,7 @@ class BaseRuleWalker extends Lint.RuleWalker {
}
sholdIgnoreCcurrentFile(node) {
const sourceFile = node.getSourceFile();
return sourceFile && sourceFile.fileName && this.filesToIgnore.indexOf(sourceFile.fileName) >= 0;
return sourceFile && sourceFile.fileName && this.filesToIgnore.indexOf(sourceFile.fileName.replace(/\//g, path.sep)) >= 0;
}
}
exports.BaseRuleWalker = BaseRuleWalker;
3 changes: 2 additions & 1 deletion build/tslint-rules/baseRuleWalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

'use strict';

import * as path from 'path';
import * as Lint from 'tslint';
import * as ts from 'typescript';
import { filesNotToCheck } from '../constants';
Expand All @@ -11,6 +12,6 @@ export class BaseRuleWalker extends Lint.RuleWalker {
private readonly filesToIgnore = filesNotToCheck;
protected sholdIgnoreCcurrentFile(node: ts.Node) {
const sourceFile = node.getSourceFile();
return sourceFile && sourceFile.fileName && this.filesToIgnore.indexOf(sourceFile.fileName) >= 0;
return sourceFile && sourceFile.fileName && this.filesToIgnore.indexOf(sourceFile.fileName.replace(/\//g, path.sep)) >= 0;
}
}
2 changes: 1 addition & 1 deletion build/tslint-rules/messagesMustBeLocalizedRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const methodNames = [
// From IOutputChannel (vscode.OutputChannel)
'appendLine', 'appendLine'
];
const failureMessage = 'Messages must be localized in the Python Extension';
const failureMessage = 'Messages must be localized in the Python Extension (use src/client/common/utils/localize.ts)';
class NoStringLiteralsInMessages extends baseRuleWalker_1.BaseRuleWalker {
visitCallExpression(node) {
const prop = node.expression;
Expand Down
12 changes: 7 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const copyrightHeaders = [copyrightHeader.join('\n'), copyrightHeader.join('\r\n

gulp.task('precommit', (done) => run({ exitOnError: true, mode: 'staged' }, done));

gulp.task('hygiene-watch', () => gulp.watch(tsFilter, debounce(() => run({ mode: 'changes', skipFormatCheck: true, skipIndentationCheck: true, skipCopyrightCheck: true }), 100)));
gulp.task('hygiene-watch', () => gulp.watch(tsFilter, gulp.series('hygiene-modified')));

gulp.task('hygiene', (done) => run({ mode: 'all', skipFormatCheck: true, skipIndentationCheck: true }, done));

Expand Down Expand Up @@ -533,15 +533,15 @@ function getModifiedFilesSync() {
.split(/\r?\n/)
.filter(l => !!l)
.filter(l => l.length > 0)
.map(l => l.trim())
.map(l => l.trim().replace(/\//g, path.sep))
.map(l => path.join(__dirname, l));
} else {
const out = cp.execSync('git status -u -s', { encoding: 'utf8' });
return out
.split(/\r?\n/)
.filter(l => !!l)
.filter(l => _.intersection(['M', 'A', 'R', 'C', 'U', '?'], l.substring(0, 2).trim().split('')).length > 0)
.map(l => path.join(__dirname, l.substring(2).trim()));
.map(l => path.join(__dirname, l.substring(2).trim().replace(/\//g, path.sep)));
}
}

Expand All @@ -562,11 +562,13 @@ function getFileListToProcess(options) {

// If we need only modified files, then filter the glob.
if (options && options.mode === 'changes') {
return getModifiedFilesSync();
return getModifiedFilesSync()
.filter(file => fs.existsSync(file));
}

if (options && options.mode === 'staged') {
return getStagedFilesSync();
return getStagedFilesSync()
.filter(file => fs.existsSync(file));
}

return all;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use strict';

import { DebugSession } from 'vscode-debugadapter';
import { IKnownLaunchRequestArguments, LaunchRequestArguments } from '../../types';
import { LaunchRequestArguments } from '../../types';
import { IDebugLauncherScriptProvider } from '../types';
import { LocalDebugClient } from './LocalDebugClient';

Expand All @@ -18,11 +18,6 @@ export class LocalDebugClientV2 extends LocalDebugClient {
if (this.args.noDebug) {
additionalPtvsdArgs.push('--nodebug');
}
const multiProcessPropety: keyof IKnownLaunchRequestArguments = 'multiProcess';
const multiProcess = (this.args as Object).hasOwnProperty(multiProcessPropety) ? this.args.multiProcess : true;
if (multiProcess) {
additionalPtvsdArgs.push('--multiprocess');
}
return [launcher, ...additionalPtvsdArgs, '--client', '--host', 'localhost', '--port', debugPort.toString()];
}
protected buildStandardArguments() {
Expand Down
102 changes: 0 additions & 102 deletions src/client/debugger/extension/hooks/processTerminationHandler.ts

This file was deleted.

96 changes: 0 additions & 96 deletions src/client/debugger/extension/hooks/processTerminationService.ts

This file was deleted.

10 changes: 1 addition & 9 deletions src/client/debugger/extension/hooks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

'use strict';

import { DebugSession, DebugSessionCustomEvent, Disposable } from 'vscode';
import { DebugSession, DebugSessionCustomEvent } from 'vscode';
import { AttachRequestArguments, LaunchRequestArguments } from '../../types';

export const IDebugSessionEventHandlers = Symbol('IDebugSessionEventHandlers');
Expand Down Expand Up @@ -59,11 +59,3 @@ export const IChildProcessAttachService = Symbol('IChildProcessAttachService');
export interface IChildProcessAttachService {
attach(data: ChildProcessLaunchData): Promise<void>;
}

export const IProcessTerminationService = Symbol('IProcessTerminationService');
export interface IProcessTerminationService extends Disposable {
trackProcess(pid: number, parentOrGrandParentPid?: number): void;
terminateProcess(pid: number): void;
terminateOrphanedProcesses(): void;
terminateTrackedProcesses(): void;
}
6 changes: 1 addition & 5 deletions src/client/debugger/extension/serviceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ import { PythonV2DebugConfigurationProvider } from './configProviders/pythonV2Pr
import { IConfigurationProviderUtils } from './configProviders/types';
import { ChildProcessAttachEventHandler } from './hooks/childProcessAttachHandler';
import { ChildProcessAttachService } from './hooks/childProcessAttachService';
import { ProcessTerminationEventHandler } from './hooks/processTerminationHandler';
import { ProcessTerminationService } from './hooks/processTerminationService';
import { IChildProcessAttachService, IDebugSessionEventHandlers, IProcessTerminationService } from './hooks/types';
import { IChildProcessAttachService, IDebugSessionEventHandlers } from './hooks/types';
import { IDebugConfigurationProvider, IDebuggerBanner } from './types';

export function registerTypes(serviceManager: IServiceManager) {
serviceManager.addSingleton<DebugConfigurationProvider>(IDebugConfigurationProvider, PythonV2DebugConfigurationProvider);
serviceManager.addSingleton<IConfigurationProviderUtils>(IConfigurationProviderUtils, ConfigurationProviderUtils);
serviceManager.addSingleton<IDebuggerBanner>(IDebuggerBanner, DebuggerBanner);
serviceManager.addSingleton<IProcessTerminationService>(IProcessTerminationService, ProcessTerminationService);
serviceManager.addSingleton<IChildProcessAttachService>(IChildProcessAttachService, ChildProcessAttachService);
serviceManager.addSingleton<IDebugSessionEventHandlers>(IDebugSessionEventHandlers, ChildProcessAttachEventHandler);
serviceManager.addSingleton<IDebugSessionEventHandlers>(IDebugSessionEventHandlers, ProcessTerminationEventHandler);
}
1 change: 0 additions & 1 deletion src/client/debugger/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ interface ICommonDebugArguments {
debugStdLib?: boolean;
logToFile?: boolean;
debugOptions?: DebugOptions[];
multiProcess?: boolean;
port?: number;
host?: string;
// Show return values of functions while stepping.
Expand Down
Loading