Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9af044b

Browse files
authored
Merge branch 'master' into Release-0.9.1
2 parents b137764 + 08008f3 commit 9af044b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1976
-970
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ contributors (if you would like to contribute a translation, see the
8989
[pull request which added simplified Chinese](https://github.com/Microsoft/vscode-python/pull/240)):
9090

9191
* `en`
92+
* `ja`
93+
* `ru`
9294
* `zh-cn`
9395

9496
## Data/Telemetry

package-lock.json

+1,037-104
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "python",
33
"displayName": "Python",
44
"description": "Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, and more.",
5-
"version": "0.9.1",
5+
"version": "2018.1.0-alpha",
66
"publisher": "ms-python",
77
"author": {
88
"name": "Microsoft Corporation"
@@ -627,6 +627,16 @@
627627
"type": "string",
628628
"description": "Absolute path to a file containing environment variable definitions.",
629629
"default": ""
630+
},
631+
"port": {
632+
"type": "number",
633+
"description": "Debug port (default is 0, resulting in the use of a dynamic port).",
634+
"default": 0
635+
},
636+
"host": {
637+
"type": "string",
638+
"description": "IP address of the of the local debug server (default is localhost).",
639+
"default": "localhost"
630640
}
631641
}
632642
},
@@ -1321,6 +1331,12 @@
13211331
"description": "Port number used for debugging of unittests.",
13221332
"scope": "resource"
13231333
},
1334+
"python.unitTest.debugHost": {
1335+
"type": "number",
1336+
"default": "localhost",
1337+
"description": "IP Address of the of the local unit test server (default is localhost or use 127.0.0.1).",
1338+
"scope": "resource"
1339+
},
13241340
"python.unitTest.cwd": {
13251341
"type": "string",
13261342
"default": null,
@@ -1506,6 +1522,7 @@
15061522
"lint": "tslint src/**/*.ts -t verbose"
15071523
},
15081524
"dependencies": {
1525+
"arch": "^2.1.0",
15091526
"diff-match-patch": "^1.0.0",
15101527
"fs-extra": "^4.0.2",
15111528
"fuzzy": "^0.1.3",
@@ -1567,6 +1584,7 @@
15671584
"tslint-microsoft-contrib": "^5.0.1",
15681585
"typescript": "^2.6.2",
15691586
"typescript-formatter": "^6.0.0",
1570-
"vscode": "^1.1.5"
1587+
"vscode": "^1.1.5",
1588+
"vscode-debugadapter-testsupport": "^1.25.0"
15711589
}
15721590
}

