This commit is contained in:
Andre Weinand 2016-02-28 00:32:31 +01:00
Родитель d91d7ed586
Коммит 29821a87ec
4 изменённых файлов: 20 добавлений и 19 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -7,3 +7,4 @@
/obj/ /obj/
*.vsix *.vsix
mono-debug.userprefs mono-debug.userprefs
npm-debug.log

Просмотреть файл

@ -1,7 +1,7 @@
{ {
"name": "mono-debug", "name": "mono-debug",
"displayName": "Mono Debug", "displayName": "Mono Debug",
"version": "0.10.13", "version": "0.10.14",
"publisher": "ms-vscode", "publisher": "ms-vscode",
"description": "Visual Studio Code debugger extension for Mono", "description": "Visual Studio Code debugger extension for Mono",
"icon": "images/mono-debug-icon.svg", "icon": "images/mono-debug-icon.svg",
@ -33,8 +33,8 @@
"url": "https://github.com/Microsoft/vscode-mono-debug/issues" "url": "https://github.com/Microsoft/vscode-mono-debug/issues"
}, },
"devDependencies": { "devDependencies": {
"mocha": "^2.3.4", "mocha": "^2.4.5",
"typescript": "^1.7.3", "typescript": "^1.8.2",
"vscode-debugprotocol": "~1.6.0-pre8" "vscode-debugprotocol": "~1.6.0-pre8"
}, },
"contributes": { "contributes": {

Просмотреть файл

@ -108,7 +108,7 @@ namespace VSCodeDebug
{ {
OperatingSystem os = Environment.OSVersion; OperatingSystem os = Environment.OSVersion;
if (os.Platform != PlatformID.MacOSX && os.Platform != PlatformID.Unix) { if (os.Platform != PlatformID.MacOSX && os.Platform != PlatformID.Unix) {
SendErrorResponse(response, 3000, "Mono Debug is not supported on this platform ({_platform})", new { _platform = os.Platform.ToString() }, true, true); SendErrorResponse(response, 3000, "Mono Debug is not supported on this platform ({_platform}).", new { _platform = os.Platform.ToString() }, true, true);
return; return;
} }
@ -140,12 +140,12 @@ namespace VSCodeDebug
// validate argument 'program' // validate argument 'program'
string programPath = getString(args, "program"); string programPath = getString(args, "program");
if (programPath == null) { if (programPath == null) {
SendErrorResponse(response, 3001, "property 'program' is missing or empty", null); SendErrorResponse(response, 3001, "Property 'program' is missing or empty.", null);
return; return;
} }
programPath = ConvertClientPathToDebugger(programPath); programPath = ConvertClientPathToDebugger(programPath);
if (!File.Exists(programPath) && !Directory.Exists(programPath)) { if (!File.Exists(programPath) && !Directory.Exists(programPath)) {
SendErrorResponse(response, 3002, "program '{path}' does not exist", new { path = programPath }); SendErrorResponse(response, 3002, "Program '{path}' does not exist.", new { path = programPath });
return; return;
} }
@ -163,12 +163,12 @@ namespace VSCodeDebug
if (workingDirectory != null) { if (workingDirectory != null) {
workingDirectory = workingDirectory.Trim(); workingDirectory = workingDirectory.Trim();
if (workingDirectory.Length == 0) { if (workingDirectory.Length == 0) {
SendErrorResponse(response, 3003, "property 'cwd' is empty"); SendErrorResponse(response, 3003, "Property 'cwd' is empty.");
return; return;
} }
workingDirectory = ConvertClientPathToDebugger(workingDirectory); workingDirectory = ConvertClientPathToDebugger(workingDirectory);
if (!Directory.Exists(workingDirectory)) { if (!Directory.Exists(workingDirectory)) {
SendErrorResponse(response, 3004, "cwd '{path}' does not exist", new { path = workingDirectory }); SendErrorResponse(response, 3004, "Working directory '{path}' does not exist.", new { path = workingDirectory });
return; return;
} }
} }
@ -178,12 +178,12 @@ namespace VSCodeDebug
if (runtimeExecutable != null) { if (runtimeExecutable != null) {
runtimeExecutable = runtimeExecutable.Trim(); runtimeExecutable = runtimeExecutable.Trim();
if (runtimeExecutable.Length == 0) { if (runtimeExecutable.Length == 0) {
SendErrorResponse(response, 3005, "property 'runtimeExecutable' is empty"); SendErrorResponse(response, 3005, "Property 'runtimeExecutable' is empty.");
return; return;
} }
runtimeExecutable = ConvertClientPathToDebugger(runtimeExecutable); runtimeExecutable = ConvertClientPathToDebugger(runtimeExecutable);
if (!File.Exists(runtimeExecutable)) { if (!File.Exists(runtimeExecutable)) {
SendErrorResponse(response, 3006, "runtimeExecutable '{path}' does not exist", new { path = runtimeExecutable }); SendErrorResponse(response, 3006, "Runtime executable '{path}' does not exist.", new { path = runtimeExecutable });
return; return;
} }
} }
@ -217,7 +217,7 @@ namespace VSCodeDebug
string mono_path = runtimeExecutable; string mono_path = runtimeExecutable;
if (mono_path == null) { if (mono_path == null) {
if (!Terminal.IsOnPath(MONO)) { if (!Terminal.IsOnPath(MONO)) {
SendErrorResponse(response, 3011, "can't find runtime '{_runtime}' on PATH", new { _runtime = MONO }); SendErrorResponse(response, 3011, "Can't find runtime '{_runtime}' on PATH.", new { _runtime = MONO });
return; return;
} }
mono_path = MONO; // try to find mono through PATH mono_path = MONO; // try to find mono through PATH
@ -245,7 +245,7 @@ namespace VSCodeDebug
if (externalConsole) { if (externalConsole) {
var result = Terminal.LaunchInTerminal(workingDirectory, mono_path, mono_args, program, arguments, env); var result = Terminal.LaunchInTerminal(workingDirectory, mono_path, mono_args, program, arguments, env);
if (!result.Success) { if (!result.Success) {
SendErrorResponse(response, 3012, "can't launch terminal ({reason})", new { reason = result.Message }); SendErrorResponse(response, 3012, "Can't launch terminal ({reason}).", new { reason = result.Message });
return; return;
} }
} else { } else {
@ -297,7 +297,7 @@ namespace VSCodeDebug
_process.BeginErrorReadLine(); _process.BeginErrorReadLine();
} }
catch (Exception e) { catch (Exception e) {
SendErrorResponse(response, 3012, "can't launch terminal ({reason})", new { reason = e.Message }); SendErrorResponse(response, 3012, "Can't launch terminal ({reason}).", new { reason = e.Message });
return; return;
} }
} }
@ -349,20 +349,20 @@ namespace VSCodeDebug
// validate argument 'address' // validate argument 'address'
var host = getString(args, "address"); var host = getString(args, "address");
if (host == null) { if (host == null) {
SendErrorResponse(response, 3007, "property 'address' is missing or empty"); SendErrorResponse(response, 3007, "Property 'address' is missing or empty.");
return; return;
} }
// validate argument 'port' // validate argument 'port'
var port = getInt(args, "port", -1); var port = getInt(args, "port", -1);
if (port == -1) { if (port == -1) {
SendErrorResponse(response, 3008, "property 'port' is missing"); SendErrorResponse(response, 3008, "Property 'port' is missing.");
return; return;
} }
IPAddress address = Utilities.ResolveIPAddress(host); IPAddress address = Utilities.ResolveIPAddress(host);
if (address == null) { if (address == null) {
SendErrorResponse(response, 3013, "invalid address '{address}'", new { address = address }); SendErrorResponse(response, 3013, "Invalid address '{address}'.", new { address = address });
return; return;
} }
Debugger.Connect(address, port); Debugger.Connect(address, port);
@ -663,7 +663,7 @@ namespace VSCodeDebug
error = "no active stackframe"; error = "no active stackframe";
} }
} }
SendErrorResponse(response, 3014, "evaluate request failed ({_reason})", new { _reason = error } ); SendErrorResponse(response, 3014, "Evaluate request failed ({_reason}).", new { _reason = error } );
} }
//---- private ------------------------------------------ //---- private ------------------------------------------

Просмотреть файл

@ -5,7 +5,7 @@
"removeComments": false, "removeComments": false,
"preserveConstEnums": true, "preserveConstEnums": true,
"target": "es5", "target": "es5",
"sourceMap": true, "inlineSourceMap": true,
"outDir": "out" "outDir": "out"
} }
} }