Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Commit

Permalink
chore(upgrades): upgraded dev deps
Browse files Browse the repository at this point in the history
* minor cleanups
* changes accordingly to MS mock debugger

For now we don't upgrade vscode packages from 1.19.0 to 1.26.0 due to breakage
  • Loading branch information
Morten Henriksen committed Feb 9, 2018
1 parent 21f43e7 commit a826b16
Show file tree
Hide file tree
Showing 8 changed files with 2,588 additions and 256 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
out/
npm-debug.log
perl_debugger.log
*.vsix
18 changes: 9 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,42 @@
"preLaunchTask": "npm",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
"--extensionDevelopmentPath=${workspaceFolder}"
],
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/out/*.js" ]
"outFiles": [ "${workspaceFolder}/out/*.js" ]
},
{
"type": "node",
"request": "launch",
"name": "Run Server",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/src/perlDebug.ts",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/src/perlDebug.ts",
"args": [ "--server=4711" ],
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/out/*.js" ]
"outFiles": [ "${workspaceFolder}/out/*.js" ]
},
{
"type": "node",
"request": "launch",
"name": "Run Tests",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-u", "tdd",
"--timeout", "999999",
"--colors",
"./out/tests/"
],
"sourceMaps": true,
"outDir": "${workspaceRoot}/out",
"outDir": "${workspaceFolder}/out",
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "perl",
"request": "launch",
"name": "Run Perl Debugger",
"program": "${workspaceRoot}/${command.AskForProgramName}",
"program": "${workspaceFolder}/${command.AskForProgramName}",
"stopOnEntry": true
}
]
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
"javascript.validate.enable": false,
"typescript.tsdk": "node_modules/typescript/lib",
"files.trimTrailingWhitespace": true,
"eslint.enable": false,
"editor.insertSpaces": false
}
25 changes: 16 additions & 9 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
{
"version": "0.1.0",
"command": "npm",
"isShellCommand": true,
"isWatching": true,
"showOutput": "always",
"args": [
"run", "watch"
],
"problemMatcher": "$tsc-watch"
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"identifier": "npm",
"script": "watch",
"problemMatcher": [
"$tsc-watch"
],
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
3 changes: 0 additions & 3 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@
appveyor.yml
src/**/*
out/tests/**/*
node_modules/**/*
**/*.js.map
!node_modules/vscode-debugprotocol/**/*
!node_modules/vscode-debugadapter/**/*
52 changes: 36 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"name": "Morten Henriksen",
"email": "[email protected]"
},
"license": "MIT",
"engines": {
"vscode": "^1.1.0",
"node": "^5.10.0"
"vscode": ">=1.1.10",
"node": ">=8.0.0"
},
"icon": "images/vscode-perl-debug.png",
"categories": [
Expand Down Expand Up @@ -42,21 +43,22 @@
]
},
"dependencies": {
"vscode-debugadapter": "^1.19.0",
"vscode-debugprotocol": "^1.19.0"
"await-notify": "1.0.1",
"vscode-debugadapter": "1.19.0",
"vscode-debugprotocol": "1.19.0"
},
"devDependencies": {
"concurrently": "^3.4.0",
"concurrently": "3.4.0",
"@types/es6-promise": "0.0.32",
"@types/mocha": "^2.2.32",
"@types/node": "^6.0.39",
"mocha": "^3.2.0",
"semantic-release": "^10.0.1",
"semantic-release-vsce": "^0.1.4",
"typescript": "^2.2.2",
"vscode": "^1.1.0",
"vscode-debugadapter-testsupport": "^1.19.0",
"tslint": "^5.1.0"
"@types/mocha": "2.2.45",
"@types/node": "7.0.43",
"mocha": "3.2.0",
"semantic-release": "10.0.1",
"semantic-release-vsce": "0.1.4",
"typescript": "2.7.1",
"vscode": "1.1.10",
"vscode-debugadapter-testsupport": "1.19.0",
"tslint": "5.8.0"
},
"scripts": {
"prepublish": "tsc -p ./src",
Expand Down Expand Up @@ -86,6 +88,9 @@
"label": "Perl Debug",
"program": "./out/perlDebug.js",
"runtime": "node",
"languages": [
"perl"
],
"configurationAttributes": {
"launch": {
"required": [
Expand All @@ -106,12 +111,12 @@
"root": {
"type": "string",
"description": "Workspace root.",
"default": "${workspaceRoot}/"
"default": "${workspaceFolder}/"
},
"program": {
"type": "string",
"description": "Absolute path to perl file.",
"default": "${workspaceRoot}/${relativeFile}"
"default": "${workspaceFolder}/${relativeFile}"
},
"stopOnEntry": {
"type": "boolean",
Expand Down Expand Up @@ -141,7 +146,22 @@
}
}
},
"initialConfigurations": [
{
"type": "perl",
"request": "launch",
"name": "Perl-Debug local",
"program": "${workspaceFolder}/${relativeFile}",
"exec": "perl",
"execArgs": [],
"root": "${workspaceRoot}/",
"inc": [],
"args": [],
"env": {},
"stopOnEntry": true
"initialConfigurations": "extension.perl-debug.provideInitialConfigurations"
}
]
}
]
}
Expand Down
23 changes: 17 additions & 6 deletions src/perlDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {DebugProtocol} from 'vscode-debugprotocol';
import {readFileSync} from 'fs';
import {basename, dirname, join} from 'path';
import {spawn, ChildProcess} from 'child_process';
const { Subject } = require('await-notify');
import { perlDebuggerConnection } from './adapter';
import { variableType, ParsedVariable, ParsedVariableScope, resolveVariable } from './variableParser';

Expand Down Expand Up @@ -67,6 +68,8 @@ class PerlDebugSession extends LoggingDebugSession {

private rootPath: string = '';

private _configurationDone = new Subject();

/* protected convertClientPathToDebugger(clientPath: string): string {
return clientPath.replace(this.rootPath, '');
}
Expand Down Expand Up @@ -117,19 +120,27 @@ class PerlDebugSession extends LoggingDebugSession {
});
}

protected launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {
/**
* Called at the end of the configuration sequence.
* Indicates that all breakpoints etc. have been sent to the DA and that the 'launch' can start.
*/
protected configurationDoneRequest(response: DebugProtocol.ConfigurationDoneResponse, args: DebugProtocol.ConfigurationDoneArguments): void {
super.configurationDoneRequest(response, args);

// notify the launchRequest that configuration has finished
this._configurationDone.notify();
}

protected async launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments) {
this.rootPath = args.root;

const inc = args.inc && args.inc.length ? args.inc.map(directory => `-I${directory}`) : [];
const execArgs = [].concat(args.execArgs || [], inc);
const programArguments = args.args || [];

if (args.trace) {
logger.setup(Logger.LogLevel.Verbose, /*logToFile=*/true);
} else {
logger.setup(Logger.LogLevel.Stop, false);
}
logger.setup(args.trace ? Logger.LogLevel.Verbose : Logger.LogLevel.Stop, false);

await this._configurationDone.wait(1000);
this.perlDebugger.launchRequest(args.program, args.root, execArgs, {
exec: args.exec,
args: programArguments,
Expand Down
Loading

0 comments on commit a826b16

Please sign in to comment.