package.nls.ja.json

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"python.command.python.sortImports.title": "import 文を並び替える",
3+
"python.command.python.startREPL.title": "REPL を開始",
4+
"python.command.python.buildWorkspaceSymbols.title": "ワークスペースのシンボルをビルド",
5+
"python.command.python.runtests.title": "すべての単体テストを実行",
6+
"python.command.python.debugtests.title": "すべての単体テストをデバッグ",
7+
"python.command.python.execInTerminal.title": "ターミナルで Python ファイルを実行",
8+
"python.command.python.setInterpreter.title": "インタープリターを選択",
9+
"python.command.python.updateSparkLibrary.title": "ワークスペース PySpark ライブラリを更新",
10+
"python.command.python.refactorExtractVariable.title": "変数を抽出",
11+
"python.command.python.refactorExtractMethod.title": "メソッドを抽出",
12+
"python.command.python.viewTestOutput.title": "単体テストの出力を表示",
13+
"python.command.python.selectAndRunTestMethod.title": "単体テストメソッドを実行...",
14+
"python.command.python.selectAndDebugTestMethod.title": "単体テストメソッドをデバッグ...",
15+
"python.command.python.selectAndRunTestFile.title": "単体テストファイルを実行...",
16+
"python.command.python.runCurrentTestFile.title": "現在の単体テストファイルを実行",
17+
"python.command.python.runFailedTests.title": "失敗した単体テストを実行",
18+
"python.command.python.execSelectionInTerminal.title": "Python ターミナルで選択範囲/行を実行",
19+
"python.command.python.execSelectionInDjangoShell.title": "Django シェルで選択範囲/行を実行",
20+
"python.command.jupyter.runSelectionLine.title": "選択範囲/行を実行",
21+
"python.command.jupyter.execCurrentCell.title": "セルを実行",
22+
"python.command.jupyter.execCurrentCellAndAdvance.title": "セルを実行して次へ",
23+
"python.command.jupyter.gotToPreviousCell.title": "前のセルに移動",
24+
"python.command.jupyter.gotToNextCell.title": "次のセルに移動",
25+
"python.command.python.goToPythonObject.title": "Python オブジェクトに移動",
26+
"python.snippet.launch.standard.label": "Python",
27+
"python.snippet.launch.standard.description": "標準出力で Python プログラムをデバッグ",
28+
"python.snippet.launch.pyspark.label": "Python: PySpark",
29+
"python.snippet.launch.pyspark.description": "PySpark をデバッグ",
30+
"python.snippet.launch.module.label": "Python: モジュール",
31+
"python.snippet.launch.module.description": "Python モジュールをデバッグ",
32+
"python.snippet.launch.terminal.label": "Python: ターミナル (統合)",
33+
"python.snippet.launch.terminal.description": "統合ターミナル/コンソールで Python プログラムをデバッグ",
34+
"python.snippet.launch.externalTerminal.label": "Python: ターミナル (外部)",
35+
"python.snippet.launch.externalTerminal.description": "外部のターミナル/コンソールで Python プログラムをデバッグ",
36+
"python.snippet.launch.django.label": "Python: Django",
37+
"python.snippet.launch.django.description": "Django アプリケーションをデバッグ",
38+
"python.snippet.launch.flask.label": "Python: Flask (0.11.x 以降)",
39+
"python.snippet.launch.flask.description": "Flask アプリケーションをデバッグ",
40+
"python.snippet.launch.flaskOld.label": "Python: Flask (0.10.x 以前)",
41+
"python.snippet.launch.flaskOld.description": "旧式の Flask アプリケーションをデバッグ",
42+
"python.snippet.launch.pyramid.label": "Python: Pyramid アプリケーション",
43+
"python.snippet.launch.pyramid.description": "Pyramid アプリケーションをデバッグ",
44+
"python.snippet.launch.watson.label": "Python: Watson アプリケーション",
45+
"python.snippet.launch.watson.description": "Watson アプリケーションをデバッグ",
46+
"python.snippet.launch.attach.label": "Python: アタッチ",
47+
"python.snippet.launch.attach.description": "リモートデバッグのためにデバッガをアタッチ",
48+
"python.snippet.launch.scrapy.label": "Python: Scrapy",
49+
"python.snippet.launch.scrapy.description": "統合ターミナル/コンソールで Scrapy を実行"
50+
}

