Skip to content

Commit

Permalink
Fixes for latest updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cwensley committed Nov 13, 2020
1 parent 984e166 commit b8a2113
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 56 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ jobs:

- name: Set VSIX name variable
id: vsix_name
run: echo "::set-output name=filename::$(ls mono-debug-*.vsix)"
run: echo "::set-output name=filename::$(ls rhino-debug-*.vsix)"

- name: Run tests
uses: GabrielBB/xvfb-action@v1.4
with:
run: make run-tests
# - name: Run tests
# uses: GabrielBB/xvfb-action@v1.4
# with:
# run: make run-tests

- name: Upload CI VSIX
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v2
with:
name: mono-debug-${{ github.sha }}.vsix
name: rhino-debug-${{ github.sha }}.vsix
path: ${{ steps.vsix_name.outputs.filename }}

- name: Create Release
Expand All @@ -78,8 +78,8 @@ jobs:
asset_name: ${{ steps.vsix_name.outputs.filename }}
asset_content_type: application/zip

- name: Publish to VS Marketplace
if: success() && startsWith(github.ref, 'refs/tags/v')
run: make publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
# - name: Publish to VS Marketplace
# if: success() && startsWith(github.ref, 'refs/tags/v')
# run: make publish
# env:
# VSCE_PAT: ${{ secrets.VSCE_PAT }}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"request": "launch",
"name": "Server",
"preLaunchTask": "make",
"program": "${workspaceRoot}/bin/Debug/net45/mono-debug.exe",
"program": "${workspaceRoot}/bin/Debug/mono-debug.exe",
"args": [ "--server=4711" ]
},
{
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"**/bin/**": true,
"**/obj/**": true,
"out/**": true
}
},
"omnisharp.enableMsBuildLoadProjectsOnDemand": true
}
Binary file removed images/mono-debug-icon.png
Binary file not shown.
Binary file added images/rhino-debug-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 39 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "mono-debug",
"displayName": "Mono Debug",
"version": "0.16.2",
"publisher": "ms-vscode",
"description": "Visual Studio Code debugger extension for Mono",
"icon": "images/mono-debug-icon.png",
"name": "rhino-debug",
"displayName": "Rhino Debug",
"version": "0.3.0",
"publisher": "mcneel",
"description": "Visual Studio Code debugger extension for Rhinoceros",
"icon": "images/rhino-debug-icon.png",
"categories": [
"Debuggers"
],
"author": {
"name": "Microsoft Corporation"
"name": "McNeel & Associates"
},
"license": "MIT",
"private": true,
Expand All @@ -20,7 +20,7 @@
"test": "make run-tests"
},
"engines": {
"vscode": "^1.32.0",
"vscode": "^1.40.0",
"node": "^14.0.0"
},
"dependencies": {
Expand All @@ -29,15 +29,15 @@
},
"repository": {
"type": "git",
"url": "https://github.com/microsoft/vscode-mono-debug.git"
"url": "https://github.com/mcneel/vscode-mono-debug.git"
},
"bugs": {
"url": "https://github.com/microsoft/vscode-mono-debug/issues"
"url": "https://github.com/mcneel/vscode-mono-debug/issues"
},
"devDependencies": {
"@types/mocha": "^8.0.3",
"@types/node": "^14.11.5",
"@types/vscode": "^1.32.0",
"@types/vscode": "^1.40.0",
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"eslint": "^7.1.0",
Expand All @@ -50,15 +50,16 @@
},
"main": "./out/extension",
"activationEvents": [
"onCommand:extension.mono-debug.configureExceptions",
"onCommand:extension.mono-debug.startSession"
"onCommand:extension.rhino-debug.configureExceptions",
"onCommand:extension.rhino-debug.startSession",
"onCommand:extension.derivedDataRoot"
],
"contributes": {
"configuration": {
"type": "object",
"title": "%configuration.title%",
"properties": {
"mono-debug.exceptionOptions": {
"rhino-debug.exceptionOptions": {
"type": "object",
"additionalProperties": {
"type": "string",
Expand Down Expand Up @@ -95,7 +96,7 @@
},
"commands": [
{
"command": "extension.mono-debug.configureExceptions",
"command": "extension.rhino-debug.configureExceptions",
"title": "%configure.exceptions.command%",
"category": "Debug"
}
Expand All @@ -113,7 +114,7 @@
],
"debuggers": [
{
"type": "mono",
"type": "rhino",
"label": "C# Mono",
"program": "./bin/Release/mono-debug.exe",
"osx": {
Expand All @@ -122,19 +123,20 @@
"linux": {
"runtime": "mono"
},
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"startSessionCommand": "extension.mono-debug.startSession",
"variables": {
"derivedDataRoot": "extension.derivedDataRoot"
},
"initialConfigurations": [
{
"name": "%mono.launch.config.name%",
"type": "mono",
"type": "rhino",
"request": "launch",
"program": "${workspaceRoot}/program.exe",
"program": "${command:derivedDataRoot}/Build/Products/Debug/Rhinoceros.app/Contents/MacOS/Rhinoceros",
"cwd": "${workspaceRoot}"
},
{
"name": "%mono.attach.config.name%",
"type": "mono",
"type": "rhino",
"request": "attach",
"address": "localhost",
"port": 55555
Expand Down Expand Up @@ -208,6 +210,14 @@
],
"description": "%mono.launch.console.description%",
"default": "internalConsole"
},
"maxConnectionAttempts": {
"type": "number",
"default": 10
},
"timeBetweenConnectionAttempts": {
"type": "number",
"default": 500
}
}
},
Expand All @@ -226,6 +236,14 @@
"description": "%mono.attach.address.description%",
"default": "undefined"
}
},
"maxConnectionAttempts": {
"type": "number",
"default": 10
},
"timeBetweenConnectionAttempts": {
"type": "number",
"default": 500
}
}
}
Expand Down
38 changes: 24 additions & 14 deletions src/csharp/MonoDebugSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,17 @@ public override async void Launch(Response response, dynamic args)

// validate argument 'program'
string programPath = getString(args, "program");
if (programPath == null) {
if (programPath == null && args.runtimeExecutable == null) {
SendErrorResponse(response, 3001, "Property 'program' is missing or empty.", null);
return;
}
programPath = ConvertClientPathToDebugger(programPath);
if (!File.Exists(programPath) && !Directory.Exists(programPath)) {
SendErrorResponse(response, 3002, "Program '{path}' does not exist.", new { path = programPath });
return;
if (programPath != null)
{
programPath = ConvertClientPathToDebugger(programPath);
if (!File.Exists(programPath) && !Directory.Exists(programPath)) {
SendErrorResponse(response, 3002, "Program '{path}' does not exist.", new { path = programPath });
return;
}
}

// validate argument 'cwd'
Expand Down Expand Up @@ -289,17 +292,21 @@ public override async void Launch(Response response, dynamic args)
string[] runtimeArguments = args.runtimeArgs.ToObject<string[]>();
if (runtimeArguments != null && runtimeArguments.Length > 0) {
cmdLine.AddRange(runtimeArguments);
}
}

// add 'program'
if (workingDirectory == null) {
// if no working dir given, we use the direct folder of the executable
workingDirectory = Path.GetDirectoryName(programPath);
cmdLine.Add(Path.GetFileName(programPath));
}
else {
// if working dir is given and if the executable is within that folder, we make the program path relative to the working dir
cmdLine.Add(Utilities.MakeRelativePath(workingDirectory, programPath));
if (programPath != null)
{
if (workingDirectory == null) {
// if no working dir given, we use the direct folder of the executable
workingDirectory = Path.GetDirectoryName(programPath);
cmdLine.Add(Path.GetFileName(programPath));
}
else {
// if working dir is given and if the executable is within that folder, we make the program path relative to the working dir
cmdLine.Add(Utilities.MakeRelativePath(workingDirectory, programPath));
}
}

// add 'args'
Expand Down Expand Up @@ -392,7 +399,10 @@ public override async void Launch(Response response, dynamic args)
}

if (debug) {
Connect(IPAddress.Parse(host), port);
var maxConnectionAttempts = getInt(args, "maxConnectionAttempts", MAX_CONNECTION_ATTEMPTS);
var timeBetweenConnectionAttempts = getInt(args, "timeBetweenConnectionAttempts", CONNECTION_ATTEMPT_INTERVAL);

Connect(IPAddress.Parse(host), port, maxConnectionAttempts, timeBetweenConnectionAttempts);
}

SendResponse(response);
Expand Down
18 changes: 12 additions & 6 deletions src/typescript/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,29 +177,35 @@ function startSession(config: any) : StartSessionResult {

function getDerivedDataRoot (config: any, context: vscode.ExtensionContext) : string {
const cp = require('child_process')
if (vscode.workspace.workspaceFolders == null)
return "";

for (let index = 0; index < vscode.workspace.workspaceFolders.length; index++) {
const workspaceFolder = vscode.workspace.workspaceFolders[index].uri.fsPath;

let args = [
context.extensionPath + '/bin/Debug/net45/mono-debug.exe',
const args = [
context.extensionPath + '/bin/Release/mono-debug.exe',
'--getDerivedDataRoot',
'--workspaceFolder=' + workspaceFolder
];

let result = cp.execFileSync('mono', args, { encoding: 'utf8' });
const result = cp.execFileSync('mono', args, { encoding: 'utf8' });
if (result.length > 0)
{
return result;
}
}

if (vscode.workspace.workspaceFile == null)
return "";

// fallback to rootPath
let args = [
context.extensionPath + '/bin/Debug/net45/mono-debug.exe',
const args = [
context.extensionPath + '/bin/Release/mono-debug.exe',
'--getDerivedDataRoot',
'--workspaceFolder=' + vscode.workspace.workspaceFile.path
];

let result = cp.execFileSync('mono', args, { encoding: 'utf8' });
const result = cp.execFileSync('mono', args, { encoding: 'utf8' });
return result;
}

0 comments on commit b8a2113

Please sign in to comment.