package.nls.ru.json

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"python.command.python.sortImports.title": "Отсортировать Imports",
3+
"python.command.python.startREPL.title": "Открыть REPL",
4+
"python.command.python.buildWorkspaceSymbols.title": "Собрать символы рабочего пространства",
5+
"python.command.python.runtests.title": "Запустить все тесты",
6+
"python.command.python.debugtests.title": "Запустить все тесты под отладчиком",
7+
"python.command.python.execInTerminal.title": "Выполнить файл в консоли",
8+
"python.command.python.setInterpreter.title": "Выбрать интерпретатор",
9+
"python.command.python.updateSparkLibrary.title": "Обновить библиотеки PySpark",
10+
"python.command.python.refactorExtractVariable.title": "Извлечь в переменную",
11+
"python.command.python.refactorExtractMethod.title": "Извлечь в метод",
12+
"python.command.python.viewTestOutput.title": "Показать вывод теста",
13+
"python.command.python.selectAndRunTestMethod.title": "Запусть тестовый метод...",
14+
"python.command.python.selectAndDebugTestMethod.title": "Отладить тестовый метод...",
15+
"python.command.python.selectAndRunTestFile.title": "Запустить тестовый файл...",
16+
"python.command.python.runCurrentTestFile.title": "Запустить текущий тестовый файл",
17+
"python.command.python.runFailedTests.title": "Запустить непрошедшие тесты",
18+
"python.command.python.execSelectionInTerminal.title": "Выполнить выбранный текст или текущую строку в консоли",
19+
"python.command.python.execSelectionInDjangoShell.title": "Выполнить выбранный текст или текущую строку в оболочке Django",
20+
"python.command.jupyter.runSelectionLine.title": "Выполнить выбранный текст или текущую строку",
21+
"python.command.jupyter.execCurrentCell.title": "Выполнить ячейку",
22+
"python.command.jupyter.execCurrentCellAndAdvance.title": "Выполнить ячейку и перейти к следующей",
23+
"python.command.jupyter.gotToPreviousCell.title": "Перейти к предыдущей ячейке",
24+
"python.command.jupyter.gotToNextCell.title": "Перейти к следующей ячейке",
25+
"python.command.python.goToPythonObject.title": "Перейти к объекту Python",
26+
"python.snippet.launch.standard.label": "Python",
27+
"python.snippet.launch.standard.description": "Отладить программу Python со стандартным выводом",
28+
"python.snippet.launch.pyspark.label": "Python: PySpark",
29+
"python.snippet.launch.pyspark.description": "Отладка PySpark",
30+
"python.snippet.launch.module.label": "Python: Модуль",
31+
"python.snippet.launch.module.description": "Отладка модуля",
32+
"python.snippet.launch.terminal.label": "Python: Интегрированная консоль",
33+
"python.snippet.launch.terminal.description": "Отладка программы Python в интегрированной консоли",
34+
"python.snippet.launch.externalTerminal.label": "Python: Внешний терминал",
35+
"python.snippet.launch.externalTerminal.description": "Отладка программы Python во внешней консоли",
36+
"python.snippet.launch.django.label": "Python: Django",
37+
"python.snippet.launch.django.description": "Отладка приложения Django",
38+
"python.snippet.launch.flask.label": "Python: Flask (0.11.x или новее)",
39+
"python.snippet.launch.flask.description": "Отладка приложения Flask",
40+
"python.snippet.launch.flaskOld.label": "Python: Flask (0.10.x или старее)",
41+
"python.snippet.launch.flaskOld.description": "Отладка приложения Flask (старый стиль)",
42+
"python.snippet.launch.pyramid.label": "Python: Приложение Pyramid",
43+
"python.snippet.launch.pyramid.description": "Отладка приложения Pyramid",
44+
"python.snippet.launch.watson.label": "Python: Приложение Watson",
45+
"python.snippet.launch.watson.description": "Отладка приложения Watson",
46+
"python.snippet.launch.attach.label": "Python: Подключить отладчик",
47+
"python.snippet.launch.attach.description": "Подключить отладчик для удаленной отладки",
48+
"python.snippet.launch.scrapy.label": "Python: Scrapy",
49+
"python.snippet.launch.scrapy.description": "Scrapy в интегрированной консоли"
50+
}

pythonFiles/completion.py

-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import traceback
77
import platform
88

9-
WORD_RE = re.compile(r'\w')
109
jediPreview = False
1110

1211
class RedirectStdout(object):
@@ -111,8 +110,6 @@ def _get_call_signatures(self, script):
111110
continue
112111
if param.name == 'self' and pos == 0:
113112
continue
114-
if WORD_RE.match(param.name) is None:
115-
continue
116113
try:
117114
name, value = param.description.split('=')
118115
except ValueError:
@@ -155,8 +152,6 @@ def _get_call_signatures_with_args(self, script):
155152
continue
156153
if param.name == 'self' and pos == 0:
157154
continue
158-
if WORD_RE.match(param.name) is None:
159-
continue
160155
try:
161156
name, value = param.description.split('=')
162157
except ValueError:

src/client/common/configSettings.ts

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export interface ISortImportSettings {
3636
export interface IUnitTestSettings {
3737
promptToConfigure: boolean;
3838
debugPort: number;
39+
debugHost?: string;
3940
nosetestsEnabled: boolean;
4041
nosetestPath: string;
4142
nosetestArgs: string[];

src/client/common/net/socket/socketServer.ts

+18-22
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
1-
"use strict";
2-
3-
import * as net from "net";
41
import { EventEmitter } from 'events';
2+
import * as net from 'net';
53
import { createDeferred } from '../../helpers';
64

75
export class SocketServer extends EventEmitter {
8-
private socketServer: net.Server = null;
6+
private socketServer: net.Server | undefined;
97
constructor() {
108
super();
119
}
1210

1311
public Stop() {
14-
if (this.socketServer === null) { return; }
12+
if (!this.socketServer) { return; }
1513
try {
1614
this.socketServer.close();
17-
}
18-
catch (ex) { }
19-
this.socketServer = null;
15+
// tslint:disable-next-line:no-empty
16+
} catch (ex) { }
17+
this.socketServer = undefined;
2018
}
2119

22-
public Start(): Promise<number> {
20+
public Start(options: { port?: number, host?: string } = {}): Promise<number> {
2321
const def = createDeferred<number>();
2422
this.socketServer = net.createServer(this.connectionListener.bind(this));
2523

26-
this.socketServer.listen(0, function (this: SocketServer) {
27-
def.resolve(this.socketServer.address().port);
28-
}.bind(this));
24+
const port = typeof options.port === 'number' ? options.port! : 0;
25+
const host = typeof options.host === 'string' ? options.host! : 'localhost';
26+
this.socketServer!.listen({ port, host }, () => {
27+
def.resolve(this.socketServer!.address().port);
28+
});
2929

30-
this.socketServer.on("error", ex => {
30+
this.socketServer!.on('error', ex => {
3131
console.error('Error in Socket Server', ex);
32-
if (def.completed) {
33-
// Ooops
34-
debugger;
35-
}
3632
const msg = `Failed to start the socket server. (Error: ${ex.message})`;
3733

3834
def.reject(msg);
@@ -41,14 +37,14 @@ export class SocketServer extends EventEmitter {
4137
}
4238

4339
private connectionListener(client: net.Socket) {
44-
client.on("close", function () {
40+
client.on('close', () => {
4541
this.emit('close', client);
46-
}.bind(this));
47-
client.on("data", function (data: Buffer) {
42+
});
43+
client.on('data', (data: Buffer) => {
4844
this.emit('data', client, data);
49-
}.bind(this));
45+
});
5046

51-
client.on("timeout", d => {
47+
client.on('timeout', d => {
5248
// let msg = "Debugger client timedout, " + d;
5349
});
5450
}
+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
import * as os from 'os';
5-
4+
import * as arch from 'arch';
65
export const WINDOWS_PATH_VARIABLE_NAME = 'Path';
76
export const NON_WINDOWS_PATH_VARIABLE_NAME = 'PATH';
87
export const IS_WINDOWS = /^win/.test(process.platform);
9-
export const IS_64_BIT = os.arch() === 'x64';
8+
export const IS_64_BIT = arch() === 'x64';

src/client/common/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ export function getSubDirectories(rootDir: string): Promise<string[]> {
340340
subDirs.push(fullPath);
341341
}
342342
}
343-
catch (ex) {
344-
}
343+
// tslint:disable-next-line:no-empty
344+
catch (ex) {}
345345
});
346346
resolve(subDirs);
347347
});

src/client/debugger/Common/Contracts.ts

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
"use strict";
2-
import * as net from "net";
1+
// tslint:disable:interface-name member-access no-single-line-block-comment no-any no-stateless-class member-ordering prefer-method-signature
2+
3+
'use strict';
34
import { ChildProcess } from 'child_process';
4-
import { DebugProtocol } from "vscode-debugprotocol";
5-
import { OutputEvent } from "vscode-debugadapter";
5+
import * as net from 'net';
6+
import { OutputEvent } from 'vscode-debugadapter';
7+
import { DebugProtocol } from 'vscode-debugprotocol';
68

79
export class TelemetryEvent extends OutputEvent {
810
body: {
@@ -14,25 +16,25 @@ export class TelemetryEvent extends OutputEvent {
1416
data?: any;
1517
};
1618
constructor(output: string, data?: any) {
17-
super(output, "telemetry");
19+
super(output, 'telemetry');
1820
if (data) {
1921
this.body.data = data;
2022
}
2123
}
2224
}
23-
export const DjangoApp = "DJANGO";
25+
export const DjangoApp = 'DJANGO';
2426
export enum DebugFlags {
2527
None = 0,
2628
IgnoreCommandBursts = 1
2729
}
2830

2931
export class DebugOptions {
30-
public static get WaitOnAbnormalExit(): string { return "WaitOnAbnormalExit"; }
31-
public static get WaitOnNormalExit(): string { return "WaitOnNormalExit"; }
32-
public static get RedirectOutput(): string { return "RedirectOutput"; }
33-
public static get DjangoDebugging(): string { return "DjangoDebugging"; }
34-
public static get DebugStdLib(): string { return "DebugStdLib"; }
35-
public static get BreakOnSystemExitZero(): string { return "BreakOnSystemExitZero"; }
32+
public static get WaitOnAbnormalExit(): string { return 'WaitOnAbnormalExit'; }
33+
public static get WaitOnNormalExit(): string { return 'WaitOnNormalExit'; }
34+
public static get RedirectOutput(): string { return 'RedirectOutput'; }
35+
public static get DjangoDebugging(): string { return 'DjangoDebugging'; }
36+
public static get DebugStdLib(): string { return 'DebugStdLib'; }
37+
public static get BreakOnSystemExitZero(): string { return 'BreakOnSystemExitZero'; }
3638
}
3739

3840
export interface ExceptionHandling {
@@ -55,7 +57,9 @@ export interface LaunchRequestArguments extends DebugProtocol.LaunchRequestArgum
5557
env?: Object;
5658
envFile: string;
5759
exceptionHandling?: ExceptionHandling;
58-
console?: "none" | "integratedTerminal" | "externalTerminal";
60+
console?: 'none' | 'integratedTerminal' | 'externalTerminal';
61+
port?: number;
62+
host?: string;
5963
}
6064

6165
export interface AttachRequestArguments extends DebugProtocol.AttachRequestArguments {
@@ -76,7 +80,8 @@ export enum FrameKind {
7680
None,
7781
Python,
7882
Django
79-
};
83+
}
84+
8085
export enum enum_EXCEPTION_STATE {
8186
BREAK_MODE_NEVER = 0,
8287
BREAK_MODE_ALWAYS = 1,
@@ -99,7 +104,7 @@ export enum PythonEvaluationResultFlags {
99104
MethodCall = 2,
100105
SideEffects = 4,
101106
Raw = 8,
102-
HasRawRepr = 16,
107+
HasRawRepr = 16
103108
}
104109

105110
export interface IPythonProcess extends NodeJS.EventEmitter {
@@ -138,14 +143,12 @@ export interface IPythonEvaluationResult {
138143
Frame: IPythonStackFrame;
139144
}
140145

141-
142146
export interface IPythonModule {
143147
ModuleId: number;
144148
Name: string;
145149
Filename: string;
146150
}
147151

148-
149152
export interface IPythonThread {
150153
IsWorkerThread: boolean;
151154
Process: IPythonProcess;

src/client/debugger/DebugClients/LocalDebugClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class LocalDebugClient extends DebugClient {
4646

4747
public CreateDebugServer(pythonProcess: IPythonProcess): BaseDebugServer {
4848
this.pythonProcess = pythonProcess;
49-
this.debugServer = new LocalDebugServer(this.debugSession, this.pythonProcess);
49+
this.debugServer = new LocalDebugServer(this.debugSession, this.pythonProcess, this.args);
5050
return this.debugServer;
5151
}
5252

0 commit comments

Comments
 (0)